[Git][cmucl/cmucl][master] 2 commits: Fix #113: Search cmucl modules and libraries first

Raymond Toy (@rtoy) gitlab at common-lisp.net
Mon Sep 20 21:54:44 UTC 2021



Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
3824d74a by Raymond Toy at 2021-09-20T21:54:32+00:00
Fix #113:  Search cmucl modules and libraries first

- - - - -
a47dbed7 by Raymond Toy at 2021-09-20T21:54:33+00:00
Merge branch 'issue-113-prefer-cmucl-modules' into 'master'

Fix #113:  Search cmucl modules and libraries first

Closes #113

See merge request cmucl/cmucl!78
- - - - -


2 changed files:

- src/code/module.lisp
- src/i18n/locale/cmucl.pot


Changes:

=====================================
src/code/module.lisp
=====================================
@@ -37,8 +37,13 @@
 (defvar *require-verbose* t
   "*load-verbose* is bound to this before loading files.")
 
+(defvar *cmucl-provider-functions*
+  '(module-provide-cmucl-defmodule module-provide-cmucl-library)
+  "Provider functions for cmucl modules and libraries.  These are
+  searched first before trying *module-provider-functions*")
+
 (defvar *module-provider-functions*
-    '(module-provide-cmucl-defmodule module-provide-cmucl-library)
+  nil
   "See function documentation for REQUIRE")
 
 ;;;; Defmodule.
@@ -102,11 +107,6 @@
   \"contrib-games-feebs\", \"contrib-hist\", \"contrib-psgraph\",
   \"contrib-ops\", \"contrib-embedded-c\", \"contrib-sprof\", and
   \"contrib-packed-sse2\". "
-  ;; First, load asdf if it's not already loaded.  This is needed to
-  ;; load easily the contribs that use asdf.  There are no contribs
-  ;; that use defsystem, so we won't autoload defsystem.
-  (unless (featurep :asdf)
-    (load "modules:asdf/asdf"))
   (let ((saved-modules (copy-list *modules*))
         (module-name (module-name-string module-name)))
     (unless (member module-name *modules* :test #'string=)
@@ -114,9 +114,20 @@
         (if pathname
             (dolist (file (if (consp pathname) pathname (list pathname)) t)
 	      (load file))
-            (unless (some (lambda (p) (funcall p module-name))
-                          *module-provider-functions*)
-              (error (intl:gettext "Don't know how to load ~A") module-name)))))
+	    ;; Search *cmucl-provider-functions* first so that we'll
+	    ;; load our version of clx (and friends) before loading
+	    ;; any asdf version, if asdf is loaded.
+	    (or (some (lambda (p) (funcall p module-name))
+                      *cmucl-provider-functions*)
+		(progn
+		  ;; Load asdf if it's not already loaded.  This is needed to
+		  ;; load easily the contribs that use asdf.  There are no contribs
+		  ;; that use defsystem, so we won't autoload defsystem.
+		  (unless (featurep :asdf)
+		    (load "modules:asdf/asdf"))
+		  (some (lambda (p) (funcall p module-name))
+			*module-provider-functions*))
+		(error (intl:gettext "Don't know how to load ~A") module-name)))))
     (set-difference *modules* saved-modules)))
 
 ;;;; Default module providers


=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -10397,6 +10397,12 @@ msgstr ""
 msgid "*load-verbose* is bound to this before loading files."
 msgstr ""
 
+#: src/code/module.lisp
+msgid ""
+"Provider functions for cmucl modules and libraries.  These are\n"
+"  searched first before trying *module-provider-functions*"
+msgstr ""
+
 #: src/code/module.lisp
 msgid "See function documentation for REQUIRE"
 msgstr ""



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a2dfe20ddefc60bb9e55a4c15f6bee38e1aa8e3b...a47dbed7928a613539647b1f8055b1578b2b3fc4

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a2dfe20ddefc60bb9e55a4c15f6bee38e1aa8e3b...a47dbed7928a613539647b1f8055b1578b2b3fc4
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20210920/cd63a7d6/attachment-0001.html>


More information about the cmucl-cvs mailing list