From 627ff527e9062eb2ad4c94b6f674bae087217f6e Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 27 May 2021 01:14:17 +0100 Subject: [PATCH] dump-ecl: Defeat ASDF's magic internal knowledge of itself. When you load ASDF, it comes with built-in knowledge of itself as a system, but without details of any source files (or, indeed, any information about how to do anything with it). When you try to find the `asdf' system, it does check the filesystem, but does a quick check of the reported version number against its current version number and skips loading the full system definition if it's already up-to-date. This would all be fine in a resident system, because once the system is loaded, we don't really care much. But ECL isn't a resident system: it compiles to external files, and this poses a problem. If the initially loaded ASDF matches the one in the system registry, then we don't have any source filename details, and `lib-op' does nothing. Defeat this by locating and loading the system-definition by hand and stuffing it into ASDF's internal structures before we try to do stuff. This is, of course, completely terrible. --- dump-ecl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dump-ecl b/dump-ecl index 4ec27b4..e777e50 100755 --- a/dump-ecl +++ b/dump-ecl @@ -33,6 +33,30 @@ run () { echo "$*"; "$@"; } cat >"$tmp/ecl-build.lisp" <<'EOF' (require "asdf") +;; Defeat ASDF's built-in knowledge of itself. If we've just loaded the most +;; up-to-date version of ASDF then it won't bother loading the system +;; definition from disk which knows about the actual source files. And if it +;; doesn't think it has any source files then it won't compile anything. +(asdf:load-asd + (funcall (let* ((cache-pkg (find-package "ASDF/CACHE")) + (with-cache (and cache-pkg + )) + (session-pkg (find-package "ASDF/SESSION")) + (with-session (and session-pkg + (find-symbol + "CALL-WITH-ASDF-SESSION")))) + (symbol-function + (cond (cache-pkg + (find-symbol "CALL-WITH-ASDF-CACHE" cache-pkg)) + (session-pkg + (find-symbol "CALL-WITH-ASDF-SESSION" session-pkg)) + (t + (error "I don't know how to hack this version of ASDF: ~ + please report this as a bug."))))) + (lambda () + (asdf:search-for-system-definition "asdf"))) + :name "asdf") + (defparameter *asdf* (asdf:find-system "asdf") "The `asdf' system itself.") -- 2.11.0