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/a2dfe20ddefc60bb9e55a4c...