Commit 90fb36de authored by Robert Goldman's avatar Robert Goldman
Browse files

Merge branch 'defgeneric-upgrade' into 'master'

Stop fmakunbound'ing defgeneric's past the upgrade trigger

Avoid using `fmakunbound` unless necessary, and clear registered systems if we do.

Audit existing gf's and conclude that only `component-depends-on`,  `input-files` and `find-component` need it, and that the `*oldest-forward-compatible-version*` is 3.1.7.20.

This is a response to https://bugs.launchpad.net/asdf/+bug/1631771

See merge request !36
parents c261a97a e69904a8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -78,8 +78,8 @@ SCL ?= scl
XCL ?= xcl

header_lisp := header.lisp
driver_lisp := uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/run-program.lisp uiop/lisp-build.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp
defsystem_lisp := upgrade.lisp component.lisp system.lisp cache.lisp find-system.lisp find-component.lisp operation.lisp action.lisp lisp-action.lisp plan.lisp operate.lisp output-translations.lisp source-registry.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp package-inferred-system.lisp backward-internals.lisp backward-interface.lisp interface.lisp user.lisp footer.lisp
driver_lisp := uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/lisp-build.lisp uiop/run-program.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp
defsystem_lisp := upgrade.lisp cache.lisp component.lisp system.lisp find-system.lisp find-component.lisp operation.lisp action.lisp lisp-action.lisp plan.lisp operate.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp output-translations.lisp source-registry.lisp package-inferred-system.lisp backward-interface.lisp backward-internals.lisp interface.lisp user.lisp footer.lisp
all_lisp := $(header_lisp) $(driver_lisp) $(defsystem_lisp)

print-%  : ; @echo $* = $($*)
+7 −8
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ Use it in FORMAT control strings as ~/asdf-action:format-action/"

