0.8.13.41: Require robustness
authorNikodemus Siivola <nikodemus@random-state.net>
Sun, 8 Aug 2004 12:32:04 +0000 (12:32 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 8 Aug 2004 12:32:04 +0000 (12:32 +0000)
            * 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
NEWS
contrib/asdf-module.mk
contrib/asdf-stub.lisp [new file with mode: 0644]
version.lisp-expr

diff --git a/INSTALL b/INSTALL
index ae0f152..f5d7e71 100644 (file)
--- 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 (file)
--- 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.
index 8087ab9..155988a 100644 (file)
@@ -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 (file)
index 0000000..4864c69
--- /dev/null
@@ -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*)
index 5742cef..1a12e2c 100644 (file)
@@ -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"