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

2.016.3: better upgrade procedure that uses fmakunbound instead of unintern,

yet avoids problems with packages and functions being destroyed by compile-file,
not yet restored by load, and yet needed by the continuation of compile-file,
by forcing a load-source-op of asdf.lisp before it is compiled, when it is compiled.
Thanks to Nikodemus for making me look deeper in fmakunbound vs unintern issues.
parent 86b7de25
......@@ -7,13 +7,29 @@
;;; ;;;
(asdf:defsystem :asdf
(in-package :asdf)
(defsystem :asdf
:author ("Daniel Barlow")
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.016.2" ;; to be automatically updated by bin/bump-revision
:version "2.016.3" ;; to be automatically updated by bin/bump-revision
:depends-on ()
((:file "asdf")
#+ecl (:file "asdf-ecl" :depends-on ("asdf"))))
;; The method below ensures that before we compile asdf, we load it as source.
;; This ensures that when we compile asdf, it won't remove symbols and packages
;; in the back of the compiling asdf, which then finds itself incapable of
;; perform'ing the load-op'ing of the newly compiled asdf fasl because
;; perform has been undefined during the initial package-frobbing eval-when code,
;; but not redefined yet by loading the code rather than merely compiling it.
;; We could use (:file "asdf" :do-first ((compile-op (load-source-op "asdf"))))
;; but it's only supported since ASDF 2.016.3. What's below should be more compatible.
;; We can't use find-component, because it's not compatible with old versions of ASDF 1.x
(defmethod perform :before ((operation compile-op)
(c (eql (first (module-components (find-system :asdf))))))
(perform (make-instance 'load-source-op) c))
;;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
;;; This is ASDF 2.016.2: Another System Definition Facility.
;;; This is ASDF 2.016.3: Another System Definition Facility.
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <>.
......@@ -112,7 +112,7 @@
;; "2.345.6" would be a development version in the official upstream
;; "2.345.0.7" would be your seventh local modification of official release 2.345
;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
(asdf-version "2.016.2")
(asdf-version "2.016.3")
(existing-asdf (find-class 'component nil))
(existing-version *asdf-version*)
(already-there (equal asdf-version existing-version)))
......@@ -200,12 +200,13 @@
:do (unintern old user)))
(loop :for x :in newly-exported-symbols :do
(export (intern* x package)))))
(ensure-package (name &key nicknames use unintern fmakunbound shadow export)
(ensure-package (name &key nicknames use unintern fmakunbound
shadow export redefined-functions)
(let* ((p (ensure-exists name nicknames use)))
(ensure-unintern p unintern)
(ensure-shadow p shadow)
(ensure-export p export)
(ensure-fmakunbound p fmakunbound)
(ensure-fmakunbound p (append fmakunbound redefined-functions))
((pkgdcl (name &key nicknames use export
......@@ -213,8 +214,9 @@
',name :nicknames ',nicknames :use ',use :export ',export
:shadow ',shadow
:unintern ',(append #-(or gcl ecl) redefined-functions unintern)
:fmakunbound ',(append fmakunbound))))
:unintern ',unintern
:redefined-functions ',redefined-functions
:fmakunbound ',fmakunbound)))
:nicknames (:asdf-utilities) ;; DEPRECATED! Do not use, for backward compatibility only.
......@@ -571,7 +573,6 @@ and NIL NAME, TYPE and VERSION components"
'(:relative :back) (pathname-directory pathname))
:defaults pathname)))
(define-modify-macro appendf (&rest args)
append "Append onto list") ;; only to be used on short lists.
......@@ -2359,7 +2360,7 @@ recursive calls to traverse.")
(asdf-message (compatfmt "~&~@<; ~@;Changed ASDF from version ~A to incompatible version ~A~@:>~%")
version new-version)))
(let ((asdf (find-system :asdf)))
(let ((asdf (funcall (find-symbol* 'find-system :asdf) :asdf)))
;; invalidate all systems but ASDF itself
(setf *defined-systems* (make-defined-systems-table))
(register-system asdf)
......@@ -2595,7 +2596,7 @@ Returns the new tree (which probably shares structure with the old one)"
components pathname default-component-class
perform explain output-files operation-done-p
depends-on serial in-order-to
depends-on serial in-order-to do-first
(version nil versionp)
;; list ends
&allow-other-keys) options
......@@ -2656,7 +2657,10 @@ Returns the new tree (which probably shares structure with the old one)"
`((compile-op (compile-op ,@depends-on))
(load-op (load-op ,@depends-on)))))
(setf (component-do-first ret) `((compile-op (load-op ,@depends-on))))
(setf (component-do-first ret)
`((compile-op (load-op ,@depends-on)))))
(%refresh-component-inline-methods ret rest)
......@@ -2803,9 +2807,7 @@ if that's whay you mean." ;;)
"Return a pathname object corresponding to the
directory in which the system specification (.asd file) is
(make-pathname :name nil
:type nil
:defaults (system-source-file system-designator)))
(pathname-directory-pathname (system-source-file system-designator)))
(defun* relativize-directory (directory)
......@@ -4,7 +4,7 @@
# e.g. 3.45.6 ==> 3.45.7, or 3.56 ==> 3.56.1
ASDFDIR="$(readlink -f $(dirname $PROG)/..)"
ASDFDIR="$(cd $(dirname $PROG)/.. ; /bin/pwd)" ## readlink -f doesn't work on BSD
Supports Markdown
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