Commit 815a1833 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Fix upgrade issues on ABCL and ECL

Fix upgrade on ABCL, that failed to properly process the fact that initialize-source-registry had moved from asdf/find-system to asdf/source-registry, yet was called in a cleanup function. Fix upgrade on ECL, that failed to correctly process that find-component was fmakunbound. It also seems to clear *central-registry* in some upgrade scenarios (that also moved from find-system to system-registry). Tweak script-support to not unconditionally frob-packages when ASDF isn't loaded yet, and to not include the asdf directory when loading and testing only UIOP.
parent 41f397c9
......@@ -7,6 +7,7 @@
:asdf/session :asdf/component :asdf/system :asdf/operation :asdf/action :asdf/lisp-action
:asdf/find-component :asdf/system-registry :asdf/plan :asdf/operate)
(:import-from #:asdf/component #:%additional-input-files)
#+abcl (:intern #:initialize-source-registry) ;; to upgrade from 3.1.x
(:export
#:find-system #:locate-system #:load-asd #:define-op
#:load-system-definition-error #:error-name #:error-pathname #:error-condition))
......
......@@ -5,6 +5,7 @@
(uiop/package:define-package :asdf/source-registry
(:recycle :asdf/source-registry :asdf)
(:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/system :asdf/system-registry)
#+abcl (:import-from :asdf/find-system #:initialize-source-registry) ;; to upgrade from 3.1.x
(:export
#:*source-registry-parameter* #:*default-source-registries*
#:invalid-source-registry
......
......@@ -449,7 +449,7 @@ is bound, write a message and exit on an error. If
(quietly (load (asdf-fasl tag))))
(defun register-directory (dir)
(pushnew dir (symbol-value (asym :*central-registry*))))
(pushnew dir (symbol-value (asym :*central-registry*)) :test #'equal))
(defun load-asdf-system (&rest keys)
(quietly
......@@ -659,10 +659,14 @@ is bound, write a message and exit on an error. If
t)
(defun frob-packages ()
(format t "Frob packages~%")
(use-package :asdf :asdf-test)
(when (find-package :uiop) (use-package :uiop :asdf-test))
(when (find-package :asdf/session) (use-package :asdf/session :asdf-test))
(cond
((find-package :asdf)
(format t "Frob packages~%")
(use-package :asdf :asdf-test)
(when (find-package :uiop) (use-package :uiop :asdf-test))
(when (find-package :asdf/session) (use-package :asdf/session :asdf-test)))
(t
(format t "NB: No packages to frob, because ASDF not loaded yet.")))
(setf *package* (find-package :asdf-test))
t)
......@@ -673,12 +677,17 @@ is bound, write a message and exit on an error. If
(and (member :asdf2 *features*) (acall :version-satisfies (acall :asdf-version) "2.11.4"))))
(leave-test "UIOP will break ASDF < 2.011.4 - skipping test." 0))
(configure-asdf)
(register-directory *asdf-directory*)
;; do NOT include *asdf-directory*, which would defeat the purpose by causing an upgrade
(register-directory *uiop-directory*)
(register-directory *test-directory*)
(format t "CR ~S~%" (symbol-value (asym :*central-registry*)))
(format t "loading uiop~%")
(quietly
(acall :oos (asym :load-op) :uiop))
(acall :oos (asym :load-op) :test-module-depend))
(format t "CR ~S~%" (symbol-value (asym :*central-registry*)))
(format t "loading test-module-depend~%")
(acall :oos (asym :load-op) :test-module-depend)
(format t "done loading~%"))
(defun load-asdf (&optional tag)
(load-asdf-fasl tag)
......
......@@ -106,32 +106,32 @@ previously-loaded version of ASDF."
;;; Upon upgrade, specially frob some functions and classes that are being incompatibly redefined
(when-upgrading ()
(let ((redefined-functions ;; List of functions that changes incompatibly since 2.27:
;; gf signature changed (should NOT happen), defun that became a generic function,
;; method removed that will mess up with new ones (especially :around :before :after,
;; more specific or call-next-method'ed method) and/or semantics otherwise modified. Oops.
;; NB: it's too late to do anything about functions in UIOP!
;; If you introduce some critical incompatibility there, you must change the function name.
;; Note that we don't need do anything about functions that changed incompatibly
;; from ASDF 2.26 or earlier: we wholly punt on the entire ASDF package in such an upgrade.
;; Also note that we don't include the defgeneric=>defun, because they are
;; done directly with defun* and need not trigger a punt on data.
;; See discussion at https://gitlab.common-lisp.net/asdf/asdf/merge_requests/36
'(#:component-depends-on #:input-files ;; methods removed before 3.1.2
#:find-component ;; gf modified in 3.1.7.20
))
(redefined-classes
;; redefining the classes causes interim circularities
;; with the old ASDF during upgrade, and many implementations bork
#-clozure ()
#+clozure
'((#:compile-concatenated-source-op (#:operation) ())
(#:compile-bundle-op (#:operation) ())
(#:concatenate-source-op (#:operation) ())
(#:dll-op (#:operation) ())
(#:lib-op (#:operation) ())
(#:monolithic-compile-bundle-op (#:operation) ())
(#:monolithic-concatenate-source-op (#:operation) ()))))
(let* ((previous-version (first *previous-asdf-versions*))
(redefined-functions ;; List of functions that changes incompatibly since 2.27:
;; gf signature changed (should NOT happen), defun that became a generic function,
;; method removed that will mess up with new ones (especially :around :before :after,
;; more specific or call-next-method'ed method) and/or semantics otherwise modified. Oops.
;; NB: it's too late to do anything about functions in UIOP!
;; If you introduce some critical incompatibility there, you must change the function name.
;; Note that we don't need do anything about functions that changed incompatibly
;; from ASDF 2.26 or earlier: we wholly punt on the entire ASDF package in such an upgrade.
;; Also note that we don't include the defgeneric=>defun, because they are
;; done directly with defun* and need not trigger a punt on data.
;; See discussion at https://gitlab.common-lisp.net/asdf/asdf/merge_requests/36
`(,@(when (version<= previous-version "3.1.2") '(#:component-depends-on #:input-files)) ;; crucial methods *removed* before 3.1.2
,@(when (version<= previous-version "3.1.7.20") '(#:find-component))))
(redefined-classes
;; redefining the classes causes interim circularities
;; with the old ASDF during upgrade, and many implementations bork
#-clozure ()
#+clozure
'((#:compile-concatenated-source-op (#:operation) ())
(#:compile-bundle-op (#:operation) ())
(#:concatenate-source-op (#:operation) ())
(#:dll-op (#:operation) ())
(#:lib-op (#:operation) ())
(#:monolithic-compile-bundle-op (#:operation) ())
(#:monolithic-concatenate-source-op (#:operation) ()))))
(loop :for name :in redefined-functions
:for sym = (find-symbol* name :asdf nil)
:do (when sym (fmakunbound sym)))
......
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