Changeset 14277


Ignore:
Timestamp:
12/03/12 00:09:58 (8 years ago)
Author:
Mark Evenson
Message:

Sync to asdf-2.26.6.

Fixes #271.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/doc/asdf/asdf.texinfo

    r14150 r14277  
    318318Any ASDF extension becomes invalid, and will need to be reloaded.
    319319This applies to e.g. CFFI-Grovel, or to hacks used by ironclad, etc.
    320 Starting with ASDF 2.014.8, ASDF will actually invalidate
    321 all previously loaded systems when it is loaded on top of
    322 a different ASDF version.
     320Starting with ASDF 2.014.8 (as far as releases go, 2.015),
     321ASDF will actually invalidate all previously loaded systems
     322when it is loaded on top of a different ASDF version.
    323323@item
    324324Until all implementations provide ASDF 2.015 or later,
     
    342342  (error "FOO requires ASDF ~A or later." *required-asdf-version*))
    343343@end example
     344@item
     345Until all implementations provide ASDF 2.27 or later,
     346it is unsafe for a system to transitively depend on ASDF
     347and not directly depend on ASDF;
     348if any of the system you use either depends-on asdf,
     349system-depends-on asdf, or transitively does,
     350you should also do as well.
    344351@end itemize
    345352
     
    638645
    639646On some implementations (namely recent versions of
    640 ABCL, Allegro CL, Clozure CL, CMUCL, ECL, GNU CLISP, LispWorks, MKCL, SBCL and XCL),
     647ABCL, Allegro CL, Clozure CL, CMUCL, ECL, GNU CLISP,
     648LispWorks, MKCL, SBCL and XCL),
    641649ASDF hooks into the @code{CL:REQUIRE} facility
    642650and you can just use:
     
    689697@xref{Configuring ASDF,,Configuring ASDF to find your systems}.
    690698
     699For the advanced users, note that
     700@code{require-system} calls @code{load-system}
     701with keyword arguments @code{:force-not (loaded-systems)}.
     702@code{loaded-systems} returns a list of the names of loaded systems.
     703@code{load-system} applies @code{operate} with the operation from
     704@code{*load-system-operation*}, which by default is @code{load-op},
     705the system, and any provided keyword arguments.
    691706
    692707@section Summary
     
    13101325Operations are invoked on systems via @code{operate}.
    13111326@anchor{operate}
    1312 @deffn {Generic function} @code{operate} @var{operation} @var{system} @&rest @var{initargs}
    1313 @deffnx {Generic function} @code{oos} @var{operation} @var{system} @&rest @var{initargs}
     1327@deffn {Generic function} @code{operate} @var{operation} @var{system} @&rest @var{initargs} @&key @code{force} @code{force-not} @code{verbose} @&allow-other-keys
     1328@deffnx {Generic function} @code{oos} @var{operation} @var{system} @&rest @var{initargs} @&key @&allow-other-keys
    13141329@code{operate} invokes @var{operation} on @var{system}.
    13151330@code{oos} is a synonym for @code{operate}.
     
    13261341with the same @var{initargs} as the original one.
    13271342
     1343If @var{force} is @code{t}, then all systems
     1344are forced to be recompiled even if not modified since last compilation.
     1345If @var{force} is a list, then it specifies a list of systems that
     1346are forced to be recompiled even if not modified since last compilation.
     1347If @var{force-not} is @code{t}, then all systems
     1348are forced not to be recompiled even if modified since last compilation.
     1349If @var{force-not} is a list, then it specifies a list of systems that
     1350are forced not to be recompiled even if modified since last compilation.
     1351@var{force} takes precedences over @var{force-not};
     1352both of them apply to systems that are dependencies and were already compiled.
    13281353@end deffn
    13291354
     
    28872912A non-nil value designates a function of one argument
    28882913that will be called with a function that
    2889 calls the @code{*compile-op-compile-file-function*} (usually @code{compile-file*})
     2914calls the @code{*compile-op-compile-file-function*}
     2915(usually @code{compile-file*})
    28902916with proper arguments;
    28912917the around-compile hook may supply additional arguments
    28922918to pass to that @code{*compile-op-compile-file-function*}.
     2919
    28932920One notable argument that is heeded by @code{compile-file*} is
    2894 @code{:compile-check}, a function called when the compilation was otherwise a success,
    2895 with the same arguments as @code{compile-file},
    2896 to determine whether
    2897 (NB: The ability to pass such extra flags is only available starting with asdf 2.22.1.)
    2898 
    2899 Note that by using a string, you may reference
     2921@code{:compile-check},
     2922a function called when the compilation was otherwise a success,
     2923with the same arguments as @code{compile-file};
     2924the function shall return true if the compilation
     2925and its resulting compiled file respected all system-specific invariants,
     2926and false (NIL) if it broke any of those invariants;
     2927it may issue warnings or errors before it returns NIL.
     2928(NB: The ability to pass such extra flags
     2929is only available starting with ASDF 2.22.3.)
     2930This feature is notably exercised by asdf-finalizers.
     2931
     2932By using a string, you may reference
    29002933a function, symbol and/or package
    29012934that will only be created later during the build, but
     
    32423275@emph{All} versions of ASDF should have the @code{:asdf} feature.
    32433276
    3244 Additionally, all versions of asdf 2
     3277Additionally, all versions of ASDF 2
    32453278define a function @code{(asdf:asdf-version)} you may use to query the version;
    3246 and the source code of recent versions of asdf 2 features the version number
     3279and the source code of recent versions of ASDF 2 features the version number
    32473280prominently on the second line of its source code.
    32483281
     
    34633496
    34643497@item
    3465 Some systems in the large have been known not to play well with output translations.
     3498Some systems in the large have been known
     3499not to play well with output translations.
    34663500They were relatively easy to fix.
    34673501Once again, it is also easy to disable output translations,
     
    34833517
    34843518@item
    3485 ASDF pathname designators are now specified in places where they were unspecified,
     3519ASDF pathname designators are now specified
     3520in places where they were unspecified,
    34863521and a few small adjustments have to be made to some non-portable defsystems.
    3487 Notably, in the @code{:pathname} argument to a @code{defsystem} and its components,
     3522Notably, in the @code{:pathname} argument
     3523to a @code{defsystem} and its components,
    34883524a logical pathname (or implementation-dependent hierarchical pathname)
    34893525must now be specified with @code{#p} syntax
     
    35133549based on the Windows registry.
    35143550Other implementations make do with environment variables,
    3515 that you may have to define yourself if you're using an older version of Windows.
     3551that you may have to define yourself
     3552if you're using an older version of Windows.
    35163553Windows support is somewhat less tested than Unix support.
    35173554Please help report and fix bugs.
     3555@emph{Update}: As of ASDF 2.21, all implementations
     3556should now use the same proper default configuration pathnames
     3557and they should actually work, though they haven't all been tested.
    35183558
    35193559@item
    35203560The mechanism by which one customizes a system so that Lisp files
    35213561may use a different extension from the default @file{.lisp} has changed.
    3522 Previously, the pathname for a component was lazily computed when operating on a system,
     3562Previously, the pathname for a component
     3563was lazily computed when operating on a system,
    35233564and you would
    35243565@code{(defmethod source-file-type ((component cl-source-file) (system (eql (find-system 'foo))))
     
    35263567Now, the pathname for a component is eagerly computed when defining the system,
    35273568and instead you will @code{(defclass cl-source-file.lis (cl-source-file) ((type :initform "lis")))}
    3528 and use @code{:default-component-class cl-source-file.lis} as argument to @code{defsystem},
     3569and use @code{:default-component-class cl-source-file.lis}
     3570as argument to @code{defsystem},
    35293571as detailed in a @pxref{FAQ,How do I create a system definition where all the source files have a .cl extension?} below.
    35303572
     
    35543596You may consult with the maintainer for which specific version they recommend,
    35553597but the latest @code{release} should be correct.
    3556 We trust you to thoroughly test it with your implementation before you release it.
     3598We trust you to thoroughly test it with your implementation
     3599before you release it.
    35573600If there are any issues with the current release,
    35583601it's a bug that you should report upstream and that we will fix ASAP.
     
    35723615then it would be nice to add ASDF to this hook the same way that
    35733616ABCL, CCL, CLISP, CMUCL, ECL, SBCL and SCL do it.
     3617Please send us appropriate code to this end.
    35743618
    35753619@item
     
    39073951
    39083952
    3909 ** document all the error classes
    3910 
    3911 ** what to do with compile-file failure
    3912 
    3913 Should check the primary return value from compile-file and see if
    3914 that gets us any closer to a sensible error handling strategy
    3915 
    3916 ** foreign files
    3917 
    3918 lift unix-dso stuff from db-sockets
    3919 
    39203953** Diagnostics
    39213954
     
    39233956
    39243957@lisp
    3925 (traverse (make-instance '<operation-name>)
    3926           (find-system <system-name>)
    3927           'explain)
     3958(let ((asdf::*verbose-out* *standard-output*))
     3959  (loop :for (op . comp) :in
     3960    (asdf::traverse (make-instance '<operation-name> :force t)
     3961                    (asdf:find-system <system-name>))
     3962    :do (asdf:explain op comp)))
    39283963@end lisp
    39293964
     
    39353970** reuse the same scratch package whenever a system is reloaded from disk
    39363971
     3972Have a package ASDF-USER instead of all these temporary packages?
     3973
    39373974** proclamations probably aren't
    39383975
    3939 ** when a system is reloaded with fewer components than it previously had, odd things happen
    3940 
    3941 We should do something inventive when processing a @code{defsystem} form,
    3942 like take the list of kids and @code{setf} the slot to @code{nil},
    3943 then transfer children from old to new list as they're found.
    3944 
    39453976** (stuff that might happen later)
    39463977
     
    39513982        @code{(asdf:compile-system :araneida :force t)}
    39523983
    3953 also forces compilation of every other system the @code{:araneida} system depends on.
     3984also forces compilation of every other system
     3985the @code{:araneida} system depends on.
    39543986This is rarely useful to me;
    3955 usually, when I want to force recompilation of something more than a single source file,
     3987usually, when I want to force recompilation
     3988of something more than a single source file,
    39563989I want to recompile only one system.
    39573990So it would be more useful to have @code{make-sub-operation}
  • trunk/abcl/src/org/armedbear/lisp/asdf.lisp

    r14230 r14277  
    11;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; coding: utf-8 -*-
    2 ;;; This is ASDF 2.26: Another System Definition Facility.
     2;;; This is ASDF 2.26.6: Another System Definition Facility.
    33;;;
    44;;; Feedback, bug reports, and patches are all welcome:
     
    119119         ;; "2.345.0.7" would be your seventh local modification of official release 2.345
    120120         ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
    121          (asdf-version "2.26")
     121         (asdf-version "2.26.6")
    122122         (existing-asdf (find-class 'component nil))
    123123         (existing-version *asdf-version*)
     
    216216                                 shadow export redefined-functions)
    217217             (let* ((p (ensure-exists name nicknames use)))
    218                (ensure-unintern p (append unintern #+cmu redefined-functions))
     218               (ensure-unintern p unintern)
    219219               (ensure-shadow p shadow)
    220220               (ensure-export p export)
    221                #-cmu (ensure-fmakunbound p redefined-functions)
     221               (ensure-fmakunbound p redefined-functions)
    222222               p)))
    223223        (macrolet
     
    412412
    413413(defvar *compile-file-failure-behaviour*
    414   (or #+sbcl :error #+clisp :ignore :warn)
     414  (or #+(or mkcl sbcl) :error #+clisp :ignore :warn)
    415415  "How should ASDF react if it encounters a failure (per the ANSI spec of COMPILE-FILE)
    416416when compiling a file?  Valid values are :error, :warn, and :ignore.
     
    12131213   (operation :reader error-operation :initarg :operation))
    12141214  (:report (lambda (c s)
    1215                (format s (compatfmt "~@<Error while invoking ~A on ~A~@:>")
    1216                        (error-operation c) (error-component c)))))
     1215               (format s (compatfmt "~@<~A while invoking ~A on ~A~@:>")
     1216                       (type-of c) (error-operation c) (error-component c)))))
    12171217(define-condition compile-error (operation-error) ())
    12181218(define-condition compile-failed (compile-error) ())
     
    14621462   (licence :accessor system-licence :initarg :licence
    14631463            :accessor system-license :initarg :license)
    1464    (source-file :reader %system-source-file :initarg :source-file ; for CLISP upgrade
    1465                 :writer %set-system-source-file)
     1464   (source-file :initarg :source-file :writer %set-system-source-file) ; upgrade issues on CLISP, CMUCL
    14661465   (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on)))
    14671466
     
    16371636FN should be a function of one argument. It will be
    16381637called with an object of type asdf:system."
    1639   (maphash #'(lambda (_ datum)
    1640                (declare (ignore _))
    1641                (destructuring-bind (_ . def) datum
    1642                  (declare (ignore _))
    1643                  (funcall fn def)))
    1644            *defined-systems*))
     1638  (loop :for (nil . system) :being :the hash-values :of *defined-systems*
     1639        :do (funcall fn system)))
    16451640
    16461641;;; for the sake of keeping things reasonably neat, we adopt a
     
    17961791(defvar *systems-being-defined* nil
    17971792  "A hash-table of systems currently being defined keyed by name, or NIL")
     1793(defvar *systems-being-operated* nil
     1794  "A boolean indicating that some systems are being operated on")
    17981795
    17991796(defun* find-system-if-being-defined (name)
     
    20052002  (declare (ignorable operation slot-names force force-not))
    20062003  (macrolet ((frob (x) ;; normalize forced and forced-not slots
    2007                `(when (consp (,x operation))
    2008                   (setf (,x operation)
    2009                         (mapcar #'coerce-name (,x operation))))))
    2010     (frob operation-forced) (frob operation-forced-not))
     2004               `(when (consp (slot-value operation ',x))
     2005                  (setf (slot-value operation ',x)
     2006                        (mapcar #'coerce-name (slot-value operation ',x))))))
     2007    (frob forced) (frob forced-not))
    20112008  (values))
    20122009
     
    23582355                   (c x)))
    23592356             (r* (l)
    2360                (dolist (x l) (r x))))
     2357               (map () #'r l)))
    23612358      (r* l))))
    23622359
     
    24592456                                 (read-from-string fun))))))))
    24602457
    2461 (defmethod call-with-around-compile-hook ((c component) thunk)
    2462   (let ((hook (around-compile-hook c)))
    2463     (if hook
    2464         (funcall (ensure-function hook) thunk)
    2465         (funcall thunk))))
     2458(defun call-around-hook (hook function)
     2459  (funcall (or (ensure-function hook) 'funcall) function))
     2460
     2461(defmethod call-with-around-compile-hook ((c component) function)
     2462  (call-around-hook (around-compile-hook c) function))
    24662463
    24672464;;; perform is required to check output-files to find out where to put
     
    26192616(defmethod operation-done-p ((o load-source-op) (c source-file))
    26202617  (declare (ignorable o))
    2621   (if (or (not (component-property c 'last-loaded-as-source))
    2622           (> (safe-file-write-date (component-pathname c))
    2623              (component-property c 'last-loaded-as-source)))
    2624       nil t))
     2618  (and (component-property c 'last-loaded-as-source)
     2619       (<= (safe-file-write-date (component-pathname c))
     2620           (component-property c 'last-loaded-as-source))))
    26252621
    26262622(defmethod operation-description ((operation load-source-op) component)
     
    26582654(defgeneric* operate (operation-class system &key &allow-other-keys))
    26592655(defgeneric* perform-plan (plan &key))
     2656(defgeneric* plan-operates-on-p (plan component))
    26602657
    26612658;;;; Separating this into a different function makes it more forward-compatible
     
    26922689    (cleanup-upgraded-asdf version)))
    26932690
     2691(defmethod plan-operates-on-p ((plan list) (component-path list))
     2692  (find component-path (mapcar 'cdr plan)
     2693        :test 'equal :key 'component-find-path))
     2694
    26942695(defmethod perform-plan ((steps list) &key)
    26952696  (let ((*package* *package*)
     
    27002701
    27012702(defmethod operate (operation-class system &rest args
    2702                     &key ((:verbose *asdf-verbose*) *asdf-verbose*) version force
    2703                     &allow-other-keys)
    2704   (declare (ignore force))
     2703                    &key force force-not verbose version &allow-other-keys)
     2704  (declare (ignore force force-not))
    27052705  (with-system-definitions ()
    2706     (let* ((op (apply 'make-instance operation-class
    2707                       :original-initargs args
    2708                       args))
    2709            (*verbose-out* (if *asdf-verbose* *standard-output* (make-broadcast-stream)))
     2706    (let* ((*asdf-verbose* verbose)
     2707           (*verbose-out* (if verbose *standard-output* (make-broadcast-stream)))
     2708           (op (apply 'make-instance operation-class
     2709                      :original-initargs args args))
    27102710           (system (etypecase system
    27112711                     (system system)
    2712                      ((or string symbol) (find-system system)))))
    2713       (unless (version-satisfies system version)
    2714         (error 'missing-component-of-version :requires system :version version))
    2715       (let ((steps (traverse op system)))
    2716         (when (and (not (equal '("asdf") (component-find-path system)))
    2717                    (find '("asdf") (mapcar 'cdr steps)
    2718                          :test 'equal :key 'component-find-path)
    2719                    (upgrade-asdf))
    2720           ;; If we needed to upgrade ASDF to achieve our goal,
    2721           ;; then do it specially as the first thing, then
    2722           ;; invalidate all existing system
    2723           ;; retry the whole thing with the new OPERATE function,
    2724           ;; which on some implementations
    2725           ;; has a new symbol shadowing the current one.
    2726           (return-from operate
    2727             (apply (find-symbol* 'operate :asdf) operation-class system args)))
    2728         (perform-plan steps)
    2729         (values op steps)))))
    2730 
    2731 (defun* oos (operation-class system &rest args &key force verbose version
    2732             &allow-other-keys)
    2733   (declare (ignore force verbose version))
     2712                     ((or string symbol) (find-system system))))
     2713           (systems-being-operated *systems-being-operated*)
     2714           (*systems-being-operated* (or systems-being-operated (make-hash-table :test 'equal))))
     2715      (check-type system system)
     2716      (setf (gethash (coerce-name system) *systems-being-operated*) system)
     2717      (flet ((upgrade ()
     2718               ;; If we needed to upgrade ASDF to achieve our goal,
     2719               ;; then do it specially as the first thing,
     2720               ;; which will invalidate all existing systems;
     2721               ;; afterwards, retry the whole thing with the new OPERATE function,
     2722               ;; which on some implementations
     2723               ;; has a new symbol shadowing the current one.
     2724               (unless (gethash "asdf" *systems-being-operated*)
     2725                 (upgrade-asdf)
     2726                 (return-from operate
     2727                   (apply (find-symbol* 'operate :asdf) operation-class system args)))))
     2728        (when systems-being-operated ;; Upgrade if loading a system from another one.
     2729          (upgrade))
     2730        (unless (version-satisfies system version)
     2731          (error 'missing-component-of-version :requires system :version version))
     2732        (let ((plan (traverse op system)))
     2733          (when (plan-operates-on-p plan '("asdf"))
     2734            (upgrade)) ;; Upgrade early if the plan involves upgrading asdf at any time.
     2735          (perform-plan plan)
     2736          (values op plan))))))
     2737
     2738(defun* oos (operation-class system &rest args
     2739             &key force force-not verbose version &allow-other-keys)
     2740  (declare (ignore force force-not verbose version))
    27342741  (apply 'operate operation-class system args))
    27352742
     
    31843191    (%set-system-source-file
    31853192     (probe-asd (component-name system) (component-pathname system)) system))
    3186   (%system-source-file system))
     3193  (slot-value system 'source-file))
    31873194(defmethod system-source-file ((system-name string))
    3188   (%system-source-file (find-system system-name)))
     3195  (system-source-file (find-system system-name)))
    31893196(defmethod system-source-file ((system-name symbol))
    3190   (%system-source-file (find-system system-name)))
     3197  (system-source-file (find-system system-name)))
    31913198
    31923199(defun* system-source-directory (system-designator)
     
    39193926
    39203927(defun* tmpize-pathname (x)
    3921   (make-pathname
    3922    :name (strcat "ASDF-TMP-" (pathname-name x))
    3923    :defaults x))
     3928  (make-pathname :name (strcat "ASDF-TMP-" (pathname-name x)) :defaults x))
    39243929
    39253930(defun* delete-file-if-exists (x)
     
    39563961      (values output-truename warnings-p failure-p))))
    39573962
    3958 #+abcl 
     3963#+abcl
    39593964(defun* translate-jar-pathname (source wildcard)
    39603965  (declare (ignore wildcard))
    3961   (let* ((jar
    3962           (pathname (first (pathname-device source))))
    3963          (target-root-directory-namestring
    3964           (format nil "/___jar___file___root___/~@[~A/~]"
    3965                   (and (find :windows *features*)
    3966                        (pathname-device jar))))
    3967          (relative-source
    3968           (relativize-pathname-directory source))
    3969          (relative-jar
    3970           (relativize-pathname-directory (ensure-directory-pathname jar)))
    3971          (target-root-directory
    3972           (if (find :windows *features*)
    3973               (make-pathname :name nil
    3974                              :type nil
    3975                              :version nil
    3976                              :defaults (parse-namestring target-root-directory-namestring))
    3977               (make-pathname :device :unspecific
    3978                              :name nil
    3979                              :type nil
    3980                              :version nil
    3981                              :defaults (parse-namestring target-root-directory-namestring))))
    3982          (target-root
    3983           (merge-pathnames* relative-jar target-root-directory))
    3984          (target
    3985           (merge-pathnames* relative-source target-root)))
    3986     (if (find :windows *features*)
    3987         (apply-output-translations target)
    3988         (make-pathname :defaults (apply-output-translations target)
    3989                        :device :unspecific))))
     3966  (flet ((normalize-device (pathname)
     3967           (if (find :windows *features*)
     3968               pathname
     3969               (make-pathname :defaults pathname :device :unspecific))))
     3970    (let* ((jar
     3971             (pathname (first (pathname-device source))))
     3972           (target-root-directory-namestring
     3973             (format nil "/___jar___file___root___/~@[~A/~]"
     3974                     (and (find :windows *features*)
     3975                          (pathname-device jar))))
     3976           (relative-source
     3977             (relativize-pathname-directory source))
     3978           (relative-jar
     3979             (relativize-pathname-directory (ensure-directory-pathname jar)))
     3980           (target-root-directory
     3981             (normalize-device
     3982              (pathname-directory-pathname
     3983               (parse-namestring target-root-directory-namestring))))
     3984           (target-root
     3985             (merge-pathnames* relative-jar target-root-directory))
     3986           (target
     3987             (merge-pathnames* relative-source target-root)))
     3988      (normalize-device (apply-output-translations target)))))
    39903989
    39913990;;;; -----------------------------------------------------------------
     
    41554154
    41564155(defun* collect-sub*directories-asd-files
    4157     (directory &key
    4158      (exclude *default-source-registry-exclusions*)
    4159      collect)
     4156    (directory &key (exclude *default-source-registry-exclusions*) collect)
    41604157  (collect-sub*directories
    41614158   directory
     
    45094506
    45104507#+mkcl
    4511 (progn
    4512   (defvar *loading-asdf-bundle* nil)
    4513   (unless *loading-asdf-bundle*
    4514     (let ((*central-registry*
    4515            (cons (translate-logical-pathname #P"CONTRIB:asdf-bundle;") *central-registry*))
    4516     (*loading-asdf-bundle* t))
    4517       (clear-system :asdf-bundle) ;; we hope to force a reload.
    4518       (multiple-value-bind (result bundling-error)
    4519           (ignore-errors (asdf:oos 'asdf:load-op :asdf-bundle))
    4520         (unless result
    4521     (format *error-output*
    4522       "~&;;; ASDF: Failed to load package 'asdf-bundle'!~%;;; ASDF: Reason is: ~A.~%"
    4523       bundling-error))))))
     4508(handler-case
     4509    (progn
     4510      (load-sysdef "asdf-bundle"
     4511                   (subpathname (translate-logical-pathname #P"CONTRIB:")
     4512                                "asdf-bundle/asdf-bundle.asd"))
     4513      (load-system "asdf-bundle"))
     4514  (error (e)
     4515    (format *error-output*
     4516            "~&;;; ASDF: Failed to load package 'asdf-bundle'!~%;;; ~A~%"
     4517            e)))
    45244518
    45254519#+allegro
Note: See TracChangeset for help on using the changeset viewer.