Commit c3cb58db authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

2.32.35: also catch non-system-system definitions. Add test cases.

parent c19a17d8
......@@ -74,7 +74,7 @@
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.32.34" ;; to be automatically updated by make bump-version
:version "2.32.35" ;; to be automatically updated by make bump-version
:depends-on ()
#+asdf3 :encoding #+asdf3 :utf-8
;; For most purposes, asdf itself specially counts as a builtin system.
......
......@@ -11,7 +11,8 @@
#:defsystem #:register-system-definition
#:class-for-type #:*default-component-class*
#:determine-system-directory #:parse-component-form
#:duplicate-names #:non-toplevel-system #:sysdef-error-component #:check-component-input))
#:duplicate-names #:non-toplevel-system #:non-system-system
#:sysdef-error-component #:check-component-input))
(in-package :asdf/defsystem)
;;; Pathname
......@@ -71,6 +72,13 @@
(format s (compatfmt "~@<Error while defining system: multiple components are given same name ~S~@:>")
(duplicate-names-name c)))))
(define-condition non-system-system (system-definition-error)
((name :initarg :name :reader non-system-system-name)
(class-name :initarg :class-name :reader non-system-system-class-name))
(:report (lambda (c s)
(format s (compatfmt "~@<Error while defining system ~S: class ~S isn't a subclass of ~S~@:>")
(non-system-system-name c) (non-system-system-class-name c) 'system))))
(define-condition non-toplevel-system (system-definition-error)
((parent :initarg :parent :reader non-toplevel-system-parent)
(name :initarg :name :reader non-toplevel-system-name))
......@@ -222,6 +230,8 @@
;; We change-class AFTER we loaded the defsystem-depends-on
;; since the class might be defined as part of those.
(let ((class (class-for-type nil class)))
(unless (subtypep class 'system)
(error 'non-system-system :name name :class-name (class-name class)))
(unless (eq (type-of system) class)
(change-class system class)))
(parse-component-form
......
......@@ -993,7 +993,7 @@ component-list := ( @var{component-def}* )
component-def := ( component-type simple-component-name @var{option}* )
component-type := :system | :module | :file | :static-file | other-component-type
component-type := :module | :file | :static-file | other-component-type
other-component-type := symbol-by-name (@pxref{The defsystem grammar,,Component types})
......@@ -1035,10 +1035,15 @@ the current package. So a component type @code{my-component-type}, in
the current package @code{my-system-asd} can be specified as
@code{:my-component-type}, or @code{my-component-type}.
@code{system} and its subclasses are @emph{not}
allowed as component types for such children components.
@subsection System class names
A system class name will be looked up in the same way as a Component
type (see above). Typically, one will not need to specify a system
A system class name will be looked up
in the same way as a Component type (see above),
except that only @code{system} and its subclasses are allowed.
Typically, one will not need to specify a system
class name, unless using a non-standard system class defined in some
ASDF extension, typically loaded through @code{DEFSYSTEM-DEPENDS-ON},
see below. For such class names in the ASDF package, we recommend that
......
;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
;;; This is ASDF 2.32.34: Another System Definition Facility.
;;; This is ASDF 2.32.35: Another System Definition Facility.
;;;
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <asdf-devel@common-lisp.net>.
......
......@@ -116,7 +116,7 @@
#:missing-dependency
#:missing-dependency-of-version
#:circular-dependency ; errors
#:duplicate-names #:non-toplevel-system
#:duplicate-names #:non-toplevel-system #:non-system-system
#:try-recompiling
#:retry
......
;;; -*- Lisp -*-
(defun defsystem-error-handler (form &optional (error 'error))
(handler-case (eval form)
(error () t)
(:no-error (&rest values)
(declare (ignore values))
(error "Expected an error out of ~S" form))))
(defmacro defsystem-error ((&optional (error 'error)) &rest r)
`(defsystem-error-handler '(def-test-system ,@r) ',error))
(defsystem-error (non-system-system)
:foo :class :cl-source-file)
(defsystem-error (non-toplevel-system)
:foo :components ((:system :bar)))
......@@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
;; "3.4.5.67" would be a development version in the official upstream of 3.4.5.
;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5
;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67
(asdf-version "2.32.34")
(asdf-version "2.32.35")
(existing-version (asdf-version)))
(setf *asdf-version* asdf-version)
(when (and existing-version (not (equal asdf-version existing-version)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment