From 80f222325e1f677e5cf8de01c6990906fa47f65d Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 8 Aug 2004 12:32:04 +0000 Subject: [PATCH] 0.8.13.41: Require robustness * Generate smarter loader-stubs for ASDF-modules, so that they can be REQUIRE'd even if ASDF:*CENTRAL-REGISTRY* is cleared by the user. * Correct INSTALL documentation: --core doesn't override SBCL_HOME if SBCL_HOME exists. --- INSTALL | 10 ++++++---- NEWS | 4 ++++ contrib/asdf-module.mk | 7 +------ contrib/asdf-stub.lisp | 26 ++++++++++++++++++++++++++ version.lisp-expr | 2 +- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 contrib/asdf-stub.lisp diff --git a/INSTALL b/INSTALL index ae0f152..f5d7e71 100644 --- a/INSTALL +++ b/INSTALL @@ -39,7 +39,7 @@ INSTALLING SBCL The SBCL runtime needs to be able to find the ancillary files associated with it: the "sbcl.core" file, and the contrib modules. - This can happen in three ways: + Finding core can happen in three ways: 1. By default, in a location configured when the system was built. For binary distributions this is in "/usr/local/lib/sbcl". @@ -57,15 +57,17 @@ INSTALLING SBCL $ sbcl --core /foo/bar/sbcl.core - When using this option contrib modules are looked for in the - directory where the designated core resides, and in "SBCL_HOME". - The usual, recommended approach is method #1. Method #2 is useful if you're installing SBCL on a system in a non-standard location (e.g. in your user account), instead of installing SBCL on an entire system. Method #3 is mostly useful for testing or other special cases. + Contributed modules are primarily looked for in "SBCL_HOME", or the + directory the core resides in if "SBCL_HOME" is not set. + ASDF:*CENTRAL-REGISTRY* serves as an additional fallback for + ASDF-based modules. + 1.3. Anatomy of SBCL The two files that SBCL needs to run, at minimum, are: diff --git a/NEWS b/NEWS index b4f79ae..2ac5f55 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,10 @@ changes in sbcl-0.8.14 relative to sbcl-0.8.13: work for CMUCL) * documentation: networking interface SB-BSD-SOCKETS' documentation has been integrated into the user manual. + * bug fix: SBCL can now load its contributed modules with REQUIRE + even if the system-provided entries have been removed from + ASDF:*CENTRAL-REGISTRY*. Infinite recursion in REQUIRE is also + detected. * bug fix: backtraces involving undefined functions or assembly routines are more informative. (thanks to Brian Downing) * bug fix: mutually referent alien structures now work correctly. diff --git a/contrib/asdf-module.mk b/contrib/asdf-module.mk index 8087ab9..155988a 100644 --- a/contrib/asdf-module.mk +++ b/contrib/asdf-module.mk @@ -17,12 +17,7 @@ export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS all: $(EXTRA_ALL_TARGETS) $(MAKE) -C ../asdf - $(SBCL) --eval '(load "../asdf/asdf")' \ - --eval "(setf asdf::*central-registry* '((MERGE-PATHNAMES \"systems/\" (TRUENAME (SB-EXT:POSIX-GETENV \"SBCL_HOME\")))))" \ - --eval "(push :sb-building-contrib *features*)" \ - --eval "(asdf:operate 'asdf:load-op :$(SYSTEM))" \ - --eval "(progn (when (probe-file \"$(SYSTEM).fasl\") (error \"fasl file exists\")) (with-open-file (s \"$(SYSTEM).lisp\" :direction :output :if-exists :error) (print (quote (require :asdf)) s) (print (quote (require :$(SYSTEM))) s)) (compile-file \"$(SYSTEM).lisp\") (delete-file \"$(SYSTEM).lisp\"))" \ - --eval "(quit)" + $(SBCL) --eval '(defvar *system* "$(SYSTEM)")' --load ../asdf-stub.lisp --eval '(quit)' test: all echo "(asdf:operate (quote asdf:load-op) :$(SYSTEM))" \ diff --git a/contrib/asdf-stub.lisp b/contrib/asdf-stub.lisp new file mode 100644 index 0000000..4864c69 --- /dev/null +++ b/contrib/asdf-stub.lisp @@ -0,0 +1,26 @@ +(load "../asdf/asdf") + +(setf asdf::*central-registry* + '((merge-pathnames "systems/" (truename (sb-ext:posix-getenv "SBCL_HOME"))))) +(push :sb-building-contrib *features*) +(asdf:operate 'asdf:load-op *system*) + +(defvar *system-stub* (make-pathname :name *system* :type "lisp")) + +(when (probe-file (compile-file-pathname *system-stub*)) + (error "fasl file exists")) + +(with-open-file (s *system-stub* :direction :output :if-exists :error) + (print '(unless (member "ASDF" *modules* :test #'string=) + (load (merge-pathnames "asdf/asdf.fasl" (truename (sb-ext:posix-getenv "SBCL_HOME"))))) + s) + ;; This addition to *central-registry* allows us to find contribs + ;; even if the user has frobbed the original contents. + (print `(let ((asdf:*central-registry* (cons (merge-pathnames "systems/" + (truename (sb-ext:posix-getenv "SBCL_HOME"))) + asdf:*central-registry*))) + (asdf::module-provide-asdf ,*system*)) + s)) + +(compile-file *system-stub*) +(delete-file *system-stub*) diff --git a/version.lisp-expr b/version.lisp-expr index 5742cef..1a12e2c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.13.40" +"0.8.13.41" -- 1.7.10.4