Commit b8f0d69d authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

1.721: integrate feedback from rtoym, p_l.

* for configuration directories, only match files in .conf
 that are not unix hidden files. This notably takes care of backups.
 (Solves issue found by p_l.)

* Before calling the provide hook, CMUCL normalizes its argument to a string
 (as allowed per CLHS), which means symbols become uppercase strings
 before they reach ASDF that would downcase symbols. I've decided to always
 downcase the argument provided to this hook. (Solves issue raised by rtoym.)
 Note that are hook itself doesn't (PROVIDE ...) anything
 to be pushed onto *MODULES*. Maybe we should:
 (a) only try find-system when (equal (string arg) (string-upcase arg))
 (b) always string-downcase when calling find-system and
 (c) string-upcase again and provide.
 Not done in this commit, though.

* Add #+cmu (:tree #p"modules:") to the wrapping-source-registry. (rtoym)
parent 8b6734db
...@@ -7,10 +7,10 @@ clnet_home := "/project/asdf/public_html/" ...@@ -7,10 +7,10 @@ clnet_home := "/project/asdf/public_html/"
sourceDirectory := $(shell pwd) sourceDirectory := $(shell pwd)
lisps ?= allegro ccl clisp ecl lispworks sbcl lisps ?= allegro ccl clisp ecl sbcl
## untested by me: abcl allegromodern cmucl ## not tested by me: abcl allegromodern cmucl lisworks
## FAIL: gclcvs ## FAIL: gclcvs
## maybe supported by asdf, never supported by our tests: cormancl mcl scl ## maybe supported by asdf, not supported yet by our tests: cormancl mcl scl
lisp ?= sbcl lisp ?= sbcl
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
:test 'equalp :key 'car)) :test 'equalp :key 'car))
(let* ((asdf-version (let* ((asdf-version
;; the 1+ helps the version bumping script discriminate ;; the 1+ helps the version bumping script discriminate
(subseq "VERSION:1.720" (1+ (length "VERSION")))) (subseq "VERSION:1.721" (1+ (length "VERSION"))))
(existing-asdf (find-package :asdf)) (existing-asdf (find-package :asdf))
(vername '#:*asdf-version*) (vername '#:*asdf-version*)
(versym (and existing-asdf (versym (and existing-asdf
...@@ -593,7 +593,7 @@ pathnames." ...@@ -593,7 +593,7 @@ pathnames."
(last-comp (car (last components)))) (last-comp (car (last components))))
(multiple-value-bind (relative components) (multiple-value-bind (relative components)
(if (equal (first components) "") (if (equal (first components) "")
(if (and (plusp (length s)) (eql (char s 0) #\/)) (if (equal (first-char s) #\/)
(values :absolute (cdr components)) (values :absolute (cdr components))
(values :relative nil)) (values :relative nil))
(values :relative components)) (values :relative components))
...@@ -2446,10 +2446,15 @@ located." ...@@ -2446,10 +2446,15 @@ located."
(error "One and only one form allowed for ~A. Got: ~S~%" description forms)) (error "One and only one form allowed for ~A. Got: ~S~%" description forms))
(funcall validator (car forms)))) (funcall validator (car forms))))
(defun hidden-file-p (pathname)
(equal (first-char (pathname-name pathname)) #\.))
(defun validate-configuration-directory (directory tag validator) (defun validate-configuration-directory (directory tag validator)
(let ((files (sort (ignore-errors (let ((files (sort (ignore-errors
(directory (make-pathname :name :wild :type :wild :defaults directory) (remove-if
#+sbcl :resolve-symlinks #+sbcl nil)) 'hidden-file-p
(directory (make-pathname :name :wild :type "conf" :defaults directory)
#+sbcl :resolve-symlinks #+sbcl nil)))
#'string< :key #'namestring))) #'string< :key #'namestring)))
`(,tag `(,tag
,@(loop :for file :in files :append ,@(loop :for file :in files :append
...@@ -2827,6 +2832,9 @@ effectively disabling the output translation facility." ...@@ -2827,6 +2832,9 @@ effectively disabling the output translation facility."
(translate-pathname p absolute-source destination))) (translate-pathname p absolute-source destination)))
:finally (return p))))) :finally (return p)))))
(defun first-char (s)
(and (stringp s) (plusp (length s)) (char s 0)))
(defun last-char (s) (defun last-char (s)
(and (stringp s) (plusp (length s)) (char s (1- (length s))))) (and (stringp s) (plusp (length s)) (char s (1- (length s)))))
...@@ -3139,6 +3147,7 @@ with a different configuration, so the configuration would be re-read then." ...@@ -3139,6 +3147,7 @@ with a different configuration, so the configuration would be re-read then."
(defun wrapping-source-registry () (defun wrapping-source-registry ()
`(:source-registry `(:source-registry
#+cmu (:tree #p"modules:")
#+sbcl (:tree ,(getenv "SBCL_HOME")) #+sbcl (:tree ,(getenv "SBCL_HOME"))
:inherit-configuration)) :inherit-configuration))
(defun default-source-registry () (defun default-source-registry ()
...@@ -3272,12 +3281,12 @@ with a different configuration, so the configuration would be re-read then." ...@@ -3272,12 +3281,12 @@ with a different configuration, so the configuration would be re-read then."
((style-warning #'muffle-warning) ((style-warning #'muffle-warning)
(missing-component (constantly nil)) (missing-component (constantly nil))
(error (lambda (e) (error (lambda (e)
(format *error-output* "ASDF could not load ~A because ~A.~%" (format *error-output* "ASDF could not load ~(~A~) because ~A.~%"
name e)))) name e))))
(let* ((*verbose-out* (make-broadcast-stream)) (let* ((*verbose-out* (make-broadcast-stream))
(system (find-system name nil))) (system (find-system (string-downcase name) nil)))
(when system (when system
(load-system name) (load-system system)
t)))) t))))
(pushnew 'module-provide-asdf (pushnew 'module-provide-asdf
#+abcl sys::*module-provider-functions* #+abcl sys::*module-provider-functions*
......
...@@ -343,7 +343,7 @@ The simplest way to add a path to your search path, ...@@ -343,7 +343,7 @@ The simplest way to add a path to your search path,
say @file{/foo/bar/baz/quux/} say @file{/foo/bar/baz/quux/}
is to create the directory is to create the directory
@file{~/.config/common-lisp/source-registry.conf.d/} @file{~/.config/common-lisp/source-registry.conf.d/}
and there create a file with any name of your choice, and there create a file with any name of your choice but the type @file{conf},
for instance @file{42-bazquux.conf} for instance @file{42-bazquux.conf}
containing the line: containing the line:
...@@ -357,10 +357,11 @@ to be recursively scanned for @file{.asd} files, instead use: ...@@ -357,10 +357,11 @@ to be recursively scanned for @file{.asd} files, instead use:
Note that your Operating System distribution or your system administrator Note that your Operating System distribution or your system administrator
may already have configured system-managed libraries for you. may already have configured system-managed libraries for you.
Also note that when choosing a filename, the convention is to use The required @file{.conf} extension allows you to have disabled files
the @file{.conf} extension or editor backups (ending in @file{~}), and works portably
(and a non-empty extension is required for CLISP compatibility), (for instance, it is a pain to allow both empty and non-empty extension on CLISP).
and it is customary to start the filename with two digits Excluded are files the name of which start with a @file{.} character.
It is customary to start the filename with two digits
that specify the order in which the directories will be scanned. that specify the order in which the directories will be scanned.
ASDF will automatically read your configuration ASDF will automatically read your configuration
...@@ -485,7 +486,7 @@ say from @file{/foo/bar/baz/quux/} ...@@ -485,7 +486,7 @@ say from @file{/foo/bar/baz/quux/}
to @file{/where/i/want/my/fasls/} to @file{/where/i/want/my/fasls/}
is to create the directory is to create the directory
@file{~/.config/common-lisp/asdf-output-translations.conf.d/} @file{~/.config/common-lisp/asdf-output-translations.conf.d/}
and there create a file with any name of your choice, and there create a file with any name of your choice and the type @file{conf},
for instance @file{42-bazquux.conf} for instance @file{42-bazquux.conf}
containing the line: containing the line:
...@@ -510,11 +511,11 @@ In absence of any configuration, the default is to redirect everything ...@@ -510,11 +511,11 @@ In absence of any configuration, the default is to redirect everything
under an implementation-dependent subdirectory of @file{~/.cache/common-lisp/}. under an implementation-dependent subdirectory of @file{~/.cache/common-lisp/}.
@xref{Controlling where ASDF searches for systems}, for full details. @xref{Controlling where ASDF searches for systems}, for full details.
The required @file{.conf} extension allows you to have disabled files
Also note that when choosing a filename, the convention is to use or editor backups (ending in @file{~}), and works portably
the @file{.conf} extension (for instance, it is a pain to allow both empty and non-empty extension on CLISP).
(and a non-empty extension is required for CLISP compatibility), Excluded are files the name of which start with a @file{.} character.
and it is customary to start the filename with two digits It is customary to start the filename with two digits
that specify the order in which the directories will be scanned. that specify the order in which the directories will be scanned.
ASDF will automatically read your configuration ASDF will automatically read your configuration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment