Commit 7bd83836 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Merge branch 'load-system-operation'

parents 271bf1e0 cf448868
......@@ -100,7 +100,7 @@ itself."))
;; Using load-op as the goal operation and basic-compile-op as the keep-operation works
;; for our needs of gathering all the files we want to include in a bundle.
;; Note that we use basic-compile-op rather than compile-op so it will still work on
;; systems when *load-system-operation* is load-bundle-op.
;; systems that would somehow load dependencies with load-bundle-op.
(required-components
s :other-systems mono :component-type component-type :keep-component keep-component
:goal-operation 'load-op :keep-operation 'basic-compile-op)))
......@@ -433,7 +433,7 @@ or of opaque libraries shipped along the source code."))
(dependencies
(if (operation-monolithic-p o)
;; We want only dependencies, and we use basic-load-op rather than load-op so that
;; this will keep working on systems when *load-system-operation* is load-bundle-op
;; this will keep working on systems that load dependencies with load-bundle-op
(remove-if-not 'builtin-system-p
(required-components s :component-type 'system
:keep-operation 'basic-load-op))
......@@ -504,11 +504,6 @@ which is probably not what you want; you probably need to tweak your output tran
#+(or clasp ecl mkcl)
(with-upgradability ()
#+ecl ;; doesn't work on clasp or mkcl (yet?).
(unless (use-ecl-byte-compiler-p)
(setf *load-system-operation* 'load-bundle-op))
(defun system-module-pathname (module)
(let ((name (coerce-name module)))
(some
......
......@@ -105,7 +105,6 @@
#:*compile-file-warnings-behaviour*
#:*compile-file-failure-behaviour*
#:*resolve-symlinks*
#:*load-system-operation*
#:*asdf-verbose* ;; unused. For backward-compatibility only.
#:*verbose-out*
......
......@@ -11,7 +11,7 @@
#:build-op #:make
#:load-system #:load-systems #:load-systems*
#:compile-system #:test-system #:require-system
#:*load-system-operation* #:module-provide-asdf
#:module-provide-asdf
#:component-loaded-p #:already-loaded-systems))
(in-package :asdf/operate)
......@@ -103,45 +103,34 @@ But do NOT depend on it, for this is deprecated behavior."))
;;;; Common operations
(with-upgradability ()
(defvar *load-system-operation* 'load-op
"Operation used by ASDF:LOAD-SYSTEM. By default, ASDF:LOAD-OP.
You may override it with e.g. ASDF:LOAD-BUNDLE-OP from asdf/bundle
or ASDF:LOAD-SOURCE-OP if your fasl loading is somehow broken.
The default operation may change in the future if we implement a
component-directed strategy for how to load or compile systems.")
;; In prepare-op for a system, propagate *load-system-operation* rather than load-op
(when-upgrading ()
(defmethod component-depends-on ((o prepare-op) (s system))
(loop :for (do . dc) :in (call-next-method)
:collect (cons (if (eq do 'load-op) *load-system-operation* do) dc)))
(call-next-method)))
(with-upgradability ()
(defclass build-op (non-propagating-operation) ()
(:documentation "Since ASDF3, BUILD-OP is the recommended 'master' operation,
to operate by default on a system or component, via the function BUILD.
Its meaning is configurable via the :BUILD-OPERATION option of a component.
which typically specifies the name of a specific operation to which to delegate the build,
as a symbol or as a string later read as a symbol (after loading the defsystem-depends-on);
if NIL is specified (the default), BUILD-OP falls back to the *LOAD-SYSTEM-OPERATION*
that will load the system in the current image, and its typically LOAD-OP."))
if NIL is specified (the default), BUILD-OP falls back to LOAD-OP,
that will load the system in the current image."))
(defmethod component-depends-on ((o build-op) (c component))
`((,(or (component-build-operation c) *load-system-operation*) ,c)
`((,(or (component-build-operation c) 'load-op) ,c)
,@(call-next-method)))
(defun make (system &rest keys)
"The recommended way to interact with ASDF3.1 is via (ASDF:MAKE :FOO).
It will build system FOO using the operation BUILD-OP,
the meaning of which is configurable by the system, and
defaults to *LOAD-SYSTEM-OPERATION*, usually LOAD-OP,
to load it in current image."
defaults to LOAD-OP, to load it in current image."
(apply 'operate 'build-op system keys)
t)
(defun load-system (system &rest keys &key force force-not verbose version &allow-other-keys)
"Shorthand for `(operate 'asdf:load-op system)`. See OPERATE for details."
(declare (ignore force force-not verbose version))
(apply 'operate *load-system-operation* system keys)
(apply 'operate 'load-op system keys)
t)
(defun load-systems* (systems &rest keys)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment