Commit 8fdf8013 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

2.28.11: implement deferred warnings for allegro. Beef them up for CCL.

Many thanks to Duane Rettig for explanations on how to support Franz.
lisp-action cleaned up some more for deferred-warnings.
test-deferred-warnings beefed up.
CCL still isn't fully there yet, and needs to better detect
forward reference to macros.
Also, make safe-file-write-date NIL robust independently of implementation.
parent 6500c6e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.
+3 −1
Original line number Diff line number Diff line
@@ -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),
+1 −1
Original line number Diff line number Diff line
;;; -*- 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>.
+5 −5
Original line number Diff line number Diff line
@@ -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)))
+23 −5
Original line number Diff line number Diff line
@@ -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")
Loading