diff --git a/asdf.asd b/asdf.asd index 2c120991aade57d1365f952afb0e7951da1f0331..9f51ee778e61ce7acb694679469b27a09cfe4ea3 100644 --- a/asdf.asd +++ b/asdf.asd @@ -74,7 +74,7 @@ :licence "MIT" :description "Another System Definition Facility" :long-description "ASDF builds Common Lisp software organized into defined systems." - :version "2.28.10" ;; to be automatically updated by make bump-version + :version "2.28.11" ;; 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. diff --git a/filesystem.lisp b/filesystem.lisp index 8a938bf16bfaca119d292e58e6b020af8996ecd8..669144a6426fa1fd2de31098fd18cf8149372ff3 100644 --- a/filesystem.lisp +++ b/filesystem.lisp @@ -74,7 +74,9 @@ a CL pathname satisfying all the specified constraints as per ENSURE-PATHNAME" ;; and we can survive and we will continue the planning ;; as if the file were very old. ;; (or should we treat the case in a different, special way?) - (handler-case (file-write-date (translate-logical-pathname pathname)) (file-error () nil))) + (and pathname + (handler-case (file-write-date (translate-logical-pathname pathname)) + (file-error () nil)))) (defun probe-file* (p &key truename) "when given a pathname P (designated by a string as per PARSE-NAMESTRING), diff --git a/header.lisp b/header.lisp index 7aec6d6fb81afb9003ee4dc321eb858e104b155b..d9b6380844ae7d291bfd934dab18b6f35c1a3888 100644 --- a/header.lisp +++ b/header.lisp @@ -1,5 +1,5 @@ ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.28.10: Another System Definition Facility. +;;; This is ASDF 2.28.11: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to <asdf-devel@common-lisp.net>. diff --git a/lisp-action.lisp b/lisp-action.lisp index 1945d81710594318a41adae3b661f69837bbab49..0d8701ade538c7c3b32da1137697d0945214ca46 100644 --- a/lisp-action.lisp +++ b/lisp-action.lisp @@ -90,17 +90,17 @@ &optional #+clisp lib-file #+(or ecl mkcl) object-file - #+(or cmu clozure sbcl scl) warnings-file) outputs + warnings-file) outputs (call-with-around-compile-hook c #'(lambda (&rest flags) (with-muffled-compiler-conditions () (apply 'compile-file* input-file :output-file output-file :external-format (component-external-format c) + :warnings-file warnings-file (append #+clisp (list :lib-file lib-file) #+(or ecl mkcl) (list :object-file object-file) - #+(or cmu clozure sbcl scl) (list :warnings-file warnings-file) flags (compile-op-flags o))))))) (check-lisp-compile-results output warnings-p failure-p "~/asdf-action::format-action/" (list (cons o c)))))) @@ -130,13 +130,13 @@ `(,f ;; the fasl is the primary output, in first position #+clisp ,@`(,(make-pathname :type "lib" :defaults f)) - ,@(when (and *warnings-file-type* (not (builtin-system-p (component-system c)))) - `(,(make-pathname :type *warnings-file-type* :defaults f))) #+ecl ,@(unless (use-ecl-byte-compiler-p) `(,(compile-file-pathname i :type :object))) #+mkcl - ,(compile-file-pathname i :fasl-p nil)))) ;; object file + ,(compile-file-pathname i :fasl-p nil) ;; object file + ,@(when (and *warnings-file-type* (not (builtin-system-p (component-system c)))) + `(,(make-pathname :type *warnings-file-type* :defaults f)))))) (defmethod component-depends-on ((o compile-op) (c component)) (declare (ignorable o)) `((prepare-op ,c) ,@(call-next-method))) diff --git a/lisp-build.lisp b/lisp-build.lisp index 6618a67c5ec173909cc72d69901628ad4d6dba1b..5c8ba1d718c3630b183f0974ac6fa3d0cee2c2be 100644 --- a/lisp-build.lisp +++ b/lisp-build.lisp @@ -220,15 +220,17 @@ Note that ASDF ALWAYS raises an error if it fails to create an output file when (let ((name (unreify-simple-sexp function-name))) (if (and (consp name) (eq (first name) 'setf)) (let ((setfed (second name))) - (gethash setfed ccl::%setf-function-names%) - name)))) + (gethash setfed ccl::%setf-function-names%)) + name))) (defun reify-deferred-warning (deferred-warning) (with-accessors ((warning-type ccl::compiler-warning-warning-type) (args ccl::compiler-warning-args) (source-note ccl:compiler-warning-source-note) (function-name ccl:compiler-warning-function-name)) deferred-warning (list :warning-type warning-type :function-name (reify-function-name function-name) - :source-note (reify-source-note source-note) :args (reify-simple-sexp args)))) + :source-note (reify-source-note source-note) + :args (destructuring-bind (fun . formals) args + (cons (reify-function-name fun) (reify-simple-sexp formals)))))) (defun unreify-deferred-warning (reified-deferred-warning) (destructuring-bind (&key warning-type function-name source-note args) reified-deferred-warning @@ -237,8 +239,8 @@ Note that ASDF ALWAYS raises an error if it fails to create an output file when :function-name (unreify-function-name function-name) :source-note (unreify-source-note source-note) :warning-type warning-type - :args (unreify-simple-sexp args))))) - + :args (destructuring-bind (fun . formals) args + (cons (unreify-function-name fun) (unreify-simple-sexp formals))))))) #+(or cmu scl) (defun reify-undefined-warning (warning) ;; Extracting undefined-warnings from the compilation-unit @@ -283,6 +285,10 @@ Note that ASDF ALWAYS raises an error if it fails to create an output file when "return a portable S-expression, portably readable and writeable in any Common Lisp implementation using READ within a WITH-SAFE-IO-SYNTAX, that represents the warnings currently deferred by WITH-COMPILATION-UNIT. One of three functions required for deferred-warnings support in ASDF." + #+allegro + (reify-simple-sexp + (list :functions-defined excl::.functions-defined. + :functions-called excl::.functions-called.)) #+clozure (mapcar 'reify-deferred-warning (if-let (dw ccl::*outstanding-deferred-warnings*) @@ -322,6 +328,13 @@ Handle any warning that has been resolved already, such as an undefined function that has been defined since. One of three functions required for deferred-warnings support in ASDF." (declare (ignorable reified-deferred-warnings)) + #+allegro + (destructuring-bind (&key functions-defined functions-called) + (unreify-simple-sexp reified-deferred-warnings) + (setf excl::.functions-defined. + (append functions-defined excl::.functions-defined.) + excl::.functions-called. + (append functions-called excl::.functions-called.))) #+clozure (let ((dw (or ccl::*outstanding-deferred-warnings* (setf ccl::*outstanding-deferred-warnings* (ccl::%defer-warnings t))))) @@ -383,6 +396,9 @@ One of three functions required for deferred-warnings support in ASDF." (defun reset-deferred-warnings () "Reset the set of deferred warnings to be handled at the end of the current WITH-COMPILATION-UNIT. One of three functions required for deferred-warnings support in ASDF." + #+allegro + (setf excl::.functions-defined. nil + excl::.functions-called. nil) #+clozure (if-let (dw ccl::*outstanding-deferred-warnings*) (let ((mdw (ccl::ensure-merged-deferred-warnings dw))) @@ -414,6 +430,8 @@ possibly in a different process." (defun warnings-file-type (&optional implementation-type) (case (or implementation-type *implementation-type*) + ((:acl :allegro) "allegro-warnings") + ;;((:clisp) "clisp-warnings") ((:cmu :cmucl) "cmucl-warnings") ((:sbcl) "sbcl-warnings") ((:clozure :ccl) "ccl-warnings") diff --git a/test/defmacro-foo.lisp b/test/defmacro-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..f68f4e3c976e6f2ba65a6e25bb5ed1c0bfe7112e --- /dev/null +++ b/test/defmacro-foo.lisp @@ -0,0 +1,4 @@ +(in-package :asdf-test/deferred-warnings) + +(defmacro foo (x) + `(1+ ,x)) diff --git a/test/defsetf-foo.lisp b/test/defsetf-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..bb6cc6a3e4e97535abf64d852265edcd016e660b --- /dev/null +++ b/test/defsetf-foo.lisp @@ -0,0 +1,8 @@ +(in-package :asdf-test/deferred-warnings) + +(defvar *foo* (make-hash-table :test 'equal)) + +(defun set-foo (x v) + (setf (gethash x *foo*) v)) + +(defsetf foo set-foo) diff --git a/test/defun-foo.lisp b/test/defun-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..c0c62e415fd6670e2623bfc76441e7e525703e82 --- /dev/null +++ b/test/defun-foo.lisp @@ -0,0 +1,4 @@ +(in-package :asdf-test/deferred-warnings) + +(defun foo (x) + (1+ x)) diff --git a/test/defun-setf-foo.lisp b/test/defun-setf-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..3a6abea9de1033d3dfa9708c3e1ae0babe0f574a --- /dev/null +++ b/test/defun-setf-foo.lisp @@ -0,0 +1,6 @@ +(in-package :asdf-test/deferred-warnings) + +(defvar *foo* (make-hash-table :test 'equal)) + +(defun (setf foo) (v x) + (setf (gethash x *foo*) v)) diff --git a/test/script-support.lisp b/test/script-support.lisp index e1d8d82de362db23a7ea0a39e2528af7b3d51a4e..4a307381dfe75e18b5970501a2bc3ab7235c1a60 100644 --- a/test/script-support.lisp +++ b/test/script-support.lisp @@ -486,16 +486,17 @@ is bound, write a message and exit on an error. If (pathname-components *test-directory*) (pathname-components x))) (setf *test-directory* x))) + (format t "Frob packages~%") + (use-package :asdf :asdf-test) + (use-package :asdf/driver :asdf-test) + (use-package :asdf/cache :asdf-test) + (setf *package* (find-package :asdf-test)) t) (defun load-asdf (&optional tag) #+gcl2.6 (load-asdf-lisp tag) #-gcl2.6 (load-asdf-fasl tag) - (use-package :asdf :asdf-test) - (use-package :asdf/driver :asdf-test) - (use-package :asdf/cache :asdf-test) - (configure-asdf) - (setf *package* (find-package :asdf-test))) + (configure-asdf)) (defun debug-asdf () (setf *debug-asdf* t) diff --git a/test/test-deferred-warnings.script b/test/test-deferred-warnings.script index 2687d1c8a40ef6c0a883032d0e771ee40cbf6ec3..97672af1913d7e0db82f3b4713d37563a9ebf616 100644 --- a/test/test-deferred-warnings.script +++ b/test/test-deferred-warnings.script @@ -1,15 +1,45 @@ ;;; -*- Lisp -*- -(clear-system :test-deferred-warnings) -(def-test-system :test-deferred-warnings +(in-package :asdf-test) + +(def-test-system :unintern-foo + :components ((:file "unintern-foo"))) +(def-test-system :use-foo-only + :depends-on (:unintern-foo) + :components ((:file "use-foo"))) +(def-test-system :use-then-defun-foo + :depends-on (:unintern-foo) + :serial t + :components ((:file "use-foo") (:file "defun-foo"))) +(def-test-system :use-then-defmacro-foo + :depends-on (:unintern-foo) + :serial t + :components ((:file "use-foo") (:file "defmacro-foo"))) +(def-test-system :use-setf-foo-only + :depends-on (:unintern-foo) + :components ((:file "use-setf-foo"))) +(def-test-system :use-setf-then-defun-foo + :depends-on (:unintern-foo) :serial t - :components ((:file "undefined-function") - (:file "file1"))) + :components ((:file "use-setf-foo") (:file "defun-setf-foo"))) +(def-test-system :use-setf-then-defsetf-foo + :depends-on (:unintern-foo) + :serial t + :components ((:file "use-setf-foo") (:file "defsetf-foo"))) + (DBG :tdw0 *compile-file-warnings-behaviour*) (assert (handler-case (let ((*compile-file-warnings-behaviour* :ignore)) - (load-system :test-deferred-warnings :force t) + (load-system :use-foo-only :force t)) + (error (c) + (DBG :cfwbi c) + nil))) + +(assert + (handler-case + (let ((*compile-file-warnings-behaviour* :ignore)) + (load-system :use-setf-foo-only :force t) t) (error (c) (DBG :cfwbi c) @@ -19,24 +49,53 @@ (assert (handler-case (let ((*warnings-file-type* nil)) - (load-system :test-deferred-warnings :force t) + (load-system :use-foo-only :force t) t) (error () (DBG :wftn c) nil))) -#+(or clozure cmu sbcl scl) +(unless *warnings-file-type* + (leave-test 0 "Your Lisp does not support deferred-warnings")) + (assert (handler-case (let ((*compile-file-warnings-behaviour* :error)) - (load-system :test-deferred-warnings :force t) + (perform 'compile-op :use-foo-only) nil) (compile-warned-error () t))) -#+(or clozure cmu sbcl scl) (assert (handler-case (let ((*compile-file-warnings-behaviour* :error)) - (perform 'compile-op :test-deferred-warnings) + (perform 'compile-op :use-setf-foo-only) nil) (compile-warned-error () t))) + +(let ((*compile-file-warnings-behaviour* :error)) + (load-system :use-then-defun-foo)) + +(setf *compile-file-warnings-behaviour* :error) + +(load-system :use-setf-then-defun-foo) + +;;#+clozure (trace load compile-file check-deferred-warnings check-lisp-compile-warnings) + +;; FIXME: on CCL, the defmacro warning is found while loading the defmacro fasl. +;; We should probably beef up the detection in reify-deferred-warnings, +;; possibly file a bug. +#-clozure +(assert + (handler-case + (load-system :use-then-defmacro-foo :force t) + ((or compile-file-error compile-warned-error) () t) + ;;(t (c) (DBG :utdf0 c)) + (:no-error (&rest values) (DBG :utdf1 values) nil))) + +#-clozure +(assert + (handler-case + (load-system :use-setf-then-defsetf-foo :force t) + ((or compile-file-error compile-warned-error) () t) + ;;(t (c) (DBG :ustdf0 c)) + (:no-error (&rest values) (DBG :ustdf1 values) nil))) diff --git a/test/undefined-function.lisp b/test/undefined-function.lisp deleted file mode 100644 index 48915bd4da6e72adb5981a2e2c74d085dc4e2694..0000000000000000000000000000000000000000 --- a/test/undefined-function.lisp +++ /dev/null @@ -1,5 +0,0 @@ - -(in-package :asdf) - -(defun using-some-undefined-function () - (some-undefined-function)) diff --git a/test/unintern-foo.lisp b/test/unintern-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..d2604a77ab1e37900a3979053e5a3a20bf19aed2 --- /dev/null +++ b/test/unintern-foo.lisp @@ -0,0 +1,5 @@ +(eval-when (:compile-toplevel :load-toplevel :execute) + (when (find-package :asdf-test/deferred-warnings) + (delete-package :asdf-test/deferred-warnings))) + +(defpackage :asdf-test/deferred-warnings (:use :asdf/driver :asdf/common-lisp)) diff --git a/test/use-foo.lisp b/test/use-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..3c91622b90546254e65d1790f4936c259838318f --- /dev/null +++ b/test/use-foo.lisp @@ -0,0 +1,4 @@ +(in-package :asdf-test/deferred-warnings) + +(defun use-foo (x) + (foo x)) diff --git a/test/use-setf-foo.lisp b/test/use-setf-foo.lisp new file mode 100644 index 0000000000000000000000000000000000000000..89737212d8e63a48713a76959f5138dd9803488a --- /dev/null +++ b/test/use-setf-foo.lisp @@ -0,0 +1,4 @@ +(in-package :asdf-test/deferred-warnings) + +(defun use-setf-foo (v x) + (setf (foo x) v)) diff --git a/upgrade.lisp b/upgrade.lisp index 36bc0f0ebf068c8543af6ed195fc5699d8579cb4..ca9358b783a432428a9c0115401f8e2c2f546311 100644 --- a/upgrade.lisp +++ b/upgrade.lisp @@ -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.28.10") + (asdf-version "2.28.11") (existing-version (asdf-version))) (setf *asdf-version* asdf-version) (when (and existing-version (not (equal asdf-version existing-version))) diff --git a/version.lisp-expr b/version.lisp-expr index 69a1e9e7855d81135b05f3ae767e668db374539c..4e44b4bfcfaa6dcd019204881c6c8e6807eb585b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -1 +1 @@ -"2.28.10" +"2.28.11"