;;;; Dependencies
(with-upgradability ()
  (defgeneric* (component-depends-on) (operation component) ;; ASDF4: rename to component-dependencies
  (defgeneric component-depends-on (operation component) ;; ASDF4: rename to component-dependencies
    (:documentation
     "Returns a list of dependencies needed by the component to perform
    the operation.  A dependency has one of the following forms:
@@ -270,7 +270,7 @@ The class needs to be updated for ASDF 3.1 and specify appropriate propagation m

;;;; Inputs, Outputs, and invisible dependencies
(with-upgradability ()
  (defgeneric* (output-files) (operation component)
  (defgeneric output-files (operation component)
    (:documentation "Methods for this function return two values: a list of output files
corresponding to this action, and a boolean indicating if they have already been subjected
to relevant output translations and should not be further translated.
@@ -278,13 +278,13 @@ to relevant output translations and should not be further translated.
Methods on PERFORM *must* call this function to determine where their outputs are to be located.
They may rely on the order of the files to discriminate between outputs.
"))
  (defgeneric* (input-files) (operation component)
  (defgeneric input-files (operation component)
    (:documentation "A list of input files corresponding to this action.

Methods on PERFORM *must* call this function to determine where their inputs are located.
They may rely on the order of the files to discriminate between inputs.
"))
  (defgeneric* (operation-done-p) (operation component)
  (defgeneric operation-done-p (operation component)
    (:documentation "Returns a boolean which is NIL if the action must be performed (again)."))
  (define-convenience-action-methods output-files (operation component))
  (define-convenience-action-methods input-files (operation component))
@@ -294,8 +294,7 @@ They may rely on the order of the files to discriminate between inputs.
    t)

  ;; Translate output files, unless asked not to. Memoize the result.
  (defmethod output-files :around (operation component)
    operation component ;; hush genera, not convinced by declare ignorable(!)
  (defmethod output-files :around ((operation t) (component t))
    (do-asdf-cache `(output-files ,operation ,component)
      (values
       (multiple-value-bind (pathnames fixedp) (call-next-method)
@@ -397,7 +396,7 @@ in some previous image, or T if it needs to be done.")

;;;; Perform
(with-upgradability ()
  (defgeneric* (perform) (operation component)
  (defgeneric perform (operation component)
    (:documentation "PERFORM an action, consuming its input-files and building its output-files"))
  (define-convenience-action-methods perform (operation component))

@@ -418,7 +417,7 @@ in some previous image, or T if it needs to be done.")
  ;; The restarts of the perform-with-restarts variant matter in an interactive context.
  ;; The retry strategies of p-w-r itself, and/or the background workers of a multiprocess build
  ;; may call perform directly rather than call p-w-r.
  (defgeneric* (perform-with-restarts) (operation component)
  (defgeneric perform-with-restarts (operation component)
    (:documentation "PERFORM an action in a context where suitable restarts are in place."))
  (defmethod perform-with-restarts (operation component)
    (perform operation component))
+4 −4
Original line number Diff line number Diff line
@@ -44,9 +44,9 @@
  :encoding :utf-8
  :components
  ((:file "upgrade")
   (:file "cache" :depends-on ("upgrade"))
   (:file "component" :depends-on ("upgrade"))
   (:file "system" :depends-on ("component"))
   (:file "cache" :depends-on ("upgrade"))
   (:file "find-system" :depends-on ("system" "cache"))
   (:file "find-component" :depends-on ("find-system"))
   (:file "operation" :depends-on ("find-system"))
@@ -54,14 +54,14 @@
   (:file "lisp-action" :depends-on ("action"))
   (:file "plan" :depends-on ("lisp-action"))
   (:file "operate" :depends-on ("plan"))
   (:file "output-translations" :depends-on ("operate"))
   (:file "source-registry" :depends-on ("find-system"))
   (:file "parse-defsystem" :depends-on ("cache" "system" "lisp-action" "operate"))
   (:file "bundle" :depends-on ("lisp-action" "operate" "parse-defsystem"))
   (:file "concatenate-source" :depends-on ("plan" "parse-defsystem" "bundle"))
   (:file "output-translations" :depends-on ("operate"))
   (:file "source-registry" :depends-on ("find-system"))
   (:file "package-inferred-system" :depends-on ("system" "find-system" "parse-defsystem"))
   (:file "backward-internals" :depends-on ("find-system" "parse-defsystem"))
   (:file "backward-interface" :depends-on ("operate" "output-translations"))
   (:file "backward-internals" :depends-on ("find-system" "parse-defsystem"))
   (:file "interface" :depends-on
          ("parse-defsystem" "concatenate-source"
           "output-translations" "source-registry" "package-inferred-system"
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ if that's whay you mean." ;;)

  ;; TRAVERSE is the function used to compute a plan in ASDF 1 and 2.
  ;; It was never officially exposed but some people still used it.
  (defgeneric* (traverse) (operation component &key &allow-other-keys)
  (defgeneric traverse (operation component &key &allow-other-keys)
    (:documentation
     "Generate and return a plan for performing OPERATION on COMPONENT.

@@ -189,7 +189,7 @@ Please use UIOP:RUN-PROGRAM instead."

;;; This method survives from ASDF 1, but really it is superseded by action-description.
(with-upgradability ()
  (defgeneric* (explain) (operation component)
  (defgeneric explain (operation component)
    (:documentation "Display a message describing an action.
DEPRECATED. Use ASDF:ACTION-DESCRIPTION and/or ASDF::FORMAT-ACTION instead."))
  (defmethod explain ((o operation) (c component))
+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ or of opaque libraries shipped along the source code."))
             :force :force-not :plan-class) ;; TODO: refactor so we don't mix plan and operation arguments
           (operation-original-initargs instance))))

  (defgeneric* (trivial-system-p) (component))
  (defgeneric trivial-system-p (component))

  (defun user-system-p (s)
    (and (typep s 'system)
Loading