Changeset 14854
- Timestamp:
- 09/02/16 21:43:55 (7 years ago)
- Location:
- trunk/abcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/doc/asdf/asdf.texinfo
r14850 r14854 37 37 @url{https://common-lisp.net/project/asdf/asdf.html}. 38 38 39 ASDF Copyright @copyright{} 2001-201 5Daniel Barlow and contributors.40 41 This manual Copyright @copyright{} 2001-201 5Daniel Barlow and contributors.42 43 This manual revised @copyright{} 2009-201 5Robert P. Goldman and Francois-Rene Rideau.39 ASDF Copyright @copyright{} 2001-2016 Daniel Barlow and contributors. 40 41 This manual Copyright @copyright{} 2001-2016 Daniel Barlow and contributors. 42 43 This manual revised @copyright{} 2009-2016 Robert P. Goldman and Francois-Rene Rideau. 44 44 45 45 Permission is hereby granted, free of charge, to any person obtaining … … 66 66 @titlepage 67 67 @title ASDF: Another System Definition Facility 68 @subtitle Manual for Version 3.1.7 68 @subtitle Manual for Version 3.1.7.8 69 69 @c The following two commands start the copyright page. 70 70 @page … … 83 83 @top ASDF: Another System Definition Facility 84 84 @ifnottex 85 Manual for Version 3.1. 6.1485 Manual for Version 3.1.7.1 86 86 @end ifnottex 87 87 … … 257 257 * How do I work with readtables?:: 258 258 * How can I capture ASDF's output?:: 259 * LOAD-PATHNAME has a weird value:: 259 260 260 261 ASDF development FAQs … … 679 680 @c should not be burdened with it. [2014/02/27:rpg] 680 681 682 Novices may skip this section. 683 @c ``Experts may read it then proceed to ...'' 684 @c some better section explaining 685 @c *central-registry* vs source-registry vs *system-definition-search-functions*, 686 @c and .../asdf/tools/cl-source-registry-cache.lisp 681 687 682 688 The old way to configure ASDF to find your systems is by … … 703 709 For example, let's say you want ASDF to find the @file{.asd} file 704 710 @file{/home/me/src/foo/foo.asd}. 705 In your lisp initialization file, you could have the following:711 In your Lisp initialization file, you could have the following: 706 712 707 713 @lisp … … 727 733 A @dfn{system directory designator} is a form 728 734 which will be evaluated whenever a system is to be found, 729 and must evaluate to a directory to look in (or @code{ NIL}).735 and must evaluate to a directory to look in (or @code{nil}). 730 736 By ``directory'', we mean 731 737 ``designator for a pathname with a non-empty DIRECTORY component''. … … 1442 1448 dependency-def := simple-component-name 1443 1449 | ( :feature @var{feature-expression} dependency-def ) 1450 # (@pxref{The defsystem grammar,,Feature dependencies}) 1444 1451 | ( :version simple-component-name version-specifier ) 1445 1452 | ( :require module-name ) … … 1459 1466 method-form := (operation-name qual lambda-list @Arest{} body) 1460 1467 qual := method qualifier? 1461 1462 component-dep-fail-option := :fail | :try-next | :ignore1463 1468 1464 1469 feature-expression := keyword … … 1685 1690 @xref{if-feature-option}. 1686 1691 1692 @subsection Feature dependencies 1693 @cindex :feature dependencies 1694 1695 A feature dependency is of the form 1696 @code{(:feature @var{feature-expression} @var{dependency})} 1697 If the @var{feature-expression} is satisfied by the running lisp at the 1698 time the system definition is parsed, then the @var{dependency} will be 1699 added to the system's dependencies. If the @var{feature-expression} is 1700 @emph{not} satisfied, then the feature dependency form is ignored. 1701 1702 Note that this means that @code{:feature} @strong{cannot} be used to 1703 enforce a feature dependency for the system in question. I.e., it 1704 cannot be used to require that a feature hold in order for the system 1705 definition to be loaded. E.g., one cannot use @code{(:feature :sbcl)} 1706 to require that a system only be used on SBCL. 1707 1708 Feature dependencies are not to be confused with the obsolete 1709 feature requirement (@pxref{The defsystem grammar,,feature requirement}), or 1710 with @code{if-feature}. 1687 1711 1688 1712 @subsection Using logical pathnames … … 1844 1868 @xref{required-features, Required features}. 1845 1869 1846 @subsection if-component-dep-fails option1847 @cindex :if-component-dep-fails component option1848 This option was removed in ASDF 3.1849 Its semantics was limited in purpose and dubious to explain,1850 and its implementation was breaking a hole into the ASDF object model.1851 Please use the @code{if-feature} option instead.1852 1853 1870 @subsection feature requirement 1854 1871 This requirement was removed in ASDF 3.1. Please do not use it. In … … 2005 2022 ASDF is designed in an object-oriented way from the ground up. 2006 2023 Both a system's structure and the operations that can be performed on systems 2007 follow a extensible protocol, allowing programmers to add new behaviours to ASDF.2024 follow an extensible protocol, allowing programmers to add new behaviours to ASDF. 2008 2025 For example, @code{cffi} adds support for special FFI description files 2009 2026 that interface with C libraries and for wrapper files that embed C code in Lisp. … … 2700 2717 @enumerate 2701 2718 @item 2702 @var{foundp} will be @code{ T},2703 @item 2704 @var{found-system} will be @code{ NIL},2719 @var{foundp} will be @code{t}, 2720 @item 2721 @var{found-system} will be @code{nil}, 2705 2722 @item 2706 2723 @var{pathname} will be @code{#p"/current/path/to/foo.asd"}, … … 4546 4563 We recommend that you avoid using unprotected @code{:encoding} specifications 4547 4564 until after ASDF 2.21 or later becomes widespread. 4548 As of May 201 5, all maintained implementations provide ASDF 3,4565 As of May 2016, all maintained implementations provide ASDF 3.1, 4549 4566 so you may prudently start using this and other features without such protection. 4550 4567 … … 4754 4771 4755 4772 The below functions are not exported by ASDF itself, but by UIOP, available since ASDF 3. 4756 Some of them have precursors in ASDF 2, but we recommend 4757 you rely on ASDF 3 for active developments.4773 Some of them have precursors in ASDF 2, but we recommend that for active developments, 4774 you should rely on the package UIOP as included in ASDF 3. 4758 4775 UIOP provides many, many more utility functions, and we recommend 4759 you read its READMEand sources for more information.4776 you read its @file{README.md} and sources for more information. 4760 4777 4761 4778 4762 4779 @defun parse-unix-namestring name @Akey{} type defaults dot-dot ensure-directory @AallowOtherKeys 4763 Coerce NAME into a PATHNAMEusing standard Unix syntax.4780 Coerce @var{name} into a @var{pathname} using standard Unix syntax. 4764 4781 4765 4782 Unix syntax is used whether or not the underlying system is Unix; … … 4950 4967 See the documentation for @code{uiop:access-at}. 4951 4968 4952 @item If the object is @code{:forms}, the content is captured as a list of S-expressions,4969 @item If the object is @code{:forms}, the content is captured as a list of s-expressions, 4953 4970 as read by the Lisp reader. 4954 4971 If the @var{count} argument is provided, … … 5519 5536 5520 5537 @item 5521 Now that all implementations provide ASDF 3 or later (since May 2015),5538 Now that all implementations provide ASDF 3.1 or later (since May 2016), 5522 5539 the simple solution is just to use code as below in your setup, 5523 5540 and when it fails, upgrade your implementation or replace its ASDF. … … 5784 5801 * How do I work with readtables?:: 5785 5802 * How can I capture ASDF's output?:: 5803 * LOAD-PATHNAME has a weird value:: 5786 5804 @end menu 5787 5805 … … 6063 6081 Use from the @code{named-readtables} system the macro @code{named-readtables:defreadtable}. 6064 6082 6065 @node How can I capture ASDF's output?, 6083 @node How can I capture ASDF's output?, LOAD-PATHNAME has a weird value, How do I work with readtables?, Issues with using and extending ASDF to define systems 6066 6084 @subsection How can I capture ASDF's output? 6067 6085 … … 6074 6092 @code{asdf:operate} should redirect all output from ASDF operations. 6075 6093 6076 6094 @node LOAD-PATHNAME has a weird value, , How can I capture ASDF's output?, Issues with using and extending ASDF to define systems 6095 @subsection *LOAD-PATHNAME* and *LOAD-TRUENAME* have weird values, help! 6096 @vindex *LOAD-PATHNAME* 6097 @vindex *LOAD-TRUENAME* 6098 6099 Conventional Common Lisp code may use @code{*LOAD-TRUENAME*} or @code{*LOAD-PATHNAME*} to find 6100 files adjacent to source files. This will generally @emph{not} work in 6101 ASDF-loaded systems. Recall that ASDF relocates the FASL files it 6102 builds, typically to a special cache directory. Thus the value of 6103 @code{*LOAD-PATHNAME*} and @code{*LOAD-TRUENAME*} at load time, when ASDF is loading your system, 6104 will typically be a pathname in that cache directory, and useless to you 6105 for finding other system components. 6106 6107 There are two ways to work around this problem: 6108 @enumerate 6109 @findex system-relative-pathname 6110 @item 6111 Use the @code{system-relative-pathname} function. This can readily be 6112 used from outside the system, but it is probably not good software 6113 engineering to require a source file @emph{of} a system to know what 6114 system it is going to be part of. Contained objects should not have to 6115 know their containers. 6116 @item 6117 Store the pathname at compile time, so that you get the pathname of the 6118 source file, which is presumably what you want. To do this, you can 6119 capture the value of @code{(or *compile-file-pathname* *load-truename*)} 6120 (or @code{*LOAD-PATHNAME*}, if you prefer) 6121 in a macro expansion or other compile-time evaluated context. 6122 6123 @end enumerate 6077 6124 6078 6125 @node ASDF development FAQs, , Issues with using and extending ASDF to define systems, FAQ -
trunk/abcl/src/org/armedbear/lisp/asdf.lisp
r14850 r14854 1 1 ;;; -*- mode: Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; buffer-read-only: t; -*- 2 ;;; This is ASDF 3.1.7 : Another System Definition Facility.2 ;;; This is ASDF 3.1.7.8: Another System Definition Facility. 3 3 ;;; 4 4 ;;; Feedback, bug reports, and patches are all welcome: … … 20 20 ;;; Monday; July 13, 2009) 21 21 ;;; 22 ;;; Copyright (c) 2001-201 5Daniel Barlow and contributors22 ;;; Copyright (c) 2001-2016 Daniel Barlow and contributors 23 23 ;;; 24 24 ;;; Permission is hereby granted, free of charge, to any person obtaining … … 916 916 sequence))) 917 917 918 #+lispworks 919 (eval-when (:load-toplevel :compile-toplevel :execute) 920 ;; lispworks 3 and earlier cannot be checked for so we always assume 921 ;; at least version 4 922 (unless (member :lispworks4 *features*) 923 (pushnew :lispworks5+ *features*) 924 (unless (member :lispworks5 *features*) 925 (pushnew :lispworks6+ *features*) 926 (unless (member :lispworks6 *features*) 927 (pushnew :lispworks7+ *features*))))) 928 918 929 #.(or #+mcl ;; the #$ doesn't work on other lisps, even protected by #+mcl, so we use this trick 919 930 (read-from-string … … 2033 2044 #:ensure-pathname ;; implemented in filesystem.lisp to accommodate for existence constraints 2034 2045 ;; Wildcard pathnames 2035 #:*wild* #:*wild-file* #:*wild-directory* #:*wild-inferiors* #:*wild-path* #:wilden 2046 #:*wild* #:*wild-file* #:*wild-file-for-directory* #:*wild-directory* 2047 #:*wild-inferiors* #:*wild-path* #:wilden 2036 2048 ;; Translate a pathname 2037 2049 #:relativize-directory-component #:relativize-pathname-directory … … 2610 2622 (make-pathname :directory nil :name *wild* :type *wild* 2611 2623 :version (or #-(or allegro abcl xcl) *wild*)) 2612 "A pathname object with wildcards for matching any file in a given directory") 2624 "A pathname object with wildcards for matching any file with TRANSLATE-PATHNAME") 2625 (defparameter *wild-file-for-directory* 2626 (make-pathname :directory nil :name *wild* :type (or #-(or clisp gcl) *wild*) 2627 :version (or #-(or allegro abcl clisp gcl xcl) *wild*)) 2628 "A pathname object with wildcards for matching any file with DIRECTORY") 2613 2629 (defparameter *wild-directory* 2614 2630 (make-pathname :directory `(:relative ,*wild-directory-component*) … … 2905 2921 2906 2922 (defun filter-logical-directory-results (directory entries merger) 2907 "Given ENTRIES in a DIRECTORY, remove if the directory is logical 2908 the entries which are physical yet when transformed by MERGER have a different TRUENAME. 2909 This function is used as a helper to DIRECTORY-FILES to avoid invalid entries when using logical-pathnames." 2910 (remove-duplicates ;; on CLISP, querying ~/ will return duplicates 2911 (if (logical-pathname-p directory) 2923 "If DIRECTORY isn't a logical pathname, return ENTRIES. If it is, 2924 given ENTRIES in the DIRECTORY, remove the entries which are physical yet 2925 when transformed by MERGER have a different TRUENAME. 2926 Also remove duplicates as may appear with some translation rules. 2927 This function is used as a helper to DIRECTORY-FILES to avoid invalid entries 2928 when using logical-pathnames." 2929 (if (logical-pathname-p directory) 2930 (remove-duplicates ;; on CLISP, querying ~/ will return duplicates 2912 2931 ;; Try hard to not resolve logical-pathname into physical pathnames; 2913 2932 ;; otherwise logical-pathname users/lovers will be disappointed. … … 2923 2942 ;; but isn't quite in CLISP, for it doesn't have :version :newest 2924 2943 (and u (equal (truename* u) (truename* f)) u))) 2925 :when p :collect p) 2926 entries) 2927 :test 'pathname-equal)) 2928 2929 2930 (defun directory-files (directory &optional (pattern *wild-file*)) 2944 :when p :collect p) 2945 :test 'pathname-equal) 2946 entries)) 2947 2948 (defun directory-files (directory &optional (pattern *wild-file-for-directory*)) 2931 2949 "Return a list of the files in a directory according to the PATTERN. 2932 2950 Subdirectories should NOT be returned. … … 2946 2964 (setf pattern (make-pathname-logical pattern (pathname-host dir)))) 2947 2965 (let* ((pat (merge-pathnames* pattern dir)) 2948 (entries (append (ignore-errors (directory* pat)) 2949 #+(or clisp gcl) 2950 (when (equal :wild (pathname-type pattern)) 2951 (ignore-errors (directory* (make-pathname :type nil :defaults pat))))))) 2966 (entries (ignore-errors (directory* pat)))) 2952 2967 (remove-if 'directory-pathname-p 2953 2968 (filter-logical-directory-results … … 2984 2999 #+genera (getf (cdr x) :directory) 2985 3000 #+lispworks (lw:file-directory-p x) 2986 :when d :collect #+(or abcl allegro xcl) d3001 :when d :collect #+(or abcl allegro xcl) (ensure-directory-pathname d) 2987 3002 #+genera (ensure-directory-pathname (first x)) 2988 3003 #+(or cmucl lispworks sbcl scl) x))) … … 3323 3338 "Rename a file, overwriting any previous file with the TARGET name, 3324 3339 in an atomic way if the implementation allows." 3325 #+clisp ;; in recent enough versions of CLISP, :if-exists :overwrite would make it atomic 3326 (progn (funcall 'require "syscalls") 3327 (symbol-call :posix :copy-file source target :method :rename)) 3328 #+(and sbcl os-windows) (delete-file-if-exists target) ;; not atomic 3329 #-clisp 3330 (rename-file source target 3331 #+(or clasp clozure ecl) :if-exists #+clozure :rename-and-delete #+(or clasp ecl) t)) 3340 (let ((source (ensure-pathname source :namestring :lisp :ensure-physical t :want-file t)) 3341 (target (ensure-pathname target :namestring :lisp :ensure-physical t :want-file t))) 3342 #+clisp ;; in recent enough versions of CLISP, :if-exists :overwrite would make it atomic 3343 (progn (funcall 'require "syscalls") 3344 (symbol-call :posix :copy-file source target :method :rename)) 3345 #+(and sbcl os-windows) (delete-file-if-exists target) ;; not atomic 3346 #-clisp 3347 (rename-file source target 3348 #+(or clasp clozure ecl) :if-exists 3349 #+clozure :rename-and-delete #+(or clasp ecl) t))) 3332 3350 3333 3351 (defun delete-empty-directory (directory-pathname) … … 3969 3987 3970 3988 The temporary file's pathname will be based on concatenating 3971 PREFIX ( defaults to \"uiop\"), a random alphanumeric string,3989 PREFIX (or \"tmp\" if it's NIL), a random alphanumeric string, 3972 3990 and optional SUFFIX (defaults to \"-tmp\" if a type was provided) 3973 3991 and TYPE (defaults to \"tmp\", using a dot as separator if not NIL), … … 3991 4009 :with prefix-pn = (ensure-absolute-pathname 3992 4010 (or prefix "tmp") 3993 (or (ensure-pathname directory :namestring :native :ensure-directory t) 4011 (or (ensure-pathname 4012 directory 4013 :namestring :native 4014 :ensure-directory t 4015 :ensure-physical t) 3994 4016 #'temporary-directory)) 3995 4017 :with prefix-nns = (native-namestring prefix-pn) … … 4091 4113 A new empty file with said temporary pathname is created, to ensure there is no 4092 4114 clash with any concurrent process attempting the same thing." 4093 (let* ((px (ensure-pathname x ))4115 (let* ((px (ensure-pathname x :ensure-physical t)) 4094 4116 (prefix (if-let (n (pathname-name px)) (strcat n "-tmp") "tmp")) 4095 (directory ( translate-logical-pathname (pathname-directory-pathname px))))4117 (directory (pathname-directory-pathname px))) 4096 4118 (get-temporary-file :directory directory :prefix prefix :type (pathname-type px)))) 4097 4119 … … 4121 4143 #:command-line-arguments #:raw-command-line-arguments #:setup-command-line-arguments #:argv0 4122 4144 #:*lisp-interaction* 4123 #:*fatal-conditions* #:fatal-condition-p #:handle-fatal-condition 4145 #:fatal-condition #:fatal-condition-p 4146 #:handle-fatal-condition 4124 4147 #:call-with-fatal-condition-handler #:with-fatal-condition-handler 4125 4148 #:*image-restore-hook* #:*image-prelude* #:*image-entry-point* … … 4163 4186 "Functions to call (in order) when before an image is dumped") 4164 4187 4165 (defvar *fatal-conditions* '(error) 4166 "conditions that cause the Lisp image to enter the debugger if interactive, 4167 or to die if not interactive")) 4168 4188 (deftype fatal-condition () 4189 `(and serious-condition #+clozure (not ccl:process-reset)))) 4169 4190 4170 4191 ;;; Exiting properly or im- … … 4283 4304 4284 4305 (defun fatal-condition-p (condition) 4285 "Is the CONDITION fatal? It is if it matches any in *FATAL-CONDITIONS*"4286 ( match-any-condition-p condition *fatal-conditions*))4306 "Is the CONDITION fatal?" 4307 (typep condition 'fatal-condition)) 4287 4308 4288 4309 (defun handle-fatal-condition (condition) … … 4299 4320 (defun call-with-fatal-condition-handler (thunk) 4300 4321 "Call THUNK in a context where fatal conditions are appropriately handled" 4301 (handler-bind (( (satisfies fatal-condition-p)#'handle-fatal-condition))4322 (handler-bind ((fatal-condition #'handle-fatal-condition)) 4302 4323 (funcall thunk))) 4303 4324 … … 4937 4958 #+os-windows 4938 4959 (string 4939 #+mkcl (list "cmd" "/c" command)4940 4960 ;; NB: We do NOT add cmd /c here. You might want to. 4941 4961 #+(or allegro clisp) command … … 4944 4964 ;; so that bug 858 is fixed http://trac.clozure.com/ccl/ticket/858 4945 4965 #+clozure (cons "cmd" (strcat "/c " command)) 4966 #+mkcl (list "cmd" "/c" command) 4946 4967 #+sbcl (list (%cmd-shell-pathname) "/c" command) 4947 4968 ;; NB: On other Windows implementations, this is utterly bogus … … 4959 4980 or whether it's already taken care of by the implementation's underlying run-program." 4960 4981 (not (typep specifier '(or null string pathname (member :interactive :output) 4961 #+(or cmu (and sbcl os-unix) scl) (or stream (eql t))4982 #+(or cmucl (and sbcl os-unix) scl) (or stream (eql t)) 4962 4983 #+lispworks file-stream)))) ;; not a type!? comm:socket-stream 4963 4984 … … 4975 4996 #+allegro nil 4976 4997 #+clisp :terminal 4977 #+(or cl asp clozure cmuecl mkcl sbcl scl) t)4978 #+(or allegro cl asp clozure cmuecl lispworks mkcl sbcl scl)4998 #+(or clozure cmucl ecl mkcl sbcl scl) t) 4999 #+(or allegro clozure cmucl ecl lispworks mkcl sbcl scl) 4979 5000 ((eql :output) 4980 5001 (if (eq role :error-output) 4981 5002 :output 4982 5003 (error "Wrong specifier ~S for role ~S" specifier role))))) 5004 5005 (defun %normalize-if-exists (action) 5006 (ecase action 5007 (:supersede #+clisp :overwrite #-clisp action) 5008 ((:append :error) action))) 4983 5009 4984 5010 (defun %interactivep (input output error-output) … … 4992 5018 (t -1))) 4993 5019 5020 (defclass process-info () 5021 ((process :initform nil) 5022 (input-stream :initform nil) 5023 (output-stream :initform nil) 5024 (bidir-stream :initform nil) 5025 (error-output-stream :initform nil) 5026 (exit-code :initform nil))) 5027 4994 5028 (defun %run-program (command 4995 5029 &rest keys 4996 5030 &key input (if-input-does-not-exist :error) 4997 output (if-output-exists : overwrite)4998 error-output (if-error-output-exists : overwrite)5031 output (if-output-exists :supersede) 5032 error-output (if-error-output-exists :supersede) 4999 5033 directory wait 5000 5034 #+allegro separate-streams … … 5004 5038 INPUT, OUTPUT and ERROR-OUTPUT specify a portable IO specifer, 5005 5039 to be normalized by %NORMALIZE-IO-SPECIFIER. 5006 It returns a process-info plist with possible keys: 5007 PROCESS, EXIT-CODE, INPUT-STREAM, OUTPUT-STREAM, BIDIR-STREAM, ERROR-STREAM." 5040 It returns a process-info object." 5008 5041 ;; NB: these implementations have Unix vs Windows set at compile-time. 5009 5042 (declare (ignorable directory if-input-does-not-exist if-output-exists if-error-output-exists)) 5043 #-(or cmucl ecl mkcl sbcl) 5010 5044 (assert (not (and wait (member :stream (list input output error-output))))) 5011 #-(or allegro cl asp clisp clozure cmuecl (and lispworks os-unix) mkcl sbcl scl)5045 #-(or allegro clisp clozure cmucl ecl (and lispworks os-unix) mkcl sbcl scl) 5012 5046 (progn command keys directory 5013 5047 (error "run-program not available")) 5014 #+(or allegro cl asp clisp clozure cmuecl (and lispworks os-unix) mkcl sbcl scl)5048 #+(or allegro clisp clozure cmucl ecl (and lispworks os-unix) mkcl sbcl scl) 5015 5049 (let* ((%command (%normalize-command command)) 5050 (%if-output-exists (%normalize-if-exists if-output-exists)) 5016 5051 (%input (%normalize-io-specifier input :input)) 5017 5052 (%output (%normalize-io-specifier output :output)) … … 5027 5062 (assert (eq %error-output :terminal))) 5028 5063 #-(or allegro mkcl sbcl) (with-current-directory (directory)) 5029 #+(or allegro cl asp clisp ecl lispworks mkcl) (multiple-value-list)5064 #+(or allegro clisp ecl lispworks mkcl) (multiple-value-list) 5030 5065 (apply 5031 5066 #+allegro 'excl:run-shell-command … … 5039 5074 (apply 'ext:run-program (car %command) :arguments (cdr %command) keys)))) 5040 5075 #+clozure 'ccl:run-program 5041 #+(or cmu ecl scl) 'ext:run-program5076 #+(or cmucl ecl scl) 'ext:run-program 5042 5077 #+lispworks 'system:run-shell-command 5043 5078 #+lispworks (cons "/usr/bin/env" %command) ; LW wants a full path … … 5045 5080 #+sbcl 'sb-ext:run-program 5046 5081 (append 5047 #+(or clozure cmu ecl mkcl sbcl scl) `(,(car %command) ,(cdr %command))5082 #+(or clozure cmucl ecl mkcl sbcl scl) `(,(car %command) ,(cdr %command)) 5048 5083 `(:input ,%input :output ,%output :wait ,wait :allow-other-keys t) 5049 5084 #-clisp `(#+(or allegro lispworks) :error-output #-(or allegro lispworks) :error 5050 5085 ,%error-output) 5051 5086 #+(and allegro os-windows) `(:show-window ,(if interactive nil :hide)) 5052 #+(or clozure cmu ecl lispworks mkcl sbcl scl) 5087 #+clisp `(:if-output-exists ,%if-output-exists) 5088 #+(or allegro clozure cmucl ecl lispworks mkcl sbcl scl) 5053 5089 `(:if-input-does-not-exist ,if-input-does-not-exist 5054 :if-output-exists ,if-output-exists 5055 #-lispworks :if-error-exists #+lispworks :if-error-output-exists 5090 :if-output-exists ,%if-output-exists 5091 #-(or allegro lispworks) :if-error-exists 5092 #+(or allegro lispworks) :if-error-output-exists 5056 5093 ,if-error-output-exists) 5057 5094 #+lispworks `(:save-exit-status t) 5058 #+sbcl `(:search t5059 :if-output-does-not-exist :create5060 :if-error-does-not-exist :create)5061 5095 #+mkcl `(:directory ,(native-namestring directory)) 5096 #+sbcl `(:search t) 5062 5097 #-sbcl keys 5063 5098 #+sbcl (if directory keys (remove-plist-key :directory keys)))))) 5064 (process-info-r ())) 5065 (flet ((prop (key value) (push key process-info-r) (push value process-info-r))) 5099 (process-info (make-instance 'process-info))) 5100 (flet ((prop (key value) 5101 (setf (slot-value process-info key) value))) 5066 5102 #+allegro 5067 5103 (cond 5068 (wait (prop :exit-code (first process*)))5104 (wait (prop 'exit-code (first process*))) 5069 5105 (separate-streams 5070 5106 (destructuring-bind (in out err pid) process* 5071 (prop :process pid)5072 (when (eq input :stream) (prop :input-stream in))5073 (when (eq output :stream) (prop :output-stream out))5074 (when (eq error-output :stream) (prop :error-stream err))))5107 (prop 'process pid) 5108 (when (eq input :stream) (prop 'input-stream in)) 5109 (when (eq output :stream) (prop 'output-stream out)) 5110 (when (eq error-output :stream) (prop 'error-stream err)))) 5075 5111 (t 5076 (prop :process (third process*))5112 (prop 'process (third process*)) 5077 5113 (let ((x (first process*))) 5078 5114 (ecase (+ (if (eq input :stream) 1 0) (if (eq output :stream) 2 0)) 5079 5115 (0) 5080 (1 (prop :input-stream x))5081 (2 (prop :output-stream x))5082 (3 (prop :bidir-stream x))))5116 (1 (prop 'input-stream x)) 5117 (2 (prop 'output-stream x)) 5118 (3 (prop 'bidir-stream x)))) 5083 5119 (when (eq error-output :stream) 5084 (prop :error-stream (second process*)))))5120 (prop 'error-stream (second process*))))) 5085 5121 #+clisp 5086 5122 (cond 5087 (wait (prop :exit-code (clisp-exit-code (first process*))))5123 (wait (prop 'exit-code (clisp-exit-code (first process*)))) 5088 5124 (t 5089 5125 (ecase (+ (if (eq input :stream) 1 0) (if (eq output :stream) 2 0)) 5090 5126 (0) 5091 (1 (prop :input-stream (first process*)))5092 (2 (prop :output-stream (first process*)))5093 (3 (prop :bidir-stream (pop process*))5094 (prop :input-stream (pop process*))5095 (prop :output-stream (pop process*))))))5096 #+(or clozure cmu sbcl scl)5127 (1 (prop 'input-stream (first process*))) 5128 (2 (prop 'output-stream (first process*))) 5129 (3 (prop 'bidir-stream (pop process*)) 5130 (prop 'input-stream (pop process*)) 5131 (prop 'output-stream (pop process*)))))) 5132 #+(or clozure cmucl sbcl scl) 5097 5133 (progn 5098 (prop :process process*)5134 (prop 'process process*) 5099 5135 (when (eq input :stream) 5100 (prop :input-stream5136 (prop 'input-stream 5101 5137 #+clozure (ccl:external-process-input-stream process*) 5102 #+(or cmu scl) (ext:process-input process*)5138 #+(or cmucl scl) (ext:process-input process*) 5103 5139 #+sbcl (sb-ext:process-input process*))) 5104 5140 (when (eq output :stream) 5105 (prop :output-stream5141 (prop 'output-stream 5106 5142 #+clozure (ccl:external-process-output-stream process*) 5107 #+(or cmu scl) (ext:process-output process*)5143 #+(or cmucl scl) (ext:process-output process*) 5108 5144 #+sbcl (sb-ext:process-output process*))) 5109 5145 (when (eq error-output :stream) 5110 (prop :error-output-stream5146 (prop 'error-output-stream 5111 5147 #+clozure (ccl:external-process-error-stream process*) 5112 #+(or cmu scl) (ext:process-error process*)5148 #+(or cmucl scl) (ext:process-error process*) 5113 5149 #+sbcl (sb-ext:process-error process*)))) 5114 #+(or claspecl mkcl)5115 (destructuring-bind #+ (or clasp ecl)(stream code process) #+mkcl (stream process code) process*5150 #+(or ecl mkcl) 5151 (destructuring-bind #+ecl (stream code process) #+mkcl (stream process code) process* 5116 5152 (let ((mode (+ (if (eq input :stream) 1 0) (if (eq output :stream) 2 0)))) 5117 5153 (cond 5118 5154 ((zerop mode)) 5119 ((null process*) (prop :exit-code -1))5120 (t (prop (case mode (1 :input-stream) (2 :output-stream) (3 :bidir-stream)) stream))))5121 (when code (prop :exit-code code))5122 (when process (prop :process process)))5155 ((null process*) (prop 'exit-code -1)) 5156 (t (prop (case mode (1 'input-stream) (2 'output-stream) (3 'bidir-stream)) stream)))) 5157 (when code (prop 'exit-code code)) 5158 (when process (prop 'process process))) 5123 5159 #+lispworks 5124 5160 (if wait 5125 (prop :exit-code (first process*))5161 (prop 'exit-code (or (second process*) (first process*))) 5126 5162 (let ((mode (+ (if (eq input :stream) 1 0) (if (eq output :stream) 2 0)))) 5127 (if (zerop mode) 5128 (prop :process (first process*)) 5129 (destructuring-bind (x err pid) process* 5130 (prop :process pid) 5131 (prop (ecase mode (1 :input-stream) (2 :output-stream) (3 :bidir-stream)) x) 5132 (when (eq error-output :stream) (prop :error-stream err)))))) 5133 (nreverse process-info-r)))) 5163 (if (or (plusp mode) (eq error-output :stream)) 5164 (destructuring-bind (io err pid) process* 5165 #+lispworks7+ (declare (ignore pid)) 5166 (prop 'process #+lispworks7+ io #-lispworks7+ pid) 5167 (when (plusp mode) 5168 (prop (ecase mode 5169 (1 'input-stream) 5170 (2 'output-stream) 5171 (3 'bidir-stream)) io)) 5172 (when (eq error-output :stream) 5173 (prop 'error-stream err))) 5174 ;; lispworks6 returns (pid), lispworks7 returns (io,err,pid). 5175 (prop 'process (first process*))))) 5176 process-info))) 5134 5177 5135 5178 (defun %process-info-pid (process-info) 5136 (let ((process ( getf process-info :process)))5179 (let ((process (slot-value process-info 'process))) 5137 5180 (declare (ignorable process)) 5138 #+(or allegro lispworks) process 5139 #+clozure (ccl::external-process-pid process) 5140 #+(or clasp ecl) (si:external-process-pid process) 5141 #+(or cmu scl) (ext:process-pid process) 5181 #+allegro process 5182 #+clozure (ccl:external-process-id process) 5183 #+ecl (ext:external-process-pid process) 5184 #+(or cmucl scl) (ext:process-pid process) 5185 #+lispworks7+ (sys:pipe-pid process) 5186 #+(and lispworks (not lispworks7+)) process 5142 5187 #+mkcl (mkcl:process-id process) 5143 5188 #+sbcl (sb-ext:process-pid process) 5144 #-(or allegro cmu mkcl sbcl scl) (error "~S not implemented" '%process-info-pid))) 5189 #-(or allegro clozure cmucl ecl mkcl lispworks sbcl scl) 5190 (error "~S not implemented" '%process-info-pid))) 5145 5191 5146 5192 (defun %wait-process-result (process-info) 5147 (or (getf process-info :exit-code) 5148 (let ((process (getf process-info :process))) 5193 (or (slot-value process-info 'exit-code) 5194 (let ((process (slot-value process-info 'process))) 5195 #-(or allegro clozure cmucl ecl lispworks mkcl sbcl scl) 5196 (error "~S not implemented" '%wait-process) 5149 5197 (when process 5150 5198 ;; 1- wait 5151 5199 #+clozure (ccl::external-process-wait process) 5152 #+(or cmu scl) (ext:process-wait process)5200 #+(or cmucl scl) (ext:process-wait process) 5153 5201 #+sbcl (sb-ext:process-wait process) 5154 5202 ;; 2- extract result 5155 #+allegro (sys:reap-os-subprocess :pid process :wait t) 5156 #+clozure (nth-value 1 (ccl:external-process-status process)) 5157 #+(or cmu scl) (ext:process-exit-code process) 5158 #+(or clasp ecl) (nth-value 1 (ext:external-process-wait process t)) 5159 #+lispworks 5160 (if-let ((stream (or (getf process-info :input-stream) 5161 (getf process-info :output-stream) 5162 (getf process-info :bidir-stream) 5163 (getf process-info :error-stream)))) 5164 (system:pipe-exit-status stream :wait t) 5165 (if-let ((f (find-symbol* :pid-exit-status :system nil))) 5166 (funcall f process :wait t))) 5167 #+sbcl (sb-ext:process-exit-code process) 5168 #+mkcl (mkcl:join-process process))))) 5203 (let ((exit-code 5204 #+allegro (multiple-value-bind (exit-code pid signal) 5205 (sys:reap-os-subprocess :pid process :wait t) 5206 (assert pid) 5207 (or signal exit-code)) 5208 #+clozure (nth-value 1 (ccl:external-process-status process)) 5209 #+(or cmucl scl) (ext:process-exit-code process) 5210 #+ecl (nth-value 1 (ext:external-process-wait process t)) 5211 #+lispworks 5212 ;; a signal is only returned on LispWorks 7+ 5213 (multiple-value-bind (exit-code signal) 5214 (funcall #+lispworks7+ #'sys:pipe-exit-status 5215 #-lispworks7+ #'sys:pid-exit-status 5216 process :wait t) 5217 (or signal exit-code)) 5218 #+mkcl (mkcl:join-process process) 5219 #+sbcl (sb-ext:process-exit-code process))) 5220 (setf (slot-value process-info 'exit-code) exit-code) 5221 exit-code))))) 5169 5222 5170 5223 (defun %check-result (exit-code &key command process ignore-error-status) … … 5224 5277 ((or null string pathname (eql :interactive)) 5225 5278 (easy-case)) 5226 #+(or cmu (and sbcl os-unix) scl) ;; streams are only easy on implementations that try very hard5279 #+(or cmucl (and sbcl os-unix) scl) ;; streams are only easy on implementations that try very hard 5227 5280 (stream 5228 5281 (if stream-easy-p (easy-case) (hard-case))) … … 5297 5350 keys))) 5298 5351 (labels ((get-stream (stream-name &optional fallbackp) 5299 (or ( getfprocess-info stream-name)5352 (or (slot-value process-info stream-name) 5300 5353 (when fallbackp 5301 ( getf process-info :bidir-stream))))5354 (slot-value process-info 'bidir-stream)))) 5302 5355 (run-activity (activity stream-name &optional fallbackp) 5303 5356 (if-let (stream (get-stream stream-name fallbackp)) … … 5309 5362 (ecase activity 5310 5363 ((nil)) 5311 (:input (run-activity input-activity :input-stream t)) 5312 (:output (run-activity output-activity :output-stream t)) 5313 (:error-output (run-activity error-output-activity :error-output-stream))) 5314 (loop :for (() val) :on process-info :by #'cddr 5315 :when (streamp val) :do (ignore-errors (close val))) 5364 (:input (run-activity input-activity 'input-stream t)) 5365 (:output (run-activity output-activity 'output-stream t)) 5366 (:error-output (run-activity error-output-activity 'error-output-stream))) 5367 (dolist (stream 5368 (cons (slot-value process-info 'error-output-stream) 5369 (if-let (bidir-stream (slot-value process-info 'bidir-stream)) 5370 (list bidir-stream) 5371 (list (slot-value process-info 'input-stream) 5372 (slot-value process-info 'output-stream))))) 5373 (when stream (close stream))) 5316 5374 (setf exit-code 5317 5375 (%check-result (%wait-process-result process-info) … … 5368 5426 "A portable abstraction of a low-level call to libc's system()." 5369 5427 (declare (ignorable input output error-output directory keys)) 5370 #+(or allegro clozure cmu (and lispworks os-unix) sbcl scl)5428 #+(or allegro clozure cmucl (and lispworks os-unix) sbcl scl) 5371 5429 (%wait-process-result 5372 5430 (apply '%run-program (%normalize-system-command command) :wait t keys)) … … 5414 5472 &key ignore-error-status (force-shell nil force-shell-suppliedp) 5415 5473 (input nil inputp) (if-input-does-not-exist :error) 5416 output (if-output-exists : overwrite)5417 (error-output nil error-output-p) (if-error-output-exists : overwrite)5474 output (if-output-exists :supersede) 5475 (error-output nil error-output-p) (if-error-output-exists :supersede) 5418 5476 (element-type #-clozure *default-stream-element-type* #+clozure 'character) 5419 5477 (external-format *utf-8-external-format*) … … 5473 5531 or an indication of failure via the EXIT-CODE of the process" 5474 5532 (declare (ignorable ignore-error-status)) 5475 #-(or abcl allegro clasp clisp clozure cmu cormanlisp ecl gcl lispworks mcl mkcl sbcl scl xcl)5533 #-(or abcl allegro clasp clisp clozure cmucl cormanlisp ecl gcl lispworks mcl mkcl sbcl scl xcl) 5476 5534 (error "RUN-PROGRAM not implemented for this Lisp") 5477 5535 ;; per doc string, set FORCE-SHELL to T if we get command as a string. But … … 6168 6226 (or output-file 6169 6227 (apply 'compile-file-pathname* input-file :output-file output-file keywords))) 6228 (physical-output-file (physicalize-pathname output-file)) 6170 6229 #+(or clasp ecl) 6171 6230 (object-file … … 6178 6237 (or object-file 6179 6238 (compile-file-pathname output-file :fasl-p nil))) 6180 (tmp-file (tmpize-pathname output-file))6239 (tmp-file (tmpize-pathname physical-output-file)) 6181 6240 #+sbcl 6182 6241 (cfasl-file (etypecase emit-cfasl 6183 6242 (null nil) 6184 ((eql t) (make-pathname :type "cfasl" :defaults output-file))6243 ((eql t) (make-pathname :type "cfasl" :defaults physical-output-file)) 6185 6244 (string (parse-namestring emit-cfasl)) 6186 6245 (pathname emit-cfasl))) … … 6221 6280 (or (not compile-check) 6222 6281 (apply compile-check input-file 6223 :output-file #-(or clasp ecl) output-file #+(or clasp ecl) tmp-file6282 :output-file output-truename 6224 6283 keywords)))) 6225 (delete-file-if-exists output-file)6284 (delete-file-if-exists physical-output-file) 6226 6285 (when output-truename 6227 6286 #+clasp (when output-truename (rename-file-overwriting-target tmp-file output-truename)) 6228 #+clisp (when lib-file (rename-file-overwriting-target tmp-lib lib-file)) 6287 ;; see CLISP bug 677 6288 #+clisp 6289 (progn 6290 (setf tmp-lib (make-pathname :type "lib" :defaults output-truename)) 6291 (unless lib-file (setf lib-file (make-pathname :type "lib" :defaults physical-output-file))) 6292 (rename-file-overwriting-target tmp-lib lib-file)) 6229 6293 #+sbcl (when cfasl-file (rename-file-overwriting-target tmp-cfasl cfasl-file)) 6230 (rename-file-overwriting-target output-truename output-file)6231 (setf output-truename (truename output-file)))6294 (rename-file-overwriting-target output-truename physical-output-file) 6295 (setf output-truename (truename physical-output-file))) 6232 6296 #+clasp (delete-file-if-exists tmp-file) 6233 #+clisp (delete-file-if-exists tmp-lib)) 6297 #+clisp (progn (delete-file-if-exists tmp-file) ;; this one works around clisp BUG 677 6298 (delete-file-if-exists tmp-lib))) ;; this one is "normal" defensive cleanup 6234 6299 (t ;; error or failed check 6235 6300 (delete-file-if-exists output-truename) … … 6264 6329 (defun combine-fasls (inputs output) 6265 6330 "Combine a list of FASLs INPUTS into a single FASL OUTPUT" 6266 #-(or abcl allegro clisp clozure cmu lispworks sbcl scl xcl)6331 #-(or abcl allegro clisp clozure cmucl lispworks sbcl scl xcl) 6267 6332 (error "~A does not support ~S~%inputs ~S~%output ~S" 6268 6333 (implementation-type) 'combine-fasls inputs output) 6269 6334 #+abcl (funcall 'sys::concatenate-fasls inputs output) ; requires ABCL 1.2.0 6270 #+(or allegro clisp cmu sbcl scl xcl) (concatenate-files inputs output)6335 #+(or allegro clisp cmucl sbcl scl xcl) (concatenate-files inputs output) 6271 6336 #+clozure (ccl:fasl-concatenate output inputs :if-exists :supersede) 6272 6337 #+lispworks … … 6850 6915 ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5 6851 6916 ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67 6852 (asdf-version "3.1.7 ")6917 (asdf-version "3.1.7.8") 6853 6918 (existing-version (asdf-version))) 6854 6919 (setf *asdf-version* asdf-version) … … 9390 9455 ((style-warning #'muffle-warning) 9391 9456 (missing-component (constantly nil)) 9392 ( error#'(lambda (e)9457 (uiop:fatal-condition #'(lambda (e) 9393 9458 (format *error-output* (compatfmt "~@<ASDF could not load ~(~A~) because ~A.~@:>~%") 9394 9459 name e)))) … … 9805 9870 (recurse-beyond-asds *recurse-beyond-asds*) ignore-cache) 9806 9871 (let ((visited (make-hash-table :test 'equalp))) 9807 (collect-sub*directories 9808 directory 9809 #'(lambda (dir) 9810 (unless (and (not ignore-cache) (process-source-registry-cache directory collect)) 9811 (let ((asds (collect-asds-in-directory dir collect))) 9812 (or recurse-beyond-asds (not asds))))) 9813 #'(lambda (x) ; x will be a directory pathname 9814 (and 9815 (not (member (car (last (pathname-directory x))) exclude :test #'equal)) 9816 (flet ((pathname-key (x) 9817 (namestring (truename* x)))) 9818 (let ((visitedp (gethash (pathname-key x) visited))) 9819 (if visitedp nil 9820 (setf (gethash (pathname-key x) visited) t)))))) 9821 (constantly nil)))) 9872 (flet ((collectp (dir) 9873 (unless (and (not ignore-cache) (process-source-registry-cache directory collect)) 9874 (let ((asds (collect-asds-in-directory dir collect))) 9875 (or recurse-beyond-asds (not asds))))) 9876 (recursep (x) ; x will be a directory pathname 9877 (and 9878 (not (member (car (last (pathname-directory x))) exclude :test #'equal)) 9879 (flet ((pathname-key (x) 9880 (namestring (truename* x)))) 9881 (let ((visitedp (gethash (pathname-key x) visited))) 9882 (if visitedp nil 9883 (setf (gethash (pathname-key x) visited) t))))))) 9884 (collect-sub*directories directory #'collectp #'recursep (constantly nil))))) 9822 9885 9823 9886 (defun validate-source-registry-directive (directive)
Note: See TracChangeset
for help on using the changeset viewer.