From c45e1c46db679b11527466196e358f142fe1b64b Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <tunes@google.com> Date: Wed, 30 Jan 2013 20:45:47 -0500 Subject: [PATCH] 2.26.169: yet another logical-pathname tweak, for ABCL this time. Also, tweak asdf.asd for more robust upgrade from ASDF earlier than 2.017, and fix script-support for upgrade from 2.019 and later. Make some test scripts more robust wrt pathname madness. Update TODO. --- TODO | 18 ++++---- asdf.asd | 12 ++++- filesystem.lisp | 2 +- header.lisp | 2 +- test/run-tests.sh | 4 +- test/script-support.lisp | 7 +-- test/test-logical-pathname.script | 70 +++++++++++++++--------------- test/test-static-and-serial.script | 25 ++++++----- upgrade.lisp | 2 +- version.lisp-expr | 2 +- 10 files changed, 78 insertions(+), 66 deletions(-) diff --git a/TODO b/TODO index 4c9a66bcd..8161915dc 100644 --- a/TODO +++ b/TODO @@ -1,20 +1,20 @@ -* Resolve performance degradation issue reported by stassats and fe[nl]ix -** Is it the warnings feature taking too much resources? -** Is output-files and/or input-files being called too much? Cache it! * fix upgrade on clisp ** Extract minimal test case * Bug found by fe[nl]ix: infinite loop if the definitions in an asd file - are not in strict defsystem-depends-on dependency order. Document the issue. -* fe[nl]ix: Defer evaluation of defsystem forms? + are not in strict defsystem-depends-on dependency order. +** At least document the issue. +** Real solution: defer parsing and evaluation of defsystem forms. * Learn to use cl-grid-test, to make sure ASDF changes don't break stuff, and that breakage gets fixed quickly. -* Test stassats's thing: - (asdf:enable-asdf-binary-locations-compatibility :centralize-lisp-binaries t :default-toplevel-directory *fasl-dir*) +* Include some ABL test for stassats's thing: + (asdf:enable-asdf-binary-locations-compatibility + :centralize-lisp-binaries t :default-toplevel-directory *fasl-dir*) * Make load-op a generic operation that selects the proper strategy for each system, module or file, according to component properties and user-configuration: - compile the lisp file then load the fasl (load-compiled-op), + compile the lisp file then load the fasl (load-fasl-op on a cl-source-file), load the lisp file without compiling (load-source-op), - compile all files for the system, link them and load the result (load-fasl-op), + compile all files for the system, link them and load the result + (load-fasl-op on the system), compile all files for the system *and* its dependencies, link and load (monolithic-load-fasl-op), concatenate all files for the system, then load the result (load-concatenated-source-op), concatenate all files for the system, then link them and load the result (load-compiled-concatenated-op), diff --git a/asdf.asd b/asdf.asd index 5eafa7bd3..edab0d45c 100644 --- a/asdf.asd +++ b/asdf.asd @@ -66,7 +66,7 @@ :licence "MIT" :description "Another System Definition Facility" :long-description "ASDF builds Common Lisp software organized into defined systems." - :version "2.26.168" ;; to be automatically updated by make bump-version + :version "2.26.169" ;; 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. @@ -78,5 +78,13 @@ :components (#-gcl2.6 (:file "asdf" - #-asdf3 :do-first #+asdf3 :in-order-to ((compile-op (load-source-op "asdf"))))))) + #+asdf3 :in-order-to #+asdf3 ((compile-op (load-source-op "asdf"))))))) :in-order-to (#+asdf3 (prepare-source-op (monolithic-concatenate-source-op :asdf/defsystem)))) + +;; Using :do-first instead of :in-order-to works above from ASDF 2.017 to 2.26, +;; but only this (or an equivalent defmethod component-do-first) works for ASDF1 +#-asdf3 +(setf (slot-value + (find-component (find-component (find-system "asdf") "build") "asdf") + 'asdf::do-first) + '((compile-op (load-source-op "asdf")))) diff --git a/filesystem.lisp b/filesystem.lisp index a5bc1b664..e1f7bdc61 100644 --- a/filesystem.lisp +++ b/filesystem.lisp @@ -72,7 +72,7 @@ a CL pathname satisfying all the specified constraints as per ENSURE-PATHNAME" ;; and we can survive and we will continue the planning ;; as if the file were very old. ;; (or should we treat the case in a different, special way?) - (handler-case (file-write-date pathname) (file-error () nil))) + (handler-case (file-write-date (translate-logical-pathname pathname)) (file-error () nil))) (defun* probe-file* (p &key truename) "when given a pathname P (designated by a string as per PARSE-NAMESTRING), diff --git a/header.lisp b/header.lisp index a99de0080..510b0b7b9 100644 --- a/header.lisp +++ b/header.lisp @@ -1,5 +1,5 @@ ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.26.168: Another System Definition Facility. +;;; This is ASDF 2.26.169: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to <asdf-devel@common-lisp.net>. diff --git a/test/run-tests.sh b/test/run-tests.sh index 46f86d367..a9e2bd87f 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -244,7 +244,7 @@ upgrade_tags () { # 1.97 is the last release before Gary King takes over # 1.369 is the last release by Gary King # 2.000 to 2.019 and 2.20 to 2.27 and beyond are Faré's "stable" releases - # 2.26.61 is the last single-package ASDF. + # 2.26.61 is the last single-file, single-package ASDF. echo REQUIRE 1.85 1.97 1.369 git tag -l '2.0??' git tag -l '2.??' @@ -387,4 +387,4 @@ elif [ -n "$upgrade" ] ; then run_upgrade_tests else run_tests "$@" -fi +fi ; exit # NB: "; exit" makes it robust wrt the script being modified while running. diff --git a/test/script-support.lisp b/test/script-support.lisp index ba3cdc448..09e9164f0 100644 --- a/test/script-support.lisp +++ b/test/script-support.lisp @@ -15,7 +15,7 @@ Some constraints: (:export #:asym #:acall #:asymval #:*test-directory* #:*asdf-directory* #:*build-directory* #:*implementation* - #:assert-compare #:assert-pathname-equal #:assert-pathnames-equal + #:assert-compare #:assert-equal #:assert-pathname-equal #:assert-pathnames-equal #:hash-table->alist #:load-asdf #:maybe-compile-asdf #:load-asdf-lisp #:compile-asdf #:load-asdf-fasl @@ -468,7 +468,7 @@ is bound, write a message and exit on an error. If (when (asym :initialize-output-translations) (acall :initialize-output-translations `(:output-translations - ((,(namestring *asdf-directory*)) ,(output-location "asdf")) + (,(namestring *asdf-directory*) ,(output-location "asdf")) (t ,(output-location "root")) :ignore-inherited-configuration))) (when (asym :*central-registry*) @@ -476,7 +476,8 @@ is bound, write a message and exit on an error. If (format t "Being a bit verbose~%") (when (asym :*asdf-verbose*) (setf (asymval :*asdf-verbose*) t)) (when (asym :*verbose-out*) (setf (asymval :*verbose-out*) *standard-output*)) - (when (and (asym :locate-system) (asym :pathname-directory-pathname)) + (when (and (asym :locate-system) (asym :pathname-directory-pathname) + (asym :pathname-equal)) (format t "Comparing directories~%") (let ((x (acall :pathname-directory-pathname (nth-value 2 (acall :locate-system :test-asdf))))) (assert-pathname-equal *test-directory* x) ;; not always EQUAL (!) diff --git a/test/test-logical-pathname.script b/test/test-logical-pathname.script index f0c284e85..7a2c9c0a3 100644 --- a/test/test-logical-pathname.script +++ b/test/test-logical-pathname.script @@ -1,8 +1,7 @@ ;;; -*- Lisp -*- +#+gcl2.6 (leave-test "GCL 2.6 doesn't do Logical pathnames" 0) - -#-gcl2.6 (setf (logical-pathname-translations "ASDF") #+(or allegro clisp) `(("**;*.*.*" ,(asdf::wilden *asdf-directory*))) @@ -13,44 +12,43 @@ `(,*asdf-directory* "build/fasls" :implementation "logical-host-asdf") :wilden t)))) -#-gcl2.6 +(setf asdf/cache:*asdf-cache* nil) + (DBG :logical (logical-pathname-translations "ASDF") (translate-logical-pathname "ASDF:test;test-force.asd") (truename "ASDF:test;test-force.asd")) -#-(or xcl gcl2.6) -(progn - (DBG "Test logical pathnames in central registry") - (setf *central-registry* '(#p"ASDF:test;")) - (initialize-source-registry '(:source-registry :ignore-inherited-configuration)) - (DBG "loading" (oos 'load-op :test-logical-pathname :force t))) - -#-(or xcl gcl2.6) -(progn - (DBG "Test logical pathnames in source-registry, non-recursive") - (clear-system :test-logical-pathname) - (setf *central-registry* '()) - (initialize-source-registry - '(:source-registry (:directory #p"ASDF:test;") :ignore-inherited-configuration)) - (load-system :test-logical-pathname :force t :verbose t)) - -#-(or xcl gcl2.6) -(progn - (DBG "Test logical pathnames in source-registry, recursive") - (clear-system :test-logical-pathname) - (setf *central-registry* '()) - (initialize-source-registry - ;; Bug: Allegro Express 8.2 and 9.0 incorrectly read #p"ASDF:" as relative. - ;; other bug: around 2.26.xx, CLISP borks badly if this is ASDF: - ;; and it tries to load ASDF from a logical-pathname. - '(:source-registry (:tree #p"ASDF:test;") - :ignore-inherited-configuration)) - (load-system :test-logical-pathname :force t) - #-(or clisp abcl) - (let ((sys (find-system :test-logical-pathname))) - (assert (logical-pathname-p (component-pathname sys))) - (assert (logical-pathname-p (system-source-file sys))))) +#+xcl (leave-test "GCL 2.6 doesn't do Logical pathnames well enough" 0) + +(DBG "Test logical pathnames in central registry") +(setf *central-registry* '(#p"ASDF:test;")) +(initialize-source-registry '(:source-registry :ignore-inherited-configuration)) +(DBG "loading" (oos 'load-op :test-logical-pathname :force t)) + +(DBG "Test logical pathnames in source-registry, non-recursive") +(clear-system :test-logical-pathname) +(setf *central-registry* '()) +(initialize-source-registry + '(:source-registry (:directory #p"ASDF:test;") :ignore-inherited-configuration)) +(load-system :test-logical-pathname :force t :verbose t) + +(DBG "Test logical pathnames in source-registry, recursive") +(clear-system :test-logical-pathname) +(setf *central-registry* '()) +(initialize-source-registry + ;; Bug: Allegro Express 8.2 and 9.0 incorrectly read #p"ASDF:" as relative. + ;; other bug: around 2.26.xx (before the nil-pathname cleanup, though), + ;; CLISP borks badly if the path below is #p"ASDF:" + ;; and it tries to load ASDF itself from a logical-pathname. + '(:source-registry (:tree #p"ASDF:test;") + :ignore-inherited-configuration)) +(load-system :test-logical-pathname :force t) + +#+(or clisp abcl) (leave-test "CLISP and ABCL translate logical pathnames in *LOAD-PATHNAME*" 0) + +(defparameter sys (find-system :test-logical-pathname)) +(assert (logical-pathname-p (component-pathname sys))) +(assert (logical-pathname-p (system-source-file sys))) (DBG "Done") - diff --git a/test/test-static-and-serial.script b/test/test-static-and-serial.script index 504fa9613..c664e260e 100644 --- a/test/test-static-and-serial.script +++ b/test/test-static-and-serial.script @@ -4,8 +4,6 @@ make sure that serial t and static-files don't cause full rebuilds all the time... |# - - (in-package :asdf-test) (defparameter s @@ -19,24 +17,31 @@ don't cause full rebuilds all the time... (eval s) (load-test-system 'static-and-serial) -(defparameter file1 (test-fasl "file1.lisp")) -(defparameter file1-date (file-write-date file1)) +(defparameter file1.lisp (component-pathname (find-component 'static-and-serial "file1"))) +(defparameter file2.lisp (component-pathname (find-component 'static-and-serial "file2.lisp"))) +(defparameter run-tests.sh (component-pathname (find-component 'static-and-serial "run-tests.sh"))) +(defparameter file1.fasl (first (output-files 'compile-op '(static-and-serial "file1")))) +(assert-equal file1.lisp (test-source "file1.lisp")) +(assert-equal file2.lisp (test-source "file2.lisp")) +(assert-equal run-tests.sh (test-source "run-tests.sh")) +(assert-pathname-equal file1.fasl (test-fasl "file1")) ;; differ on CCL. Sigh. +(defparameter file1-date (get-file-stamp file1.fasl)) (defparameter date1 (- file1-date 600)) (defparameter date2 (- file1-date 300)) (defparameter date3 (- file1-date 150)) (assert file1-date) (assert (asymval :*file1* :test-package)) -(format t "file: ~S~%date: ~S~%" file1 file1-date) +(format t "file: ~S~%date: ~S~%" file1.fasl file1-date) ;; date should stay same (clear-system 'static-and-serial) (delete-package :test-package) (eval s) -(touch-file "file2.lisp" :timestamp date1) -(touch-file "run-tests.sh" :timestamp date1) -(touch-file "file1.lisp" :timestamp date2) -(touch-file file1 :timestamp date3) +(touch-file file2.lisp :timestamp date1) +(touch-file run-tests.sh :timestamp date1) +(touch-file file1.lisp :timestamp date2) +(touch-file file1.fasl :timestamp date3) (DBG "load again" (oos 'load-op 'static-and-serial)) (assert (asymval :*file1* :test-package)) -(assert-equal (get-file-stamp file1) date3) +(assert-equal (get-file-stamp file1.fasl) date3) diff --git a/upgrade.lisp b/upgrade.lisp index 44034f61e..4949dc365 100644 --- a/upgrade.lisp +++ b/upgrade.lisp @@ -51,7 +51,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.26.168") + (asdf-version "2.26.169") (existing-version (asdf-version))) (setf *asdf-version* asdf-version) (when (and existing-version (not (equal asdf-version existing-version))) diff --git a/version.lisp-expr b/version.lisp-expr index 36f63638e..210e26146 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -1 +1 @@ -"2.26.168" +"2.26.169" -- GitLab