Changeset 14626
- Timestamp:
- 02/12/14 19:11:06 (9 years ago)
- Location:
- trunk/abcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/doc/asdf/asdf.texinfo
r14604 r14626 36 36 @url{http://common-lisp.net/project/asdf/asdf.html}. 37 37 38 ASDF Copyright @copyright{} 2001-201 3Daniel Barlow and contributors.39 40 This manual Copyright @copyright{} 2001-201 3Daniel Barlow and contributors.41 42 This manual revised @copyright{} 2009-201 3Robert P. Goldman and Francois-Rene Rideau.38 ASDF Copyright @copyright{} 2001-2014 Daniel Barlow and contributors. 39 40 This manual Copyright @copyright{} 2001-2014 Daniel Barlow and contributors. 41 42 This manual revised @copyright{} 2009-2014 Robert P. Goldman and Francois-Rene Rideau. 43 43 44 44 Permission is hereby granted, free of charge, to any person obtaining … … 174 174 @emph{Nota Bene}: 175 175 We have released ASDF 2.000 on May 31st 2010, 176 and ASDF 3.0 on January 31st2013.176 and ASDF 3.0.0 on May 15th 2013. 177 177 Releases of ASDF 2 and later have since then been included 178 178 in all actively maintained CL implementations that used to bundle ASDF 1, -
trunk/abcl/src/org/armedbear/lisp/asdf.lisp
r14604 r14626 1 ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-2 ;;; This is ASDF 3.1.0. 49: Another System Definition Facility.1 ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; buffer-read-only: t; -*- 2 ;;; This is ASDF 3.1.0.65: Another System Definition Facility. 3 3 ;;; 4 4 ;;; Feedback, bug reports, and patches are all welcome: … … 54 54 (setf ext:*gc-verbose* nil)) 55 55 56 ;;; pre 1.3.0 ABCL versions do not support the bundle-op on Mac OS X 57 #+abcl 58 (eval-when (:load-toplevel :compile-toplevel :execute) 59 (unless (and (member :darwin *features*) 60 (second (third (sys::arglist 'directory)))) 61 (push :abcl-bundle-op-supported *features*))) 62 56 63 ;; Punt on hard package upgrade: from ASDF1 always, and even from ASDF2 on most implementations. 57 64 (eval-when (:load-toplevel :compile-toplevel :execute) … … 72 79 (when (and existing-version 73 80 (< existing-version-number 74 (or #+(or allegro clisp lispworks sbcl) 2.0 2.27))) 81 #+(or allegro clisp lispworks sbcl) 2.0 82 #-(or allegro clisp lispworks sbcl) 2.27)) 75 83 (rename-package :asdf away) 76 84 (when *load-verbose* … … 2242 2250 actually-existing directory." 2243 2251 (when pathname 2252 ;; I tried using Allegro's excl:file-directory-p, but this cannot be done, 2253 ;; because it rejects apparently legal pathnames as 2254 ;; ill-formed. [2014/02/10:rpg] 2244 2255 (let ((pathname (pathname pathname))) 2245 2256 (flet ((check-one (x) … … 2812 2823 (defun directory-exists-p (x) 2813 2824 "Is X the name of a directory that exists on the filesystem?" 2825 #+allegro 2826 (excl:probe-directory x) 2827 #+clisp 2828 (handler-case (ext:probe-directory x) 2829 (sys::simple-file-error () 2830 nil)) 2831 #-(or allegro clisp) 2814 2832 (let ((p (probe-file* x :truename t))) 2815 2833 (and (directory-pathname-p p) p))) … … 2836 2854 the entries which are physical yet when transformed by MERGER have a different TRUENAME. 2837 2855 This function is used as a helper to DIRECTORY-FILES to avoid invalid entries when using logical-pathnames." 2838 (if (logical-pathname-p directory) 2839 ;; Try hard to not resolve logical-pathname into physical pathnames; 2840 ;; otherwise logical-pathname users/lovers will be disappointed. 2841 ;; If directory* could use some implementation-dependent magic, 2842 ;; we will have logical pathnames already; otherwise, 2843 ;; we only keep pathnames for which specifying the name and 2844 ;; translating the LPN commute. 2845 (loop :for f :in entries 2846 :for p = (or (and (logical-pathname-p f) f) 2847 (let* ((u (ignore-errors (call-function merger f)))) 2848 ;; The first u avoids a cumbersome (truename u) error. 2849 ;; At this point f should already be a truename, 2850 ;; but isn't quite in CLISP, for it doesn't have :version :newest 2851 (and u (equal (truename* u) (truename* f)) u))) 2852 :when p :collect p) 2853 entries)) 2856 (remove-duplicates ;; on CLISP, querying ~/ will return duplicates 2857 (if (logical-pathname-p directory) 2858 ;; Try hard to not resolve logical-pathname into physical pathnames; 2859 ;; otherwise logical-pathname users/lovers will be disappointed. 2860 ;; If directory* could use some implementation-dependent magic, 2861 ;; we will have logical pathnames already; otherwise, 2862 ;; we only keep pathnames for which specifying the name and 2863 ;; translating the LPN commute. 2864 (loop :for f :in entries 2865 :for p = (or (and (logical-pathname-p f) f) 2866 (let* ((u (ignore-errors (call-function merger f)))) 2867 ;; The first u avoids a cumbersome (truename u) error. 2868 ;; At this point f should already be a truename, 2869 ;; but isn't quite in CLISP, for it doesn't have :version :newest 2870 (and u (equal (truename* u) (truename* f)) u))) 2871 :when p :collect p) 2872 entries) 2873 :test 'pathname-equal)) 2874 2854 2875 2855 2876 (defun directory-files (directory &optional (pattern *wild-file*)) 2856 "Return a list of the files in a directory according to the PATTERN, 2857 which is not very portable to override. Try not resolve symlinks if implementation allows." 2877 "Return a list of the files in a directory according to the PATTERN. 2878 Subdirectories should NOT be returned. 2879 PATTERN defaults to a pattern carefully chosen based on the implementation; 2880 override the default at your own risk. 2881 DIRECTORY-FILES tries NOT to resolve symlinks if the implementation 2882 permits this." 2858 2883 (let ((dir (pathname directory))) 2859 2884 (when (logical-pathname-p dir) … … 2871 2896 (when (equal :wild (pathname-type pattern)) 2872 2897 (ignore-errors (directory* (make-pathname :type nil :defaults pat))))))) 2873 (filter-logical-directory-results 2874 directory entries 2875 #'(lambda (f) 2876 (make-pathname :defaults dir 2877 :name (make-pathname-component-logical (pathname-name f)) 2878 :type (make-pathname-component-logical (pathname-type f)) 2879 :version (make-pathname-component-logical (pathname-version f)))))))) 2898 (remove-if 'directory-pathname-p 2899 (filter-logical-directory-results 2900 directory entries 2901 #'(lambda (f) 2902 (make-pathname :defaults dir 2903 :name (make-pathname-component-logical (pathname-name f)) 2904 :type (make-pathname-component-logical (pathname-type f)) 2905 :version (make-pathname-component-logical (pathname-version f))))))))) 2880 2906 2881 2907 (defun subdirectories (directory) … … 4577 4603 4578 4604 (defmethod slurp-input-stream ((x (eql 'string)) stream &key stripped) 4579 (declare (ignorable x))4580 4605 (slurp-stream-string stream :stripped stripped)) 4581 4606 4582 4607 (defmethod slurp-input-stream ((x (eql :string)) stream &key stripped) 4583 (declare (ignorable x))4584 4608 (slurp-stream-string stream :stripped stripped)) 4585 4609 4586 4610 (defmethod slurp-input-stream ((x (eql :lines)) stream &key count) 4587 (declare (ignorable x))4588 4611 (slurp-stream-lines stream :count count)) 4589 4612 4590 4613 (defmethod slurp-input-stream ((x (eql :line)) stream &key (at 0)) 4591 (declare (ignorable x))4592 4614 (slurp-stream-line stream :at at)) 4593 4615 4594 4616 (defmethod slurp-input-stream ((x (eql :forms)) stream &key count) 4595 (declare (ignorable x))4596 4617 (slurp-stream-forms stream :count count)) 4597 4618 4598 4619 (defmethod slurp-input-stream ((x (eql :form)) stream &key (at 0)) 4599 (declare (ignorable x))4600 4620 (slurp-stream-form stream :at at)) 4601 4621 4602 4622 (defmethod slurp-input-stream ((x (eql t)) stream &rest keys &key &allow-other-keys) 4603 (declare (ignorable x))4604 4623 (apply 'slurp-input-stream *standard-output* stream keys)) 4605 4624 4606 (defmethod slurp-input-stream ((x null) stream &key) 4607 (declare (ignorable x stream)) 4625 (defmethod slurp-input-stream ((x null) (stream t) &key) 4608 4626 nil) 4609 4627 … … 4680 4698 4681 4699 (defmethod vomit-output-stream ((x (eql t)) stream &rest keys &key &allow-other-keys) 4682 (declare (ignorable x))4683 4700 (apply 'vomit-output-stream *standard-input* stream keys)) 4684 4701 4685 (defmethod vomit-output-stream ((x null) stream &key) 4686 (declare (ignorable x stream)) 4702 (defmethod vomit-output-stream ((x null) (stream t) &key) 4687 4703 (values)) 4688 4704 … … 6419 6435 ;; See https://bugs.launchpad.net/asdf/+bug/485687 6420 6436 6421 ( asdf/package:define-package :asdf/upgrade6437 (uiop/package:define-package :asdf/upgrade 6422 6438 (:recycle :asdf/upgrade :asdf) 6423 6439 (:use :uiop/common-lisp :uiop) … … 6429 6445 ;; There will be no symbol left behind! 6430 6446 #:intern*) 6431 (:import-from : asdf/package #:intern* #:find-symbol*))6447 (:import-from :uiop/package #:intern* #:find-symbol*)) 6432 6448 (in-package :asdf/upgrade) 6433 6449 … … 6468 6484 (and *previous-asdf-versions* (not (equal *asdf-version* (first *previous-asdf-versions*))))) 6469 6485 (defmacro when-upgrading ((&key (upgrading-p '(upgrading-p)) when) &body body) 6486 "A wrapper macro for code that should only be run when upgrading a 6487 previously-loaded version of ASDF." 6470 6488 `(with-upgradability () 6471 6489 (when (and ,upgrading-p ,@(when when `(,when))) … … 6481 6499 ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5 6482 6500 ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67 6483 (asdf-version "3.1.0. 49")6501 (asdf-version "3.1.0.65") 6484 6502 (existing-version (asdf-version))) 6485 6503 (setf *asdf-version* asdf-version) … … 6515 6533 #:resolve-relative-location-component #:resolve-absolute-location-component 6516 6534 #:output-files-for-system-and-operation))) ; obsolete ASDF-BINARY-LOCATION function 6517 (declare (ignorable redefined-functions uninterned-symbols)) 6518 (loop :for name :in (append redefined-functions) 6535 (loop :for name :in redefined-functions 6519 6536 :for sym = (find-symbol* name :asdf nil) :do 6520 6537 (when sym … … 6576 6593 ;;;; Components 6577 6594 6578 ( asdf/package:define-package :asdf/component6595 (uiop/package:define-package :asdf/component 6579 6596 (:recycle :asdf/component :asdf/defsystem :asdf/find-system :asdf) 6580 6597 (:use :uiop/common-lisp :uiop :asdf/upgrade) … … 6636 6653 (defgeneric (setf component-version) (new-version component)) 6637 6654 (defgeneric component-parent (component)) 6638 (defmethod component-parent ((component null)) (declare (ignorable component))nil)6655 (defmethod component-parent ((component null)) nil) 6639 6656 6640 6657 ;; Backward compatible way of computing the FILE-TYPE of a component. … … 6657 6674 (duplicate-names-name c)))))) 6658 6675 6659 6660 6661 (when-upgrading (:when (find-class 'component nil))6662 (defmethod reinitialize-instance :after ((c component) &rest initargs &key)6663 (declare (ignorable c initargs)) (values)))6664 6676 6665 6677 (with-upgradability () … … 6717 6729 6718 6730 (defun component-find-path (component) 6731 "Return a path from a root system to the COMPONENT. 6732 The return value is a list of component NAMES; a list of strings." 6719 6733 (check-type component (or null component)) 6720 6734 (reverse … … 6735 6749 ;; The tree typically but not necessarily follows the filesystem hierarchy. 6736 6750 (with-upgradability () 6737 (defclass child-component (component) ()) 6751 (defclass child-component (component) () 6752 (:documentation "A CHILD-COMPONENT is a component that may be part of 6753 a PARENT-COMPONENT.")) 6738 6754 6739 6755 (defclass file-component (child-component) … … 6764 6780 :initform nil 6765 6781 :initarg :default-component-class 6766 :accessor module-default-component-class)))) 6782 :accessor module-default-component-class)) 6783 (:documentation "A PARENT-COMPONENT is a component that may have 6784 children."))) 6767 6785 6768 6786 (with-upgradability () … … 6777 6795 (setf (gethash name hash) c)) 6778 6796 hash)))) 6779 6780 (when-upgrading (:when (find-class 'module nil))6781 (defmethod reinitialize-instance :after ((m module) &rest initargs &key)6782 (declare (ignorable m initargs)) (values))6783 (defmethod update-instance-for-redefined-class :after6784 ((m module) added deleted plist &key)6785 (declare (ignorable m added deleted plist))6786 (when (and (member 'children added) (member 'components deleted))6787 (setf (slot-value m 'children)6788 ;; old ECLs provide an alist instead of a plist(!)6789 (if (or #+ecl (consp (first plist))) (or #+ecl (cdr (assoc 'components plist)))6790 (getf plist 'components)))6791 (compute-children-by-name m))))6792 6797 6793 6798 (with-upgradability () … … 6816 6821 6817 6822 (defmethod component-relative-pathname ((component component)) 6818 ;; source-file-type is backward-compatibility with ASDF1; 6819 ;; we ought to be able to extract this from the component alone with COMPONENT-TYPE. 6820 ;; TODO: track who uses it, and have them not use it anymore. 6823 ;; SOURCE-FILE-TYPE below is strictly for backward-compatibility with ASDF1. 6824 ;; We ought to be able to extract this from the component alone with COMPONENT-TYPE. 6825 ;; TODO: track who uses it, and have them not use it anymore; 6826 ;; maybe issue a WARNING (then eventually CERROR) if the two methods diverge? 6821 6827 (parse-unix-namestring 6822 6828 (or (and (slot-boundp component 'relative-pathname) … … 6827 6833 :defaults (component-parent-pathname component))) 6828 6834 6829 (defmethod source-file-type ((component parent-component) system) 6830 (declare (ignorable component system)) 6835 (defmethod source-file-type ((component parent-component) (system parent-component)) 6831 6836 :directory) 6832 6837 6833 (defmethod source-file-type ((component file-component) system) 6834 (declare (ignorable system)) 6838 (defmethod source-file-type ((component file-component) (system parent-component)) 6835 6839 (file-type component))) 6836 6840 … … 6886 6890 ;;;; Systems 6887 6891 6888 ( asdf/package:define-package :asdf/system6892 (uiop/package:define-package :asdf/system 6889 6893 (:recycle :asdf :asdf/system) 6890 6894 (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/component) … … 6914 6918 (defgeneric component-entry-point (component)) 6915 6919 (defmethod component-entry-point ((c component)) 6916 (declare (ignorable c))6917 6920 nil)) 6918 6921 … … 6991 6994 6992 6995 (defmethod component-build-pathname ((c component)) 6993 (declare (ignorable c))6994 6996 nil)) 6995 6997 … … 6997 6999 ;;;; Stamp cache 6998 7000 6999 ( asdf/package:define-package :asdf/cache7001 (uiop/package:define-package :asdf/cache 7000 7002 (:use :uiop/common-lisp :uiop :asdf/upgrade) 7001 7003 (:export #:get-file-stamp #:compute-file-stamp #:register-file-stamp … … 7062 7064 ;;;; Finding systems 7063 7065 7064 ( asdf/package:define-package :asdf/find-system7066 (uiop/package:define-package :asdf/find-system 7065 7067 (:recycle :asdf/find-system :asdf) 7066 7068 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 7307 7309 7308 7310 (defmethod find-system ((name null) &optional (error-p t)) 7309 (declare (ignorable name))7310 7311 (when error-p 7311 7312 (sysdef-error (compatfmt "~@<NIL is not a valid system name~@:>")))) … … 7484 7485 ;;;; Finding components 7485 7486 7486 ( asdf/package:define-package :asdf/find-component7487 (uiop/package:define-package :asdf/find-component 7487 7488 (:recycle :asdf/find-component :asdf) 7488 7489 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 7562 7563 (find-component (find-component c (car name)) (cdr name))) 7563 7564 7564 (defmethod find-component (base (actual component)) 7565 (declare (ignorable base)) 7565 (defmethod find-component ((base t) (actual component)) 7566 7566 actual) 7567 7567 … … 7603 7603 7604 7604 (defmethod resolve-dependency-combination (component (combinator (eql :feature)) arguments) 7605 (declare (ignorable combinator))7606 7605 (when (featurep (first arguments)) 7607 7606 (resolve-dependency-spec component (second arguments)))) 7608 7607 7609 7608 (defmethod resolve-dependency-combination (component (combinator (eql :version)) arguments) 7610 (declare (ignorable combinator)) ;; See https://bugs.launchpad.net/asdf/+bug/527788 7611 (resolve-dependency-name component (first arguments) (second arguments)))) 7609 (resolve-dependency-name component (first arguments) (second arguments)))) ;; See lp#527788 7612 7610 7613 7611 ;;;; ------------------------------------------------------------------------- 7614 7612 ;;;; Operations 7615 7613 7616 ( asdf/package:define-package :asdf/operation7614 (uiop/package:define-package :asdf/operation 7617 7615 (:recycle :asdf/operation :asdf/action :asdf) ;; asdf/action for FEATURE pre 2.31.5. 7618 7616 (:use :uiop/common-lisp :uiop :asdf/upgrade) … … 7620 7618 #:operation 7621 7619 #:operation-original-initargs #:original-initargs ;; backward-compatibility only. DO NOT USE. 7622 #:build-op ;; THE generic operation7623 7620 #:*operations* #:make-operation #:find-operation #:feature)) 7624 7621 (in-package :asdf/operation) … … 7627 7624 7628 7625 (when-upgrading (:when (find-class 'operation nil)) 7629 (defmethod shared-initialize :after ((o operation) slot-names &rest initargs &key) 7630 (declare (ignorable o slot-names initargs)) (values))) 7626 ;; override any obsolete shared-initialize method when upgrading from ASDF2. 7627 (defmethod shared-initialize :after ((o operation) (slot-names t) &key) 7628 (values))) 7631 7629 7632 7630 (with-upgradability () … … 7635 7633 :initform nil :initarg :original-initargs :accessor operation-original-initargs))) 7636 7634 7635 ;; Cache a copy of the INITARGS in the ORIGINAL-INITARGS slot, if that slot is not 7636 ;; already bound. 7637 7637 (defmethod initialize-instance :after ((o operation) &rest initargs 7638 7638 &key force force-not system verbose &allow-other-keys) 7639 (declare (ignor able force force-not system verbose))7639 (declare (ignore force force-not system verbose)) 7640 7640 (unless (slot-boundp o 'original-initargs) 7641 7641 (setf (operation-original-initargs o) initargs))) … … 7657 7657 (defgeneric find-operation (context spec) 7658 7658 (:documentation "Find an operation by resolving the SPEC in the CONTEXT")) 7659 (defmethod find-operation (context (spec operation)) 7660 (declare (ignorable context)) 7659 (defmethod find-operation ((context t) (spec operation)) 7661 7660 spec) 7662 7661 (defmethod find-operation (context (spec symbol)) … … 7667 7666 (defmethod operation-original-initargs ((context symbol)) 7668 7667 (declare (ignorable context)) 7669 nil) 7670 7671 (defclass build-op (operation) ())) 7672 7668 nil)) 7673 7669 7674 7670 ;;;; ------------------------------------------------------------------------- 7675 7671 ;;;; Actions 7676 7672 7677 ( asdf/package:define-package :asdf/action7673 (uiop/package:define-package :asdf/action 7678 7674 (:nicknames :asdf-action) 7679 7675 (:recycle :asdf/action :asdf) … … 7683 7679 #:action #:define-convenience-action-methods 7684 7680 #:explain #:action-description 7685 #:downward-operation #:upward-operation #:sideway-operation #:selfward-operation 7681 #:downward-operation #:upward-operation #:sideway-operation #:selfward-operation #:non-propagating-operation 7686 7682 #:component-depends-on 7687 7683 #:input-files #:output-files #:output-file #:operation-done-p … … 7690 7686 #:perform #:perform-with-restarts #:retry #:accept 7691 7687 #:traverse-actions #:traverse-sub-actions #:required-components ;; in plan 7692 #:action-path #:find-action #:stamp #:done-p)) 7688 #:action-path #:find-action #:stamp #:done-p 7689 #:operation-definition-warning #:operation-definition-error ;; condition 7690 #:build-op ;; THE generic operation 7691 )) 7693 7692 (in-package :asdf/action) 7694 7693 … … 7786 7785 FIND-COMPONENT in the context of the COMPONENT argument, 7787 7786 and means that the component depends on 7788 <operation> having been performed on each <component>; or 7787 <operation> having been performed on each <component>; 7788 7789 [Note: an <operation> is an operation designator -- it can be either an 7790 operation name or an operation object. Similarly, a <component> may be 7791 a component name or a component object. Also note that, the degenerate 7792 case of (<operation>) is a no-op.] 7793 7794 or 7789 7795 7790 7796 (FEATURE <feature>), which means that the component depends … … 7798 7804 (defmethod component-depends-on :around ((o operation) (c component)) 7799 7805 (do-asdf-cache `(component-depends-on ,o ,c) 7800 (call-next-method))) 7801 7802 (defmethod component-depends-on ((o operation) (c component)) 7803 (cdr (assoc (type-of o) (component-in-order-to c))))) ; User-specified in-order dependencies 7806 (call-next-method)))) 7804 7807 7805 7808 … … 7817 7820 E.g. in order for a MODULE to be loaded with LOAD-OP (resp. compiled with COMPILE-OP), all the 7818 7821 children of the MODULE must have been loaded with LOAD-OP (resp. compiled with COMPILE-OP.")) 7822 (defun downward-operation-depends-on (o c) 7823 `((,(or (downward-operation o) o) ,@(component-children c)))) 7819 7824 (defmethod component-depends-on ((o downward-operation) (c parent-component)) 7820 `( (,(or (downward-operation o) o) ,@(component-children c)) ,@(call-next-method)))7825 `(,@(downward-operation-depends-on o c) ,@(call-next-method))) 7821 7826 7822 7827 (defclass upward-operation (operation) … … 7832 7837 ;; For backward-compatibility reasons, a system inherits from module and is a child-component 7833 7838 ;; so we must guard against this case. ASDF4: remove that. 7839 (defun upward-operation-depends-on (o c) 7840 (if-let (p (component-parent c)) `((,(or (upward-operation o) o) ,p)))) 7834 7841 (defmethod component-depends-on ((o upward-operation) (c child-component)) 7835 `(,@(if-let (p (component-parent c)) 7836 `((,(or (upward-operation o) o) ,p))) ,@(call-next-method))) 7842 `(,@(upward-operation-depends-on o c) ,@(call-next-method))) 7837 7843 7838 7844 (defclass sideway-operation (operation) … … 7846 7852 E.g. in order for a COMPONENT to be prepared for loading or compiling with PREPARE-OP, 7847 7853 each of its declared dependencies must first be loaded as by LOAD-OP.")) 7848 (def method component-depends-on ((o sideway-operation) (c component))7854 (defun sideway-operation-depends-on (o c) 7849 7855 `((,(or (sideway-operation o) o) 7850 7856 ,@(loop :for dep :in (component-sideway-dependencies c) 7851 :collect (resolve-dependency-spec c dep))) 7852 ,@(call-next-method))) 7857 :collect (resolve-dependency-spec c dep))))) 7858 (defmethod component-depends-on ((o sideway-operation) (c component)) 7859 `(,@(sideway-operation-depends-on o c) ,@(call-next-method))) 7853 7860 7854 7861 (defclass selfward-operation (operation) … … 7859 7866 I.e., if O is a SELFWARD-OPERATION, and its SELFWARD-OPERATION designates a list of operations L, 7860 7867 then the action (O . C) of O on component C depends on each (S . C) for S in L. 7868 E.g. before a component may be loaded by LOAD-OP, it must have been compiled by COMPILE-OP. 7861 7869 A operation-designator designates a singleton list of the designated operation; 7862 7870 a list of operation-designators designates the list of designated operations; 7863 NIL is not a valid operation designator in that context. 7864 E.g. before a component may be loaded by LOAD-OP, it must have been compiled by COMPILE-OP.")) 7871 NIL is not a valid operation designator in that context. Note that any dependency 7872 ordering between the operations in a list of SELFWARD-OPERATION should be specified separately 7873 in the respective operation's COMPONENT-DEPENDS-ON methods so that they be scheduled properly.")) 7874 (defun selfward-operation-depends-on (o c) 7875 (loop :for op :in (ensure-list (selfward-operation o)) :collect `(,op ,c))) 7865 7876 (defmethod component-depends-on ((o selfward-operation) (c component)) 7866 `(,@(loop :for op :in (ensure-list (selfward-operation o)) 7867 :collect `(,op ,c)) 7868 ,@(call-next-method)))) 7877 `(,@(selfward-operation-depends-on o c) ,@(call-next-method))) 7878 7879 (defclass non-propagating-operation (operation) 7880 () 7881 (:documentation "A NON-PROPAGATING-OPERATION is an operation that propagates 7882 no dependencies whatsoever. It is supplied in order that the programmer be able 7883 to specify that s/he is intentionally specifying an operation which invokes no 7884 dependencies."))) 7885 7886 7887 ;;;--------------------------------------------------------------------------- 7888 ;;; Help programmers catch obsolete OPERATION subclasses 7889 ;;;--------------------------------------------------------------------------- 7890 (with-upgradability () 7891 (define-condition operation-definition-warning (simple-warning) 7892 () 7893 (:documentation "Warning condition related to definition of obsolete OPERATION objects.")) 7894 7895 (define-condition operation-definition-error (simple-error) 7896 () 7897 (:documentation "Error condition related to definition of incorrect OPERATION objects.")) 7898 7899 (defmethod initialize-instance :before ((o operation) &key) 7900 ;; build-op is a special case. 7901 (unless (typep o '(or downward-operation upward-operation sideway-operation 7902 selfward-operation non-propagating-operation)) 7903 (warn 'operation-definition-warning 7904 :format-control 7905 "No dependency propagating scheme specified for operation class ~S. 7906 The class needs to be updated for ASDF 3.1 and specify appropriate propagation mixins." 7907 :format-arguments (list (type-of o))))) 7908 7909 (defmethod initialize-instance :before ((o non-propagating-operation) &key) 7910 (when (typep o '(or downward-operation upward-operation sideway-operation selfward-operation)) 7911 (error 'operation-definition-error 7912 :format-control 7913 "Inconsistent class: ~S 7914 NON-PROPAGATING-OPERATION is incompatible with propagating operation classes as superclasses." 7915 :format-arguments 7916 (list (type-of o))))) 7917 7918 (defmethod component-depends-on ((o operation) (c component)) 7919 `(;; Normal behavior, to allow user-specified in-order-to dependencies 7920 ,@(cdr (assoc (type-of o) (component-in-order-to c))) 7921 ;; For backward-compatibility with ASDF2, any operation that doesn't specify propagation 7922 ;; or non-propagation through an appropriate mixin will be downward and sideway. 7923 ,@(unless (typep o '(or downward-operation upward-operation sideway-operation 7924 selfward-operation non-propagating-operation)) 7925 `(,@(downward-operation-depends-on o c) 7926 ,@(sideway-operation-depends-on o c))))) 7927 7928 (defmethod downward-operation ((o operation)) nil) 7929 (defmethod sideway-operation ((o operation)) nil)) 7930 7931 7932 ;;;--------------------------------------------------------------------------- 7933 ;;; End of OPERATION class checking 7934 ;;;--------------------------------------------------------------------------- 7869 7935 7870 7936 … … 7880 7946 7881 7947 (defmethod operation-done-p ((o operation) (c component)) 7882 (declare (ignorable o c))7883 7948 t) 7884 7949 … … 7902 7967 t))) 7903 7968 (defmethod output-files ((o operation) (c component)) 7904 (declare (ignorable o c))7905 7969 nil) 7906 7970 (defun output-file (operation component) … … 7916 7980 7917 7981 (defmethod input-files ((o operation) (c component)) 7918 (declare (ignorable o c))7919 7982 nil) 7920 7983 … … 7982 8045 (mark-operation-done o c)) 7983 8046 (defmethod perform ((o operation) (c parent-component)) 7984 (declare (ignorable o c))7985 8047 nil) 7986 8048 (defmethod perform ((o operation) (c source-file)) … … 8013 8075 ;;; Generic build operation 8014 8076 (with-upgradability () 8077 ;; BUILD-OP was intended to be the default "master" operation to invoke on a system in ASDF3 8078 ;; (LOAD-OP typically serves that function now). 8079 ;; This feature has not yet been fully implemented yet, and is not used by anyone yet. 8080 ;; This is a path forward, and its default below is to backward compatibly depend on LOAD-OP. 8081 ;; [2014/01/26:rpg] 8082 (defclass build-op (non-propagating-operation) ()) 8015 8083 (defmethod component-depends-on ((o build-op) (c component)) 8016 8084 `((,(or (component-build-operation c) 'load-op) ,c)))) … … 8019 8087 ;;;; Actions to build Common Lisp software 8020 8088 8021 ( asdf/package:define-package :asdf/lisp-action8089 (uiop/package:define-package :asdf/lisp-action 8022 8090 (:recycle :asdf/lisp-action :asdf) 8023 8091 (:intern #:proclamations #:flags) … … 8056 8124 (with-upgradability () 8057 8125 (defclass prepare-op (upward-operation sideway-operation) 8058 ((sideway-operation :initform 'load-op :allocation :class))) 8059 (defclass load-op (basic-load-op downward-operation sideway-operation selfward-operation) 8126 ((sideway-operation :initform 'load-op :allocation :class)) 8127 (:documentation "Load dependencies necessary for COMPILE-OP or LOAD-OP of a given COMPONENT.")) 8128 (defclass load-op (basic-load-op downward-operation selfward-operation) 8060 8129 ;; NB: even though compile-op depends on prepare-op it is not needed-in-image-p, 8061 8130 ;; so we need to directly depend on prepare-op for its side-effects in the current image. 8062 8131 ((selfward-operation :initform '(prepare-op compile-op) :allocation :class))) 8063 8132 (defclass compile-op (basic-compile-op downward-operation selfward-operation) 8064 ((selfward-operation :initform 'prepare-op :allocation :class) 8065 (downward-operation :initform 'load-op :allocation :class))) 8133 ((selfward-operation :initform 'prepare-op :allocation :class))) 8066 8134 8067 8135 (defclass prepare-source-op (upward-operation sideway-operation) … … 8079 8147 (with-upgradability () 8080 8148 (defmethod action-description ((o prepare-op) (c component)) 8081 (declare (ignorable o))8082 8149 (format nil (compatfmt "~@<loading dependencies of ~3i~_~A~@:>") c)) 8083 8150 (defmethod perform ((o prepare-op) (c component)) 8084 (declare (ignorable o c))8085 nil)8086 (defmethod input-files ((o prepare-op) (c component))8087 (declare (ignorable o c))8088 8151 nil) 8089 8152 (defmethod input-files ((o prepare-op) (s system)) 8090 (declare (ignorable o))8091 8153 (if-let (it (system-source-file s)) (list it)))) 8092 8154 … … 8094 8156 (with-upgradability () 8095 8157 (defmethod action-description ((o compile-op) (c component)) 8096 (declare (ignorable o))8097 8158 (format nil (compatfmt "~@<compiling ~3i~_~A~@:>") c)) 8098 8159 (defmethod action-description ((o compile-op) (c parent-component)) 8099 (declare (ignorable o))8100 8160 (format nil (compatfmt "~@<completing compilation for ~3i~_~A~@:>") c)) 8101 8161 (defgeneric call-with-around-compile-hook (component thunk)) … … 8163 8223 (lisp-compilation-output-files o c)) 8164 8224 (defmethod perform ((o compile-op) (c static-file)) 8165 (declare (ignorable o c))8166 nil)8167 (defmethod output-files ((o compile-op) (c static-file))8168 (declare (ignorable o c))8169 8225 nil) 8170 8226 (defmethod perform ((o compile-op) (c system)) … … 8186 8242 (with-upgradability () 8187 8243 (defmethod action-description ((o load-op) (c cl-source-file)) 8188 (declare (ignorable o))8189 8244 (format nil (compatfmt "~@<loading FASL for ~3i~_~A~@:>") c)) 8190 8245 (defmethod action-description ((o load-op) (c parent-component)) 8191 (declare (ignorable o))8192 8246 (format nil (compatfmt "~@<completing load for ~3i~_~A~@:>") c)) 8193 (defmethod action-description ((o load-op) component) 8194 (declare (ignorable o)) 8195 (format nil (compatfmt "~@<loading ~3i~_~A~@:>") 8196 component)) 8247 (defmethod action-description ((o load-op) (c component)) 8248 (format nil (compatfmt "~@<loading ~3i~_~A~@:>") c)) 8197 8249 (defmethod perform-with-restarts ((o load-op) (c cl-source-file)) 8198 8250 (loop … … 8210 8262 (perform-lisp-load-fasl o c)) 8211 8263 (defmethod perform ((o load-op) (c static-file)) 8212 (declare (ignorable o c))8213 8264 nil)) 8214 8265 … … 8219 8270 (with-upgradability () 8220 8271 (defmethod action-description ((o prepare-source-op) (c component)) 8221 (declare (ignorable o))8222 8272 (format nil (compatfmt "~@<loading source for dependencies of ~3i~_~A~@:>") c)) 8223 (defmethod input-files ((o prepare-source-op) (c component))8224 (declare (ignorable o c))8225 nil)8226 8273 (defmethod input-files ((o prepare-source-op) (s system)) 8227 (declare (ignorable o))8228 8274 (if-let (it (system-source-file s)) (list it))) 8229 8275 (defmethod perform ((o prepare-source-op) (c component)) 8230 (declare (ignorable o c))8231 8276 nil)) 8232 8277 8233 8278 ;;; load-source-op 8234 8279 (with-upgradability () 8235 (defmethod action-description ((o load-source-op) c) 8236 (declare (ignorable o)) 8280 (defmethod action-description ((o load-source-op) (c component)) 8237 8281 (format nil (compatfmt "~@<Loading source of ~3i~_~A~@:>") c)) 8238 8282 (defmethod action-description ((o load-source-op) (c parent-component)) 8239 (declare (ignorable o))8240 8283 (format nil (compatfmt "~@<Loaded source of ~3i~_~A~@:>") c)) 8241 8284 (defun perform-lisp-load-source (o c) … … 8248 8291 (perform-lisp-load-source o c)) 8249 8292 (defmethod perform ((o load-source-op) (c static-file)) 8250 (declare (ignorable o c))8251 nil)8252 (defmethod output-files ((o load-source-op) (c component))8253 (declare (ignorable o c))8254 8293 nil)) 8255 8294 … … 8258 8297 (with-upgradability () 8259 8298 (defmethod perform ((o test-op) (c component)) 8260 (declare (ignorable o c))8261 8299 nil) 8262 8300 (defmethod operation-done-p ((o test-op) (c system)) 8263 8301 "Testing a system is _never_ done." 8264 (declare (ignorable o c))8265 8302 nil)) 8266 8303 … … 8268 8305 ;;;; Plan 8269 8306 8270 ( asdf/package:define-package :asdf/plan8307 (uiop/package:define-package :asdf/plan 8271 8308 (:recycle :asdf/plan :asdf) 8272 8309 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 8335 8372 (format stream "~@{~S~^ ~}" :stamp stamp :done-p done-p :planned-p planned-p :index index)))) 8336 8373 8337 (defmethod action-planned-p (action-status) 8338 (declare (ignorable action-status)) ; default method for non planned-action-status objects 8339 t) 8374 (defmethod action-planned-p ((action-status t)) 8375 t) ; default method for non planned-action-status objects 8340 8376 8341 8377 ;; TODO: eliminate NODE-FOR, use CONS. … … 8348 8384 8349 8385 (defmethod plan-action-status ((plan null) (o operation) (c component)) 8350 (declare (ignorable plan))8351 8386 (multiple-value-bind (stamp done-p) (component-operation-time o c) 8352 8387 (make-instance 'action-status :stamp stamp :done-p done-p))) 8353 8388 8354 8389 (defmethod (setf plan-action-status) (new-status (plan null) (o operation) (c component)) 8355 (declare (ignorable plan))8356 8390 (let ((to (type-of o)) 8357 8391 (times (component-operation-times c))) … … 8374 8408 8375 8409 (defun action-override-p (plan operation component override-accessor) 8376 (declare (ignor able operation))8410 (declare (ignore operation)) 8377 8411 (let* ((override (funcall override-accessor plan))) 8378 8412 (and override … … 8398 8432 (not (action-forced-p plan operation component)))) 8399 8433 8400 (defmethod action-forced-p ((plan null) operation component) 8401 (declare (ignorable plan operation component)) 8434 (defmethod action-forced-p ((plan null) (operation operation) (component component)) 8402 8435 nil) 8403 8436 8404 (defmethod action-forced-not-p ((plan null) operation component) 8405 (declare (ignorable plan operation component)) 8437 (defmethod action-forced-not-p ((plan null) (operation operation) (component component)) 8406 8438 nil)) 8407 8439 … … 8411 8443 (defgeneric action-valid-p (plan operation component) 8412 8444 (:documentation "Is this action valid to include amongst dependencies?")) 8413 (defmethod action-valid-p (plan operation (c component)) 8414 (declare (ignorable plan operation)) 8445 (defmethod action-valid-p ((plan plan-traversal) (o operation) (c component)) 8415 8446 (if-let (it (component-if-feature c)) (featurep it) t)) 8416 (defmethod action-valid-p (plan (o null) c) (declare (ignorable plan o c)) nil) 8417 (defmethod action-valid-p (plan o (c null)) (declare (ignorable plan o c)) nil) 8418 (defmethod action-valid-p ((plan null) operation component) 8419 (declare (ignorable plan operation component)) 8420 (and operation component t))) 8447 (defmethod action-valid-p ((plan t) (o null) (c t)) nil) 8448 (defmethod action-valid-p ((plan t) (o t) (c null)) nil) 8449 (defmethod action-valid-p ((plan null) (o operation) (c component)) t)) 8421 8450 8422 8451 … … 8456 8485 (reduce-direct-dependencies operation component #'acons nil)) 8457 8486 8487 ;; In a distant future, get-file-stamp, component-operation-time and latest-stamp 8488 ;; shall also be parametrized by the plan, or by a second model object, 8489 ;; so they need not refer to the state of the filesystem, 8490 ;; and the stamps could be cryptographic checksums rather than timestamps. 8491 ;; Such a change remarkably would only affect VISIT-DEPENDENCIES and COMPUTE-ACTION-STAMP. 8492 8458 8493 (defun visit-dependencies (plan operation component dependency-stamper &aux stamp) 8459 8494 (map-direct-dependencies … … 8465 8500 8466 8501 (defmethod compute-action-stamp (plan (o operation) (c component) &key just-done) 8467 ;; In a distant future, get-file-stamp and component-operation-time 8468 ;; shall also be parametrized by the plan, or by a second model object. 8502 ;; Given an action, figure out at what time in the past it has been done, 8503 ;; or if it has just been done, return the time that it has. 8504 ;; Returns two values: 8505 ;; 1- the TIMESTAMP of the action if it has already been done and is up to date, 8506 ;; or T is either hasn't been done or is out of date. 8507 ;; 2- the DONE-IN-IMAGE-P boolean flag that is T if the action has already been done 8508 ;; in the current image, or NIL if it hasn't. 8509 ;; Note that if e.g. LOAD-OP only depends on up-to-date files, but 8510 ;; hasn't been done in the current image yet, then it can have a non-T timestamp, 8511 ;; yet a NIL done-in-image-p flag. 8469 8512 (let* ((stamp-lookup #'(lambda (o c) 8470 8513 (if-let (it (plan-action-status plan o c)) (action-stamp it) t))) … … 8567 8610 (defgeneric traverse-action (plan operation component needed-in-image-p)) 8568 8611 8612 ;; TRAVERSE-ACTION, in the context of a given PLAN object that accumulates dependency data, 8613 ;; visits the action defined by its OPERATION and COMPONENT arguments, 8614 ;; and all its transitive dependencies (unless already visited), 8615 ;; in the context of the action being (or not) NEEDED-IN-IMAGE-P, 8616 ;; i.e. needs to be done in the current image vs merely have been done in a previous image. 8617 ;; For actions that are up-to-date, it returns a STAMP identifying the state of the action 8618 ;; (that's timestamp, but it could be a cryptographic digest in some ASDF extension), 8619 ;; or T if the action needs to be done again. 8620 ;; 8621 ;; Note that for an XCVB-like plan with one-image-per-file-outputting-action, 8622 ;; the below method would be insufficient, since it assumes a single image 8623 ;; to traverse each node at most twice; non-niip actions would be traversed only once, 8624 ;; but niip nodes could be traversed once per image, i.e. once plus once per non-niip action. 8625 8569 8626 (defmethod traverse-action (plan operation component needed-in-image-p) 8570 8627 (block nil 8628 ;; ACTION-VALID-P among other things, handles forcing logic, including FORCE-NOT, 8629 ;; and IF-FEATURE filtering. 8571 8630 (unless (action-valid-p plan operation component) (return nil)) 8631 ;; the following hook is needed by POIU, which tracks a full dependency graph, 8632 ;; instead of just a dependency order as in vanilla ASDF 8572 8633 (plan-record-dependency plan operation component) 8573 (let* ((aniip (needed-in-image-p operation component)) 8634 ;; needed in image distinguishes b/w things that must happen in the 8635 ;; current image and those things that simply need to have been done in a previous one. 8636 (let* ((aniip (needed-in-image-p operation component)) ; action-specific needed-in-image 8637 ;; effective niip: meaningful for the action and required by the plan as traversed 8574 8638 (eniip (and aniip needed-in-image-p)) 8639 ;; status: have we traversed that action previously, and if so what was its status? 8575 8640 (status (plan-action-status plan operation component))) 8576 8641 (when (and status (or (action-done-p status) (action-planned-p status) (not eniip))) 8577 ;; Already visited with sufficient need-in-image level: just return the stamp. 8578 (return (action-stamp status))) 8579 (labels ((visit-action (niip) 8580 (visit-dependencies plan operation component 8642 (return (action-stamp status))) ; Already visited with sufficient need-in-image level! 8643 (labels ((visit-action (niip) ; We may visit the action twice, once with niip NIL, then T 8644 (visit-dependencies plan operation component ; recursively traverse dependencies 8581 8645 #'(lambda (o c) (traverse-action plan o c niip))) 8582 (multiple-value-bind (stamp done-p) 8583 (compute-action-stamp plan operation component) 8646 (multiple-value-bind (stamp done-p) ; AFTER dependencies have been traversed, 8647 (compute-action-stamp plan operation component) ; compute action stamp 8584 8648 (let ((add-to-plan-p (or (eql stamp t) (and niip (not done-p))))) 8585 (cond 8586 ((and add-to-plan-p (not niip)) ; ;if we need to do it,8587 (visit-action t)) ; ; then we need to do it in the image!8649 (cond ; it needs be done if it's out of date or needed in image but absent 8650 ((and add-to-plan-p (not niip)) ; if we need to do it, 8651 (visit-action t)) ; then we need to do it *in the (current) image*! 8588 8652 (t 8589 (setf (plan-action-status plan operation component) 8653 (setf (plan-action-status plan operation component) ; update status: 8590 8654 (make-instance 8591 8655 'planned-action-status 8592 :stamp stamp 8593 :done-p (and done-p (not add-to-plan-p)) 8594 :planned-p add-to-plan-p 8595 :index (if status 8596 (action-index status) 8597 (incf (plan-total-action-count plan))))) 8598 (when add-to-plan-p 8599 (incf (plan-planned-action-count plan)) 8600 (unless aniip 8601 (incf (plan-planned-output-action-count plan)))) 8602 stamp)))))) 8656 :stamp stamp ; computed stamp 8657 :done-p (and done-p (not add-to-plan-p)) ; done *and* up-to-date? 8658 :planned-p add-to-plan-p ; included in list of things to be done? 8659 :index (if status ; index of action amongst all nodes in traversal 8660 (action-index status) ;; if already visited, keep index 8661 (incf (plan-total-action-count plan))))) ; else new index 8662 (when add-to-plan-p ; if it needs to be added to the plan, 8663 (incf (plan-planned-action-count plan)) ; count it 8664 (unless aniip ; if it's output-producing, 8665 (incf (plan-planned-output-action-count plan)))) ; count it 8666 stamp)))))) ; return the stamp 8603 8667 (while-visiting-action (plan operation component) ; maintain context, handle circularity. 8604 (visit-action eniip))))))) 8668 (visit-action eniip))))))) ; visit the action 8605 8669 8606 8670 … … 8616 8680 (reverse (plan-actions-r plan))) 8617 8681 8618 (defmethod plan-record-dependency ((plan sequential-plan) 8619 (operation operation) (component component)) 8620 (declare (ignorable plan operation component)) 8682 (defmethod plan-record-dependency ((plan sequential-plan) (o operation) (c component)) 8621 8683 (values)) 8622 8684 … … 8669 8731 8670 8732 ;;;; Incidental traversals 8733 8734 ;;; Making a FILTERED-SEQUENTIAL-PLAN can be used to, e.g., all of the source 8735 ;;; files required by a bundling operation. 8671 8736 (with-upgradability () 8672 8737 (defclass filtered-sequential-plan (sequential-plan) … … 8716 8781 ;;;; Invoking Operations 8717 8782 8718 ( asdf/package:define-package :asdf/operate8783 (uiop/package:define-package :asdf/operate 8719 8784 (:recycle :asdf/operate :asdf) 8720 8785 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 8738 8803 1. It creates an instance of OPERATION-CLASS using any keyword parameters as initargs. 8739 8804 2. It finds the asdf-system specified by SYSTEM (possibly loading it from disk). 8740 3. It then calls TRAVERSEwith the operation and system as arguments8741 8742 The traverse operation is wrapped in WITH-COMPILATION-UNIT and error handling code.8743 If a VERSION argument is supplied, then operate also ensures that the system found 8744 satisfies it using the VERSION-SATISFIES method.8805 3. It then calls MAKE-PLAN with the operation and system as arguments 8806 8807 The operation of making a plan is wrapped in WITH-COMPILATION-UNIT and error 8808 handling code. If a VERSION argument is supplied, then operate also ensures 8809 that the system found satisfies it using the VERSION-SATISFIES method. 8745 8810 8746 8811 Note that dependencies may cause the operation to invoke other operations on the system … … 8768 8833 (on-warnings *compile-file-warnings-behaviour*) 8769 8834 (on-failure *compile-file-failure-behaviour*) &allow-other-keys) 8770 (declare (ignorable operation component))8771 8835 (let* ((systems-being-operated *systems-being-operated*) 8772 8836 (*systems-being-operated* (or systems-being-operated (make-hash-table :test 'equal))) … … 8875 8939 8876 8940 (defmethod perform ((o compile-op) (c require-system)) 8877 (declare (ignorable o c))8878 8941 nil) 8879 8942 8880 8943 (defmethod perform ((o load-op) (s require-system)) 8881 (declare (ignorable o))8882 8944 (let* ((module (or (required-module s) (coerce-name s))) 8883 8945 (*modules-being-required* (cons module *modules-being-required*))) … … 8886 8948 8887 8949 (defmethod resolve-dependency-combination (component (combinator (eql :require)) arguments) 8888 (declare (ignorable component combinator))8889 8950 (unless (length=n-p arguments 1) 8890 8951 (error (compatfmt "~@<Bad dependency ~S for ~S. ~S takes only one argument~@:>") … … 8934 8995 ;;;; asdf-output-translations 8935 8996 8936 ( asdf/package:define-package :asdf/output-translations8997 (uiop/package:define-package :asdf/output-translations 8937 8998 (:recycle :asdf/output-translations :asdf) 8938 8999 (:use :uiop/common-lisp :uiop :asdf/upgrade) … … 9155 9216 :inherit inherit :collect collect)) 9156 9217 (defmethod process-output-translations ((x null) &key inherit collect) 9157 (declare (ignorable x))9158 9218 (inherit-output-translations inherit :collect collect)) 9159 9219 (defmethod process-output-translations ((form cons) &key inherit collect) … … 9247 9307 ;;;; See the Manual and https://bugs.launchpad.net/asdf/+bug/485918 9248 9308 9249 ( asdf/package:define-package :asdf/source-registry9309 (uiop/package:define-package :asdf/source-registry 9250 9310 (:recycle :asdf/source-registry :asdf) 9251 9311 (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/find-system) … … 9480 9540 :inherit inherit :register register)) 9481 9541 (defmethod process-source-registry ((x null) &key inherit register) 9482 (declare (ignorable x))9483 9542 (inherit-source-registry inherit :register register)) 9484 9543 (defmethod process-source-registry ((form cons) &key inherit register) … … 9561 9620 ;;; Internal hacks for backward-compatibility 9562 9621 9563 ( asdf/package:define-package :asdf/backward-internals9622 (uiop/package:define-package :asdf/backward-internals 9564 9623 (:recycle :asdf/backward-internals :asdf) 9565 9624 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 9651 9710 ;;;; Defsystem 9652 9711 9653 ( asdf/package:define-package :asdf/parse-defsystem9712 (uiop/package:define-package :asdf/parse-defsystem 9654 9713 (:recycle :asdf/parse-defsystem :asdf/defsystem :asdf) 9655 9714 (:nicknames :asdf/defsystem) ;; previous name, to be compatible with, in case anyone cares … … 9793 9852 ;; list ends 9794 9853 &allow-other-keys) options 9795 (declare (ignor able perform explain output-files operation-done-p builtin-system-p))9854 (declare (ignore perform explain output-files operation-done-p builtin-system-p)) 9796 9855 (check-component-input type name weakly-depends-on depends-on components) 9797 9856 (when (and parent … … 9892 9951 ;;;; ASDF-Bundle 9893 9952 9894 ( asdf/package:define-package :asdf/bundle9953 (uiop/package:define-package :asdf/bundle 9895 9954 (:recycle :asdf/bundle :asdf) 9896 9955 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 9942 10001 (defclass no-ld-flags-op (operation) ()) 9943 10002 9944 (defclass lib-op (bundle-compile-op no-ld-flags-op )10003 (defclass lib-op (bundle-compile-op no-ld-flags-op non-propagating-operation) 9945 10004 ((bundle-type :initform #+(or ecl mkcl) :lib #-(or ecl mkcl) :no-output-file)) 9946 10005 (:documentation #+(or ecl mkcl) "compile the system and produce linkable (.a) library for it." 9947 10006 #-(or ecl mkcl) "just compile the system")) 9948 10007 9949 (defclass dll-op (bundle-compile-op no-ld-flags-op )10008 (defclass dll-op (bundle-compile-op no-ld-flags-op non-propagating-operation) 9950 10009 ((bundle-type :initform :dll)) 9951 10010 (:documentation "compile the system and produce dynamic (.so/.dll) library for it.")) … … 9955 10014 (:documentation "produce fasl and asd files for the system")) 9956 10015 9957 (defclass monolithic-op (operation) ()) ;; operation on a system and its dependencies 10016 (defclass monolithic-op (operation) () 10017 (:documentation "A MONOLITHIC operation operates on a system *and all of its 10018 dependencies*. So, for example, a monolithic concatenate operation will 10019 concatenate together a system's components and all of its dependencies, but a 10020 simple concatenate operation will concatenate only the components of the system 10021 itself.")) ;; operation on a system and its dependencies 9958 10022 9959 10023 (defclass monolithic-bundle-op (monolithic-op bundle-op) … … 9963 10027 (defclass monolithic-bundle-compile-op (monolithic-bundle-op bundle-compile-op) 9964 10028 () 9965 (:documentation "Abstract operation for ways to bundle the outputs of compiling *Lisp* files over all systems")) 10029 (:documentation "Abstract operation for ways to bundle the outputs of compiling 10030 *Lisp* files over a system, and all of its dependencies.")) 9966 10031 9967 10032 (defclass monolithic-binary-op (monolithic-op binary-op) … … 9969 10034 (:documentation "produce fasl and asd files for combined system and dependencies.")) 9970 10035 9971 (defclass monolithic-fasl-op (monolithic-bundle-compile-op basic-fasl-op ) ()10036 (defclass monolithic-fasl-op (monolithic-bundle-compile-op basic-fasl-op non-propagating-operation) () 9972 10037 (:documentation "Create a single fasl for the system and its dependencies.")) 9973 10038 9974 (defclass monolithic-lib-op (monolithic-bundle-compile-op basic-compile-opno-ld-flags-op)10039 (defclass monolithic-lib-op (monolithic-bundle-compile-op non-propagating-operation no-ld-flags-op) 9975 10040 ((bundle-type :initform #+(or ecl mkcl) :lib #-(or ecl mkcl) :no-output-file)) 9976 10041 (:documentation #+(or ecl mkcl) "Create a single linkable library for the system and its dependencies." 9977 10042 #-(or ecl mkcl) "Compile a system and its dependencies.")) 9978 10043 9979 (defclass monolithic-dll-op (monolithic-bundle-compile-op sideway-operation selfward-operation no-ld-flags-op)10044 (defclass monolithic-dll-op (monolithic-bundle-compile-op non-propagating-operation no-ld-flags-op) 9980 10045 ((bundle-type :initform :dll)) 9981 10046 (:documentation "Create a single dynamic (.so/.dll) library for the system and its dependencies.")) 9982 10047 9983 (defclass program-op #+(or mkcl ecl) (monolithic-bundle-compile-op) 10048 ;; Fare reports that the PROGRAM-OP doesn't need any propagation on MKCL or 10049 ;; ECL because the necessary dependency wrangling is done by other, earlier 10050 ;; operations. [2014/01/20:rpg] 10051 (defclass program-op #+(or mkcl ecl) (monolithic-bundle-compile-op non-propagating-operation) 9984 10052 #-(or mkcl ecl) (monolithic-bundle-op selfward-operation) 9985 10053 ((bundle-type :initform :program) 9986 #-(or mkcl ecl) (selfward-operation :initform #-(or mkcl ecl)'load-op))10054 #-(or mkcl ecl) (selfward-operation :initform 'load-op)) 9987 10055 (:documentation "create an executable file from the system and its dependencies")) 9988 10056 … … 10045 10113 &key (name-suffix nil name-suffix-p) 10046 10114 &allow-other-keys) 10047 (declare (ignor able initargs name-suffix))10115 (declare (ignore initargs name-suffix)) 10048 10116 (unless name-suffix-p 10049 10117 (setf (slot-value instance 'name-suffix) … … 10066 10134 10067 10135 (defmethod bundle-op-build-args :around ((o no-ld-flags-op)) 10068 (declare (ignorable o))10069 10136 (let ((args (call-next-method))) 10070 10137 (remf args :ld-flags) … … 10111 10178 10112 10179 (defmethod component-depends-on :around ((o bundle-op) (c component)) 10113 (declare (ignorable o c))10114 10180 (if-let (op (and (eq (type-of o) 'bundle-op) (component-build-operation c))) 10115 10181 `((,op ,c)) … … 10173 10239 (with-upgradability () 10174 10240 (defmethod component-depends-on ((o load-fasl-op) (c system)) 10175 (declare (ignorable o))10176 10241 `((,o ,@(loop :for dep :in (component-sideway-dependencies c) 10177 10242 :collect (resolve-dependency-spec c dep))) … … 10182 10247 (when (user-system-p c) 10183 10248 (output-files (find-operation o 'fasl-op) c))) 10184 10185 (defmethod perform ((o load-fasl-op) c)10186 (declare (ignorable o c))10187 nil)10188 10249 10189 10250 (defmethod perform ((o load-fasl-op) (c system)) … … 10204 10265 (every #'(lambda (c) (typep c 'compiled-file)) (component-children s))) 10205 10266 10206 (defmethod output-files (o (c compiled-file)) 10207 (declare (ignorable o c)) 10208 nil) 10209 (defmethod input-files (o (c compiled-file)) 10210 (declare (ignorable o)) 10267 (defmethod input-files ((o operation) (c compiled-file)) 10211 10268 (component-pathname c)) 10212 10269 (defmethod perform ((o load-op) (c compiled-file)) … … 10217 10274 (perform (find-operation o 'load-op) c)) 10218 10275 (defmethod perform ((o operation) (c compiled-file)) 10219 (declare (ignorable o c))10220 10276 nil)) 10221 10277 … … 10225 10281 (with-upgradability () 10226 10282 (defmethod trivial-system-p ((s prebuilt-system)) 10227 (declare (ignorable s))10228 10283 t) 10229 10284 10230 10285 (defmethod perform ((o lib-op) (c prebuilt-system)) 10231 (declare (ignorable o c))10232 10286 nil) 10233 10287 10234 10288 (defmethod component-depends-on ((o lib-op) (c prebuilt-system)) 10235 (declare (ignorable o c))10236 10289 nil) 10237 10290 10238 10291 (defmethod component-depends-on ((o monolithic-lib-op) (c prebuilt-system)) 10239 (declare (ignorable o))10240 10292 nil)) 10241 10293 … … 10310 10362 10311 10363 (defmethod input-files ((o load-op) (s precompiled-system)) 10312 (declare (ignorable o))10313 10364 (bundle-output-files (find-operation o 'fasl-op) s)) 10314 10365 … … 10317 10368 10318 10369 (defmethod component-depends-on ((o load-fasl-op) (s precompiled-system)) 10319 (declare (ignorable o))10320 10370 `((load-op ,s) ,@(call-next-method)))) 10321 10371 … … 10381 10431 (declare (ignore force verbose version)) 10382 10432 (apply #'operate 'binary-op system args))) 10433 10434 #+(and (not asdf-use-unsafe-mac-bundle-op) 10435 (or (and ecl darwin) 10436 (and abcl darwin (not abcl-bundle-op-supported)))) 10437 (defmethod perform :before ((o basic-fasl-op) (c component)) 10438 (unless (featurep :asdf-use-unsafe-mac-bundle-op) 10439 (cerror "Continue after modifying *FEATURES*." 10440 "BASIC-FASL-OP bundle operations are not supported on Mac OS X for this lisp.~%~T~ 10441 To continue, push :asdf-use-unsafe-mac-bundle-op onto *FEATURES*.~%~T~ 10442 Please report to ASDF-DEVEL if this works for you."))) 10383 10443 ;;;; ------------------------------------------------------------------------- 10384 10444 ;;;; Concatenate-source 10385 10445 10386 ( asdf/package:define-package :asdf/concatenate-source10446 (uiop/package:define-package :asdf/concatenate-source 10387 10447 (:recycle :asdf/concatenate-source :asdf) 10388 10448 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 10411 10471 (defclass basic-load-compiled-concatenated-source-op (basic-load-op selfward-operation) ()) 10412 10472 10413 (defclass concatenate-source-op (basic-concatenate-source-op ) ())10473 (defclass concatenate-source-op (basic-concatenate-source-op non-propagating-operation) ()) 10414 10474 (defclass load-concatenated-source-op (basic-load-concatenated-source-op) 10415 10475 ((selfward-operation :initform '(prepare-op concatenate-source-op) :allocation :class))) … … 10419 10479 ((selfward-operation :initform '(prepare-op compile-concatenated-source-op) :allocation :class))) 10420 10480 10421 (defclass monolithic-concatenate-source-op (basic-concatenate-source-op monolithic-bundle-op ) ())10481 (defclass monolithic-concatenate-source-op (basic-concatenate-source-op monolithic-bundle-op non-propagating-operation) ()) 10422 10482 (defclass monolithic-load-concatenated-source-op (basic-load-concatenated-source-op) 10423 10483 ((selfward-operation :initform 'monolithic-concatenate-source-op :allocation :class))) … … 10473 10533 ;;; Backward-compatible interfaces 10474 10534 10475 ( asdf/package:define-package :asdf/backward-interface10535 (uiop/package:define-package :asdf/backward-interface 10476 10536 (:recycle :asdf/backward-interface :asdf) 10477 10537 (:use :uiop/common-lisp :uiop :asdf/upgrade … … 10515 10575 (defgeneric (setf operation-on-failure) (x operation)) 10516 10576 (defmethod operation-on-warnings ((o operation)) 10517 (declare (ignorable o))*compile-file-warnings-behaviour*)10577 *compile-file-warnings-behaviour*) 10518 10578 (defmethod operation-on-failure ((o operation)) 10519 (declare (ignorable o))*compile-file-failure-behaviour*)10579 *compile-file-failure-behaviour*) 10520 10580 (defmethod (setf operation-on-warnings) (x (o operation)) 10521 ( declare (ignorable o)) (setf *compile-file-warnings-behaviour* x))10581 (setf *compile-file-warnings-behaviour* x)) 10522 10582 (defmethod (setf operation-on-failure) (x (o operation)) 10523 ( declare (ignorable o)) (setf *compile-file-failure-behaviour* x))10583 (setf *compile-file-failure-behaviour* x)) 10524 10584 10525 10585 (defun system-definition-pathname (x) … … 10591 10651 10592 10652 (defmethod operate :before (operation-class system &rest args &key &allow-other-keys) 10593 (declare (ignor able operation-class system args))10653 (declare (ignore operation-class system args)) 10594 10654 (when (find-symbol* '#:output-files-for-system-and-operation :asdf nil) 10595 10655 (error "ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS, which you are using. … … 10772 10832 ;;;; Handle ASDF package upgrade, including implementation-dependent magic. 10773 10833 10774 ( asdf/package:define-package :asdf/interface10834 (uiop/package:define-package :asdf/interface 10775 10835 (:nicknames :asdf :asdf-utilities) 10776 10836 (:recycle :asdf/interface :asdf) … … 10797 10857 #:operation #:make-operation #:find-operation 10798 10858 #:upward-operation #:downward-operation #:sideway-operation #:selfward-operation 10859 #:non-propagating-operation 10799 10860 #:build-system #:build-op 10800 10861 #:load-op #:prepare-op #:compile-op … … 10891 10952 #:duplicate-names #:non-toplevel-system #:non-system-system 10892 10953 #:package-system-missing-package-error 10954 #:operation-definition-warning #:operation-definition-error 10893 10955 10894 10956 #:try-recompiling … … 10937 10999 ;;;; ASDF-USER, where the action happens. 10938 11000 10939 ( asdf/package:define-package :asdf/user11001 (uiop/package:define-package :asdf/user 10940 11002 (:nicknames :asdf-user) 10941 (:use :asdf/common-lisp :asdf/package :asdf/interface)) 11003 ;; TODO: it would be nice to have :UIOP in the list, 11004 ;; but we need test compatibility with cl-test-grid first. 11005 (:use :uiop/common-lisp :uiop/package :asdf/interface)) 10942 11006 ;;;; ----------------------------------------------------------------------- 10943 11007 ;;;; ASDF Footer: last words and cleanup 10944 11008 10945 ( asdf/package:define-package :asdf/footer11009 (uiop/package:define-package :asdf/footer 10946 11010 (:recycle :asdf/footer :asdf) 10947 11011 (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/operate :asdf/bundle))
Note: See TracChangeset
for help on using the changeset viewer.