diff --git a/asdf.asd b/asdf.asd index 64e4f7199c82c9af33c75370fd15511dfbe5428a..346f2f66478b0c20d8a7d646f24f9df7942549d8 100644 --- a/asdf.asd +++ b/asdf.asd @@ -14,7 +14,7 @@ :licence "MIT" :description "Another System Definition Facility" :long-description "ASDF builds Common Lisp software organized into defined systems." - :version "2.20.14" ;; to be automatically updated by bin/bump-revision + :version "2.20.15" ;; to be automatically updated by bin/bump-revision :depends-on () :components ((:file "asdf") diff --git a/asdf.lisp b/asdf.lisp index b4b23a9b1bc6f005d2e7b4beb781d89f62ceb958..6ddee2b484ef1926ef2bc06efc3f6eb051660355 100644 --- a/asdf.lisp +++ b/asdf.lisp @@ -1,5 +1,5 @@ ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; coding: utf-8 -*- -;;; This is ASDF 2.20.14: Another System Definition Facility. +;;; This is ASDF 2.20.15: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to <asdf-devel@common-lisp.net>. @@ -116,7 +116,7 @@ ;; "2.345.6" would be a development version in the official upstream ;; "2.345.0.7" would be your seventh local modification of official release 2.345 ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6 - (asdf-version "2.20.14") + (asdf-version "2.20.15") (existing-asdf (find-class 'component nil)) (existing-version *asdf-version*) (already-there (equal asdf-version existing-version))) @@ -321,6 +321,7 @@ #:coerce-entry-to-directory #:remove-entry-from-registry + #:*encoding-detection-hook* #:*encoding-external-format-hook* #:*default-encoding* #:*utf-8-external-format* @@ -650,8 +651,8 @@ starting the separation from the end, e.g. when called with arguments ;; Giving :unspecific as argument to make-pathname is not portable. ;; See CLHS make-pathname and 19.2.2.2.3. ;; We only use it on implementations that support it, - #+(or abcl allegro clozure cmu ecl gcl genera lispworks sbcl scl xcl) :unspecific - #+(or clisp #|These haven't been tested:|# cormanlisp mcl) nil)) + #+(or abcl allegro clozure cmu gcl genera lispworks sbcl scl xcl) :unspecific + #+(or clisp ecl #|These haven't been tested:|# cormanlisp mcl) nil)) (destructuring-bind (name &optional (type unspecific)) (split-string filename :max 2 :separator ".") (if (equal name "") @@ -1390,13 +1391,22 @@ On legacy implementations, it may fall back on some 8-bit encoding, with non-ASCII code points being read as several CL characters; hopefully, if done consistently, that won't affect program behavior too much.") +(defun* always-default-encoding (pathname) + (declare (ignore pathname)) + *default-encoding*) + +(defvar *encoding-detection-hook* #'always-default-encoding + "Hook for an extension to define a function to automatically detect a file's encoding") + +(defun* detect-encoding (pathname) + (funcall *encoding-detection-hook* pathname)) + (defmethod component-encoding ((c component)) - (or (%component-encoding c) - (aif (component-parent c) - (component-encoding it) - *default-encoding*))) + (or (loop :for x = c :then (component-parent x) + :while x :thereis (%component-encoding x)) + (detect-encoding (component-pathname c)))) -(defun default-encoding-external-format (encoding) +(defun* default-encoding-external-format (encoding) (case encoding (:default :default) ;; for backwards compatibility only. Explicit usage discouraged. (:utf-8 *utf-8-external-format*) @@ -1786,10 +1796,11 @@ Going forward, we recommend new users should be using the source-registry. (let ((*package* package) (*default-pathname-defaults* ;; resolve logical-pathnames so they won't wreak havoc in parsing namestrings. - (translate-logical-pathname (pathname-directory-pathname pathname)))) + (translate-logical-pathname (pathname-directory-pathname pathname))) + (external-format (encoding-external-format (detect-encoding pathname)))) (asdf-message (compatfmt "~&~@<; ~@;Loading system definition from ~A into ~A~@:>~%") pathname package) - (load pathname))) + (load pathname :external-format external-format))) (delete-package package))))) (defun* locate-system (name) @@ -3263,7 +3274,8 @@ located." (defun getenv-absolute-pathname (x &aux (s (getenv x))) (ensure-absolute-pathname* s "from (getenv ~S)" x)) (defun getenv-absolute-pathnames (x &aux (s (getenv x))) - (split-absolute-pathnames s "from (getenv ~S) = ~S" x s)) + (and (plusp (length s)) + (split-absolute-pathnames s "from (getenv ~S) = ~S" x s))) (defun* user-configuration-directories () (let ((dirs diff --git a/test/compile-asdf.lisp b/test/compile-asdf.lisp index 127aeb22e18e6d266c23078ceee369158d7df7b7..8b266c0b7e3f4c0ea848e2f06e5e83b2b5565dc6 100644 --- a/test/compile-asdf.lisp +++ b/test/compile-asdf.lisp @@ -41,11 +41,14 @@ (cond (errors-p (leave-lisp "Testsuite failed: ASDF compiled with ERRORS" 2)) - #-(or ecl xcl) + #-(or ecl scl xcl) ;; ECL 11.1.1 has spurious warnings, same with XCL 0.0.0.291. + ;; SCL has no warning but still raises the warningp flag since 2.20.15 (?) (warnings-p (leave-lisp "Testsuite failed: ASDF compiled with warnings" 1)) (t + (when warnings-p + (format t "Your implementation raised warnings, but they were ignored~%")) (when (probe-file *asdf-fasl*) (delete-file *asdf-fasl*)) (rename-file tmp *asdf-fasl*)