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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.
+31 −18
Original line number Diff line number Diff line
@@ -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
  (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)
                 (invalid))))
      (if-let (v (typecase form
                   ((or string null) form)
                   (real
       (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"
                    (invalid "Substituting a string")
                    (format nil "~D" form)) ;; 1.0 becomes "1.0"
                   (cons
       (ecase (first form)
                    (case (first form)
                      ((:read-file-form)
                       (destructuring-bind (subpath &key (at 0)) (rest form)
            (safe-read-file-form (subpathname pathname subpath) :at at))))))))
                         (safe-read-file-form (subpathname pathname subpath) :at at)))
                      ((:read-file-line)
                       (destructuring-bind (subpath &key (at 0)) (rest form)
                         (read-file-lines (subpathname pathname subpath) :at at)))
                      (otherwise
                       (invalid))))
                   (t
                    (invalid))))
        (if-let (pv (parse-version v #'invalid-parse))
          (unparse-version pv)
          (invalid))))))


;;; 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)
+0 −1
Original line number Diff line number Diff line
@@ -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 "~@<~
+1 −1
Original line number Diff line number Diff line
;;; -*- 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 <asdf-devel@common-lisp.net>.
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
         ;; "3.4.5.67" would be a development version in the official upstream of 3.4.5.
         ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5
         ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67
         (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)))
Loading