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

More cleanups:

* Add some comments on TRAVERSE-ACTION; expand those on SOURCE-FILE-TYPE.
* Remove a few unnecessary input-files or output-files methods
* Remove (declare (ignorable ...)) for specialized arguments. Specialize a few arguments to T.
* Remove most when-upgrading methods, since we drop data on old incompatible ASDFs.
parent d722ad15
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -267,7 +267,6 @@ The class needs to be updated for ASDF 3.1 and specify appropriate propagation m
  (define-convenience-action-methods operation-done-p (operation component))

  (defmethod operation-done-p ((o operation) (c component))
    (declare (ignorable o c))
    t)

  (defmethod output-files :around (operation component)
@@ -289,7 +288,6 @@ The class needs to be updated for ASDF 3.1 and specify appropriate propagation m
               (mapcar *output-translation-function* absolute-pathnames))))
       t)))
  (defmethod output-files ((o operation) (c component))
    (declare (ignorable o c))
    nil)
  (defun output-file (operation component)
    "The unique output file of performing OPERATION on COMPONENT"
@@ -303,7 +301,6 @@ The class needs to be updated for ASDF 3.1 and specify appropriate propagation m
      (call-next-method)))

  (defmethod input-files ((o operation) (c component))
    (declare (ignorable o c))
    nil)

  (defmethod input-files ((o selfward-operation) (c component))
@@ -369,7 +366,6 @@ in some previous image, or T if it needs to be done.")
  (defmethod perform :after ((o operation) (c component))
    (mark-operation-done o c))
  (defmethod perform ((o operation) (c parent-component))
    (declare (ignorable o c))
    nil)
  (defmethod perform ((o operation) (c source-file))
    (sysdef-error
+5 −5
Original line number Diff line number Diff line
@@ -43,13 +43,13 @@
  (defgeneric (setf operation-on-warnings) (x operation))
  (defgeneric (setf operation-on-failure) (x operation))
  (defmethod operation-on-warnings ((o operation))
    (declare (ignorable o)) *compile-file-warnings-behaviour*)
    *compile-file-warnings-behaviour*)
  (defmethod operation-on-failure ((o operation))
    (declare (ignorable o)) *compile-file-failure-behaviour*)
    *compile-file-failure-behaviour*)
  (defmethod (setf operation-on-warnings) (x (o operation))
    (declare (ignorable o)) (setf *compile-file-warnings-behaviour* x))
    (setf *compile-file-warnings-behaviour* x))
  (defmethod (setf operation-on-failure) (x (o operation))
    (declare (ignorable o)) (setf *compile-file-failure-behaviour* x))
    (setf *compile-file-failure-behaviour* x))

  (defun system-definition-pathname (x)
    ;; As of 2.014.8, we mean to make this function obsolete,
@@ -119,7 +119,7 @@ processed in order by OPERATE."))
         :ignore-inherited-configuration))))

  (defmethod operate :before (operation-class system &rest args &key &allow-other-keys)
    (declare (ignorable operation-class system args))
    (declare (ignore operation-class system args))
    (when (find-symbol* '#:output-files-for-system-and-operation :asdf nil)
      (error "ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS, which you are using.
ASDF 2 now achieves the same purpose with its builtin ASDF-OUTPUT-TRANSLATIONS,
+7 −24
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@
  (defmethod initialize-instance :after ((instance bundle-op) &rest initargs
                                         &key (name-suffix nil name-suffix-p)
                                         &allow-other-keys)
    (declare (ignorable initargs name-suffix))
    (declare (ignore initargs name-suffix))
    (unless name-suffix-p
      (setf (slot-value instance 'name-suffix)
            (unless (typep instance 'program-op)
@@ -178,7 +178,6 @@
                             (operation-original-initargs instance))))

  (defmethod bundle-op-build-args :around ((o no-ld-flags-op))
    (declare (ignorable o))
    (let ((args (call-next-method)))
      (remf args :ld-flags)
      args))
@@ -223,7 +222,6 @@
      ,@(call-next-method)))

  (defmethod component-depends-on :around ((o bundle-op) (c component))
    (declare (ignorable o c))
    (if-let (op (and (eq (type-of o) 'bundle-op) (component-build-operation c)))
      `((,op ,c))
      (call-next-method)))
@@ -285,7 +283,6 @@
;;;
(with-upgradability ()
  (defmethod component-depends-on ((o load-fasl-op) (c system))
    (declare (ignorable o))
    `((,o ,@(loop :for dep :in (component-sideway-dependencies c)
                  :collect (resolve-dependency-spec c dep)))
      (,(if (user-system-p c) 'fasl-op 'load-op) ,c)
@@ -295,10 +292,6 @@
    (when (user-system-p c)
      (output-files (find-operation o 'fasl-op) c)))

  (defmethod perform ((o load-fasl-op) c)
    (declare (ignorable o c))
    nil)

  (defmethod perform ((o load-fasl-op) (c system))
    (when (input-files o c)
      (perform-lisp-load-fasl o c)))
@@ -316,11 +309,7 @@
  (defmethod trivial-system-p ((s system))
    (every #'(lambda (c) (typep c 'compiled-file)) (component-children s)))

  (defmethod output-files (o (c compiled-file))
    (declare (ignorable o c))
    nil)
  (defmethod input-files (o (c compiled-file))
    (declare (ignorable o))
  (defmethod input-files ((o operation) (c compiled-file))
    (component-pathname c))
  (defmethod perform ((o load-op) (c compiled-file))
    (perform-lisp-load-fasl o c))
@@ -329,7 +318,6 @@
  (defmethod perform ((o load-fasl-op) (c compiled-file))
    (perform (find-operation o 'load-op) c))
  (defmethod perform ((o operation) (c compiled-file))
    (declare (ignorable o c))
    nil))

;;;
@@ -337,19 +325,15 @@
;;;
(with-upgradability ()
  (defmethod trivial-system-p ((s prebuilt-system))
    (declare (ignorable s))
    t)

  (defmethod perform ((o lib-op) (c prebuilt-system))
    (declare (ignorable o c))
    nil)

  (defmethod component-depends-on ((o lib-op) (c prebuilt-system))
    (declare (ignorable o c))
    nil)

  (defmethod component-depends-on ((o monolithic-lib-op) (c prebuilt-system))
    (declare (ignorable o))
    nil))


@@ -422,14 +406,12 @@
          (combine-fasls fasl-files output-file)))))

  (defmethod input-files ((o load-op) (s precompiled-system))
    (declare (ignorable o))
    (bundle-output-files (find-operation o 'fasl-op) s))

  (defmethod perform ((o load-op) (s precompiled-system))
    (perform-lisp-load-fasl o s))

  (defmethod component-depends-on ((o load-fasl-op) (s precompiled-system))
    (declare (ignorable o))
    `((load-op ,s) ,@(call-next-method))))

  #| ;; Example use:
@@ -496,8 +478,9 @@

#+(and (not asdf-use-unsafe-mac-bundle-op)
       (or (and ecl darwin) (and abcl darwin)))
(defmethod perform :before ((op basic-fasl-op) c)
  (declare (ignorable op c))
  (unless (uiop:featurep :asdf-use-unsafe-mac-bundle-op)
(defmethod perform :before ((o basic-fasl-op) (c component))
  (unless (featurep :asdf-use-unsafe-mac-bundle-op)
    (cerror "Continue after modifying *FEATURES*."
            "BASIC-FASL-OP bundle operations are not supported on Mac OSX for this lisp.~%~TTo continue, push :asdf-use-unsafe-mac-bundle-op on *FEATURES*.~%~TPlease report to ASDF-DEVEL if this works for you.")))
            "BASIC-FASL-OP bundle operations are not supported on Mac OS X for this lisp.~%~T~
To continue, push :asdf-use-unsafe-mac-bundle-op onto *FEATURES*.~%~T~
Please report to ASDF-DEVEL if this works for you.")))
+7 −26
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ another pathname in a degenerate way."))
  (defgeneric component-version (component))
  (defgeneric (setf component-version) (new-version component))
  (defgeneric component-parent (component))
  (defmethod component-parent ((component null)) (declare (ignorable component)) nil)
  (defmethod component-parent ((component null)) nil)

  ;; Backward compatible way of computing the FILE-TYPE of a component.
  ;; TODO: find users, have them stop using that, remove it for ASDF4.
@@ -83,11 +83,6 @@ another pathname in a degenerate way."))
                       (duplicate-names-name c))))))



(when-upgrading (:when (find-class 'component nil))
  (defmethod reinitialize-instance :after ((c component) &rest initargs &key)
    (declare (ignorable c initargs)) (values)))

(with-upgradability ()
  (defclass component ()
    ((name :accessor component-name :initarg :name :type string :documentation
@@ -203,19 +198,6 @@ another pathname in a degenerate way."))
                  (setf (gethash name hash) c))
        hash))))

(when-upgrading (:when (find-class 'module nil))
  (defmethod reinitialize-instance :after ((m module) &rest initargs &key)
    (declare (ignorable m initargs)) (values))
  (defmethod update-instance-for-redefined-class :after
      ((m module) added deleted plist &key)
    (declare (ignorable m added deleted plist))
    (when (and (member 'children added) (member 'components deleted))
      (setf (slot-value m 'children)
            ;; old ECLs provide an alist instead of a plist(!)
            (if (or #+ecl (consp (first plist))) (or #+ecl (cdr (assoc 'components plist)))
                (getf plist 'components)))
      (compute-children-by-name m))))

(with-upgradability ()
  (defclass module (child-component parent-component)
    (#+clisp (components)))) ;; backward compatibility during upgrade only
@@ -241,9 +223,10 @@ another pathname in a degenerate way."))
          pathname)))

  (defmethod component-relative-pathname ((component component))
    ;; source-file-type is backward-compatibility with ASDF1;
    ;; we ought to be able to extract this from the component alone with COMPONENT-TYPE.
    ;; TODO: track who uses it, and have them not use it anymore.
    ;; SOURCE-FILE-TYPE below is strictly for backward-compatibility with ASDF1.
    ;; We ought to be able to extract this from the component alone with COMPONENT-TYPE.
    ;; TODO: track who uses it, and have them not use it anymore;
    ;; maybe issue a WARNING (then eventually CERROR) if the two methods diverge?
    (parse-unix-namestring
     (or (and (slot-boundp component 'relative-pathname)
              (slot-value component 'relative-pathname))
@@ -252,12 +235,10 @@ another pathname in a degenerate way."))
     :type (source-file-type component (component-system component))
     :defaults (component-parent-pathname component)))

  (defmethod source-file-type ((component parent-component) system)
    (declare (ignorable component system))
  (defmethod source-file-type ((component parent-component) (system parent-component))
    :directory)

  (defmethod source-file-type ((component file-component) system)
    (declare (ignorable system))
  (defmethod source-file-type ((component file-component) (system parent-component))
    (file-type component)))


+2 −5
Original line number Diff line number Diff line
@@ -79,8 +79,7 @@
  (defmethod find-component ((c component) (name cons))
    (find-component (find-component c (car name)) (cdr name)))

  (defmethod find-component (base (actual component))
    (declare (ignorable base))
  (defmethod find-component ((base t) (actual component))
    actual)

  (defun resolve-dependency-name (component name &optional version)
@@ -120,11 +119,9 @@
           (cons combinator arguments) component))

  (defmethod resolve-dependency-combination (component (combinator (eql :feature)) arguments)
    (declare (ignorable combinator))
    (when (featurep (first arguments))
      (resolve-dependency-spec component (second arguments))))

  (defmethod resolve-dependency-combination (component (combinator (eql :version)) arguments)
    (declare (ignorable combinator)) ;; See https://bugs.launchpad.net/asdf/+bug/527788
    (resolve-dependency-name component (first arguments) (second arguments))))
    (resolve-dependency-name component (first arguments) (second arguments)))) ;; See lp#527788
Loading