Commit d33ab0bc authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Eagerly register preloaded systems

Change clear-system accordingly, and simplify how we handle immutable systems.
Add or improve documentation for several of the functions involved.

Also stop advertising asdf::*immutable-systems*;
instead promote asdf:register-immutable-system.

This is a preliminary to fixing component-loaded-p for preloaded systems.
parent 7b7b9f0c
This diff is collapsed.
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
(in-package :asdf/footer) (in-package :asdf/footer)
;;;; Register ASDF itself and all its subsystems as preloaded.
(with-upgradability ()
(dolist (s '("asdf" "uiop" "asdf-defsystem" "asdf-package-system"))
;; Don't bother with these system names, no one relies on them anymore:
;; "asdf-utils" "asdf-bundle" "asdf-driver"
(register-preloaded-system s :version *asdf-version*)))
;;;; Hook ASDF into the implementation's REQUIRE and other entry points. ;;;; Hook ASDF into the implementation's REQUIRE and other entry points.
#+(or abcl clasp clisp clozure cmucl ecl mkcl sbcl) #+(or abcl clasp clisp clozure cmucl ecl mkcl sbcl)
(with-upgradability () (with-upgradability ()
......
...@@ -251,6 +251,16 @@ the implementation's REQUIRE rather than by internal ASDF mechanisms.")) ...@@ -251,6 +251,16 @@ the implementation's REQUIRE rather than by internal ASDF mechanisms."))
:when (eq (first k) 'find-system) :collect (second k)))) :when (eq (first k) 'find-system) :collect (second k))))
(clrhash *asdf-cache*) (clrhash *asdf-cache*)
(dolist (s l) (find-system s nil))))) (dolist (s l) (find-system s nil)))))
(register-hook-function '*post-upgrade-restart-hook* 'restart-upgraded-asdf)) (register-hook-function '*post-upgrade-restart-hook* 'restart-upgraded-asdf)
;; The following function's symbol is from asdf/find-system.
;; It is defined here to resolve what would otherwise be forward package references.
(defun mark-component-preloaded (component)
"Mark a component as preloaded."
;; Recurse to children, so asdf/plan will hopefully be happy.
(map () 'mark-component-preloaded (component-children component))
;; Mark the timestamps of the common lisp-action operations as 0.
(let ((times (component-operation-times component)))
(dolist (o '(load-op compile-op prepare-op))
(setf (gethash o times) 0)))))
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:asdf/cache :asdf/find-system :asdf/find-component :asdf/cache :asdf/find-system :asdf/find-component
:asdf/operation :asdf/action :asdf/lisp-action) :asdf/operation :asdf/action :asdf/lisp-action)
(:export (:export
#:component-operation-time #:mark-operation-done #:component-operation-time
#:plan #:plan-traversal #:sequential-plan #:*default-plan-class* #:plan #:plan-traversal #:sequential-plan #:*default-plan-class*
#:planned-action-status #:plan-action-status #:action-already-done-p #:planned-action-status #:plan-action-status #:action-already-done-p
#:circular-dependency #:circular-dependency-actions #:circular-dependency #:circular-dependency-actions
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
(DBG "Now let's register it as preloaded. Loading it will work!") (DBG "Now let's register it as preloaded. Loading it will work!")
(register-preloaded-system :this-system-does-not-exist :version "3.14") (register-preloaded-system :this-system-does-not-exist :version "3.14")
(assert (null (system-registered-p :this-system-does-not-exist))) ;; not yet registered as loaded ;; Eagerly registered since 3.1.7.20. See gitlab merge request 13 for the full story.
(load-system :this-system-does-not-exist) ;; but now we can load it (assert (system-registered-p :this-system-does-not-exist))
(assert (system-registered-p :this-system-does-not-exist)) ;; and it is loaded indeed! (load-system :this-system-does-not-exist) ;; We can load it indeed, though it's a NOP.
(DBG "Now let's load a simple system. It should create a package.") (DBG "Now let's load a simple system. It should create a package.")
......
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