Commit b9376714 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

2.30.6: don't error out on bad :version specification, just WARN for now.

Maybe CERROR in the future?

Also, WARN if the system has a non-canonical version number.
Because SB-GROVEL has non-canonical version number 0.01, skip warning for builtin systems.
parent f23b2038
......@@ -74,7 +74,7 @@
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.30.5" ;; to be automatically updated by make bump-version
:version "2.30.6" ;; to be automatically updated by make bump-version
:depends-on ()
#+asdf3 :encoding #+asdf3 :utf-8
;; For most purposes, asdf itself specially counts as a builtin system.
......@@ -87,18 +87,34 @@
(sysdef-error-component ":components must be NIL or a list of components."
type name components)))
(defun normalize-version (form pathname)
(etypecase form
((or string null) form)
(asdf-message "Invalid use of real number ~D as :version in ~S. Substituting a string."
form pathname)
(format nil "~D" form)) ;; 1.0 is "1.0"
(ecase (first form)
(destructuring-bind (subpath &key (at 0)) (rest form)
(safe-read-file-form (subpathname pathname subpath) :at at))))))))
(defun* (normalize-version) (form &key pathname component parent)
(labels ((invalid (&optional (continuation "using NIL instead"))
(warn (compatfmt "~@<Invalid :version specifier ~S~@[ for component ~S~]~@[ in ~S~]~@[ from file ~S~]~@[, ~A~]~@:>")
form component parent pathname continuation))
(invalid-parse (control &rest args)
(unless (builtin-system-p (find-component parent component))
(apply 'warn control args)
(if-let (v (typecase form
((or string null) form)
(invalid "Substituting a string")
(format nil "~D" form)) ;; 1.0 becomes "1.0"
(case (first form)
(destructuring-bind (subpath &key (at 0)) (rest form)
(safe-read-file-form (subpathname pathname subpath) :at at)))
(destructuring-bind (subpath &key (at 0)) (rest form)
(read-file-lines (subpathname pathname subpath) :at at)))
(if-let (pv (parse-version v #'invalid-parse))
(unparse-version pv)
;;; Main parsing function
......@@ -142,13 +158,10 @@
(apply 'reinitialize-instance component args)
(setf component (apply 'make-instance (class-for-type parent type) args)))
(component-pathname component) ; eagerly compute the absolute pathname
(let ((sysdir (system-source-directory (component-system component)))) ;; requires the previous
(let ((sysfile (system-source-file (component-system component)))) ;; requires the previous
(when (and (typep component 'system) (not bspp))
(setf (builtin-system-p component) (lisp-implementation-pathname-p sysdir)))
(setf version (normalize-version version sysdir)))
(when (and versionp version (not (parse-version version nil)))
(warn (compatfmt "~@<Invalid version ~S for component ~S~@[ of ~S~]~@:>")
version name parent))
(setf (builtin-system-p component) (lisp-implementation-pathname-p sysfile)))
(setf version (normalize-version version :component name :parent parent :pathname sysfile)))
;; Don't use the accessor: kluge to avoid upgrade issue on CCL 1.8.
;; A better fix is required.
(setf (slot-value component 'version) version)
......@@ -309,7 +309,6 @@ Going forward, we recommend new users should be using the source-registry.
(if-let (pair (system-registered-p "asdf"))
(system-source-file (cdr pair))))
(key (list pathname old-version)))
(format t "~S~%" (list :cnoas name pathname version-pathname version old-pathname old-version key (gethash key *old-asdf-systems*)))
(unless (gethash key *old-asdf-systems*)
(setf (gethash key *old-asdf-systems*) t)
(warn "~@<~
;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
;;; This is ASDF 2.30.5: Another System Definition Facility.
;;; This is ASDF 2.30.6: Another System Definition Facility.
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <>.
......@@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
;; "" would be a development version in the official upstream of 3.4.5.
;; "" would be your eighth local modification of official release 3.4.5
;; "" would be your eighth local modification of development version
(asdf-version "2.30.5")
(asdf-version "2.30.6")
(existing-version (asdf-version)))
(setf *asdf-version* asdf-version)
(when (and existing-version (not (equal asdf-version existing-version)))
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