Skip to content
Snippets Groups Projects
Commit c4d6dd60 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Merge branch 'renamed-bundle-op'

parents b54a906a ef0427dc
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
#:bundle-op #:bundle-op-build-args #:bundle-type #:bundle-op #:bundle-op-build-args #:bundle-type
#:bundle-system #:bundle-pathname-type #:bundlable-file-p #:direct-dependency-files #:bundle-system #:bundle-pathname-type #:bundlable-file-p #:direct-dependency-files
#:monolithic-op #:monolithic-bundle-op #:operation-monolithic-p #:monolithic-op #:monolithic-bundle-op #:operation-monolithic-p
#:basic-fasl-op #:prepare-fasl-op #:fasl-op #:load-fasl-op #:monolithic-fasl-op #:fasl-op #:load-fasl-op #:monolithic-fasl-op #:binary-op #:monolithic-binary-op
#:basic-compile-bundle-op #:prepare-bundle-op
#:compile-bundle-op #:load-bundle-op #:monolithic-compile-bundle-op #:monolithic-load-bundle-op
#:lib-op #:monolithic-lib-op #:lib-op #:monolithic-lib-op
#:dll-op #:monolithic-dll-op #:dll-op #:monolithic-dll-op
#:deliver-asd-op #:monolithic-deliver-asd-op #:deliver-asd-op #:monolithic-deliver-asd-op
...@@ -84,46 +86,51 @@ itself.")) ;; operation on a system and its dependencies ...@@ -84,46 +86,51 @@ itself.")) ;; operation on a system and its dependencies
,@(call-next-method)))) ,@(call-next-method))))
;; create a single fasl for the entire library ;; create a single fasl for the entire library
(defclass basic-fasl-op (bundle-op) (defclass basic-compile-bundle-op (bundle-op)
((bundle-type :initform :fasl))) ((bundle-type :initform :fasl)))
(defclass prepare-fasl-op (sideway-operation) (defclass prepare-bundle-op (sideway-operation)
((sideway-operation :initform #+(or ecl mkcl) 'load-fasl-op #-(or ecl mkcl) 'load-op :allocation :class))) ((sideway-operation :initform #+(or ecl mkcl) 'load-bundle-op #-(or ecl mkcl) 'load-op
:allocation :class)))
(defclass lib-op (link-op gather-op non-propagating-operation) (defclass lib-op (link-op gather-op non-propagating-operation)
((bundle-type :initform :lib)) ((bundle-type :initform :lib))
(:documentation "compile the system and produce linkable (.a) library for it.")) (:documentation "compile the system and produce linkable (.a) library for it."))
(defclass fasl-op (basic-fasl-op selfward-operation #+ecl link-op #-ecl gather-op) (defclass compile-bundle-op (basic-compile-bundle-op selfward-operation #+ecl link-op #-ecl gather-op)
((selfward-operation :initform '(prepare-fasl-op #+ecl lib-op) :allocation :class))) ((selfward-operation :initform '(prepare-bundle-op #+ecl lib-op) :allocation :class)))
(defclass load-fasl-op (basic-load-op selfward-operation) (defclass load-bundle-op (basic-load-op selfward-operation)
((selfward-operation :initform '(prepare-fasl-op fasl-op) :allocation :class))) ((selfward-operation :initform '(prepare-bundle-op compile-bundle-op) :allocation :class)))
;; NB: since the monolithic-op's can't be sideway-operation's, ;; NB: since the monolithic-op's can't be sideway-operation's,
;; if we wanted lib-op, dll-op, deliver-asd-op to be sideway-operation's, ;; if we wanted lib-op, dll-op, deliver-asd-op to be sideway-operation's,
;; we'd have to have the monolithic-op not inherit from the main op, ;; we'd have to have the monolithic-op not inherit from the main op,
;; but instead inherit from a basic-FOO-op as with basic-fasl-op above. ;; but instead inherit from a basic-FOO-op as with basic-compile-bundle-op above.
(defclass dll-op (link-op gather-op non-propagating-operation) (defclass dll-op (link-op gather-op non-propagating-operation)
((bundle-type :initform :dll)) ((bundle-type :initform :dll))
(:documentation "compile the system and produce dynamic (.so/.dll) library for it.")) (:documentation "compile the system and produce dynamic (.so/.dll) library for it."))
(defclass deliver-asd-op (basic-compile-op selfward-operation) (defclass deliver-asd-op (basic-compile-op selfward-operation)
((selfward-operation :initform '(fasl-op #+(or ecl mkcl) lib-op) :allocation :class)) ((selfward-operation :initform '(compile-bundle-op #+(or ecl mkcl) lib-op) :allocation :class))
(:documentation "produce an asd file for delivering the system as a single fasl")) (:documentation "produce an asd file for delivering the system as a single fasl"))
(defclass monolithic-deliver-asd-op (monolithic-bundle-op deliver-asd-op) (defclass monolithic-deliver-asd-op (monolithic-bundle-op deliver-asd-op)
((selfward-operation :initform '(monolithic-fasl-op #+(or ecl mkcl) monolithic-lib-op) ((selfward-operation :initform '(monolithic-compile-bundle-op #+(or ecl mkcl) monolithic-lib-op)
:allocation :class)) :allocation :class))
(:documentation "produce fasl and asd files for combined system and dependencies.")) (:documentation "produce fasl and asd files for combined system and dependencies."))
(defclass monolithic-fasl-op (monolithic-bundle-op basic-fasl-op (defclass monolithic-compile-bundle-op (monolithic-bundle-op basic-compile-bundle-op
#+ecl link-op gather-op non-propagating-operation) #+ecl link-op gather-op non-propagating-operation)
((gather-op :initform #+(or ecl mkcl) 'lib-op #-(or ecl mkcl) 'fasl-op :allocation :class)) ((gather-op :initform #+(or ecl mkcl) 'lib-op #-(or ecl mkcl) 'compile-bundle-op :allocation :class))
(:documentation "Create a single fasl for the system and its dependencies.")) (:documentation "Create a single fasl for the system and its dependencies."))
(defclass monolithic-load-bundle-op (monolithic-bundle-op load-bundle-op)
((selfward-operation :initform 'monolithic-compile-bundle-op :allocation :class))
(:documentation "Load a single fasl for the system and its dependencies."))
(defclass monolithic-lib-op (monolithic-bundle-op lib-op non-propagating-operation) () (defclass monolithic-lib-op (monolithic-bundle-op lib-op non-propagating-operation) ()
(:documentation "Create a single linkable library for the system and its dependencies.")) (:documentation "Create a single linkable library for the system and its dependencies."))
...@@ -270,7 +277,7 @@ itself.")) ;; operation on a system and its dependencies ...@@ -270,7 +277,7 @@ itself.")) ;; operation on a system and its dependencies
((:lib :static-library) ((:lib :static-library)
(if monolithic 'monolithic-lib-op 'lib-op)) (if monolithic 'monolithic-lib-op 'lib-op))
((:fasl) ((:fasl)
(if monolithic 'monolithic-fasl-op 'fasl-op)) (if monolithic 'monolithic-compile-bundle-op 'compile-bundle-op))
((:image) ((:image)
'image-op) 'image-op)
((:program) ((:program)
...@@ -302,26 +309,26 @@ itself.")) ;; operation on a system and its dependencies ...@@ -302,26 +309,26 @@ itself.")) ;; operation on a system and its dependencies
files)))) files))))
;;; ;;;
;;; LOAD-FASL-OP ;;; LOAD-BUNDLE-OP
;;; ;;;
;;; This is like ASDF's LOAD-OP, but using monolithic fasl files. ;;; This is like ASDF's LOAD-OP, but using bundle fasl files.
;;; ;;;
(with-upgradability () (with-upgradability ()
(defmethod component-depends-on ((o load-fasl-op) (c system)) (defmethod component-depends-on ((o load-bundle-op) (c system))
`((,o ,@(loop :for dep :in (component-sideway-dependencies c) `((,o ,@(loop :for dep :in (component-sideway-dependencies c)
:collect (resolve-dependency-spec c dep))) :collect (resolve-dependency-spec c dep)))
(,(if (user-system-p c) 'fasl-op 'load-op) ,c) (,(if (user-system-p c) 'compile-bundle-op 'load-op) ,c)
,@(call-next-method))) ,@(call-next-method)))
(defmethod input-files ((o load-fasl-op) (c system)) (defmethod input-files ((o load-bundle-op) (c system))
(when (user-system-p c) (when (user-system-p c)
(output-files (find-operation o 'fasl-op) c))) (output-files (find-operation o 'compile-bundle-op) c)))
(defmethod perform ((o load-fasl-op) (c system)) (defmethod perform ((o load-bundle-op) (c system))
(when (input-files o c) (when (input-files o c)
(perform-lisp-load-fasl o c))) (perform-lisp-load-fasl o c)))
(defmethod mark-operation-done :after ((o load-fasl-op) (c system)) (defmethod mark-operation-done :after ((o load-bundle-op) (c system))
(mark-operation-done (find-operation o 'load-op) c))) (mark-operation-done (find-operation o 'load-op) c)))
;;; ;;;
...@@ -340,8 +347,6 @@ itself.")) ;; operation on a system and its dependencies ...@@ -340,8 +347,6 @@ itself.")) ;; operation on a system and its dependencies
(perform-lisp-load-fasl o c)) (perform-lisp-load-fasl o c))
(defmethod perform ((o load-source-op) (c compiled-file)) (defmethod perform ((o load-source-op) (c compiled-file))
(perform (find-operation o 'load-op) c)) (perform (find-operation o 'load-op) c))
(defmethod perform ((o load-fasl-op) (c compiled-file))
(perform (find-operation o 'load-op) c))
(defmethod perform ((o operation) (c compiled-file)) (defmethod perform ((o operation) (c compiled-file))
nil)) nil))
...@@ -355,7 +360,7 @@ itself.")) ;; operation on a system and its dependencies ...@@ -355,7 +360,7 @@ itself.")) ;; operation on a system and its dependencies
(defmethod perform ((o link-op) (c prebuilt-system)) (defmethod perform ((o link-op) (c prebuilt-system))
nil) nil)
(defmethod perform ((o basic-fasl-op) (c prebuilt-system)) (defmethod perform ((o basic-compile-bundle-op) (c prebuilt-system))
nil) nil)
(defmethod perform ((o lib-op) (c prebuilt-system)) (defmethod perform ((o lib-op) (c prebuilt-system))
...@@ -423,7 +428,7 @@ itself.")) ;; operation on a system and its dependencies ...@@ -423,7 +428,7 @@ itself.")) ;; operation on a system and its dependencies
(terpri s))))) (terpri s)))))
#-(or ecl mkcl) #-(or ecl mkcl)
(defmethod perform ((o basic-fasl-op) (c system)) (defmethod perform ((o basic-compile-bundle-op) (c system))
(let* ((input-files (input-files o c)) (let* ((input-files (input-files o c))
(fasl-files (remove (compile-file-type) input-files :key #'pathname-type :test-not #'equalp)) (fasl-files (remove (compile-file-type) input-files :key #'pathname-type :test-not #'equalp))
(non-fasl-files (remove (compile-file-type) input-files :key #'pathname-type :test #'equalp)) (non-fasl-files (remove (compile-file-type) input-files :key #'pathname-type :test #'equalp))
...@@ -442,12 +447,12 @@ itself.")) ;; operation on a system and its dependencies ...@@ -442,12 +447,12 @@ itself.")) ;; operation on a system and its dependencies
(combine-fasls fasl-files output-file))))) (combine-fasls fasl-files output-file)))))
(defmethod input-files ((o load-op) (s precompiled-system)) (defmethod input-files ((o load-op) (s precompiled-system))
(bundle-output-files (find-operation o 'fasl-op) s)) (bundle-output-files (find-operation o 'compile-bundle-op) s))
(defmethod perform ((o load-op) (s precompiled-system)) (defmethod perform ((o load-op) (s precompiled-system))
(perform-lisp-load-fasl o s)) (perform-lisp-load-fasl o s))
(defmethod component-depends-on ((o load-fasl-op) (s precompiled-system)) (defmethod component-depends-on ((o load-bundle-op) (s precompiled-system))
#+xcl (declare (ignorable o)) #+xcl (declare (ignorable o))
`((load-op ,s) ,@(call-next-method)))) `((load-op ,s) ,@(call-next-method))))
...@@ -486,7 +491,7 @@ itself.")) ;; operation on a system and its dependencies ...@@ -486,7 +491,7 @@ itself.")) ;; operation on a system and its dependencies
;; But it might break systems with missing dependencies, ;; But it might break systems with missing dependencies,
;; and there is a weird bug in test-xach-update-bug.script ;; and there is a weird bug in test-xach-update-bug.script
;;(unless (use-ecl-byte-compiler-p) ;;(unless (use-ecl-byte-compiler-p)
;; (setf *load-system-operation* 'load-fasl-op)) ;; (setf *load-system-operation* 'load-bundle-op))
(defmethod perform ((o link-op) (c system)) (defmethod perform ((o link-op) (c system))
(let* ((object-files (input-files o c)) (let* ((object-files (input-files o c))
...@@ -513,7 +518,7 @@ itself.")) ;; operation on a system and its dependencies ...@@ -513,7 +518,7 @@ itself.")) ;; operation on a system and its dependencies
(apply #'compiler::build-static-library (output-file o s) (apply #'compiler::build-static-library (output-file o s)
:lisp-object-files (input-files o s) (bundle-op-build-args o))) :lisp-object-files (input-files o s) (bundle-op-build-args o)))
(defmethod perform ((o basic-fasl-op) (s system)) (defmethod perform ((o basic-compile-bundle-op) (s system))
(apply #'compiler::build-bundle (output-file o s) (apply #'compiler::build-bundle (output-file o s)
:lisp-object-files (input-files o s) (bundle-op-build-args o))) :lisp-object-files (input-files o s) (bundle-op-build-args o)))
...@@ -534,9 +539,24 @@ itself.")) ;; operation on a system and its dependencies ...@@ -534,9 +539,24 @@ itself.")) ;; operation on a system and its dependencies
#+(and (not asdf-use-unsafe-mac-bundle-op) #+(and (not asdf-use-unsafe-mac-bundle-op)
(or (and ecl darwin) (or (and ecl darwin)
(and abcl darwin (not abcl-bundle-op-supported)))) (and abcl darwin (not abcl-bundle-op-supported))))
(defmethod perform :before ((o basic-fasl-op) (c component)) (defmethod perform :before ((o basic-compile-bundle-op) (c component))
(unless (featurep :asdf-use-unsafe-mac-bundle-op) (unless (featurep :asdf-use-unsafe-mac-bundle-op)
(cerror "Continue after modifying *FEATURES*." (cerror "Continue after modifying *FEATURES*."
"BASIC-FASL-OP bundle operations are not supported on Mac OS X for this lisp.~%~T~ "BASIC-COMPILE-BUNDLE-OP operations are not supported on Mac OS X for this lisp.~%~T~
To continue, push :asdf-use-unsafe-mac-bundle-op onto *FEATURES*.~%~T~ To continue, push :asdf-use-unsafe-mac-bundle-op onto *FEATURES*.~%~T~
Please report to ASDF-DEVEL if this works for you."))) Please report to ASDF-DEVEL if this works for you.")))
;;; Backward compatibility with pre-3.1.1 names
(defclass fasl-op (selfward-operation)
((selfward-operation :initform 'compile-bundle-op :allocation :class)))
(defclass load-fasl-op (selfward-operation)
((selfward-operation :initform 'load-bundle-op :allocation :class)))
(defclass binary-op (selfward-operation)
((selfward-operation :initform 'deliver-asd-op :allocation :class)))
(defclass monolithic-fasl-op (selfward-operation)
((selfward-operation :initform 'monolithic-compile-bundle-op :allocation :class)))
(defclass monolithic-load-fasl-op (selfward-operation)
((selfward-operation :initform 'monolithic-load-bundle-op :allocation :class)))
(defclass monolithic-binary-op (selfward-operation)
((selfward-operation :initform 'monolithic-deliver-asd-op :allocation :class)))
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
#:component-load-dependencies #:run-shell-command ; deprecated, do not use #:component-load-dependencies #:run-shell-command ; deprecated, do not use
#:bundle-op #:monolithic-bundle-op #:precompiled-system #:compiled-file #:bundle-system #:bundle-op #:monolithic-bundle-op #:precompiled-system #:compiled-file #:bundle-system
#+ecl #:make-build #+ecl #:make-build
#:basic-fasl-op #:prepare-fasl-op #:fasl-op #:load-fasl-op #:monolithic-fasl-op #:fasl-op #:load-fasl-op #:monolithic-fasl-op #:binary-op #:monolithic-binary-op
#:basic-compile-bundle-op #:prepare-bundle-op
#:compile-bundle-op #:load-bundle-op #:monolithic-compile-bundle-op #:monolithic-load-bundle-op
#:lib-op #:dll-op #:deliver-asd-op #:program-op #:image-op #:lib-op #:dll-op #:deliver-asd-op #:program-op #:image-op
#:monolithic-lib-op #:monolithic-dll-op #:monolithic-deliver-asd-op #:monolithic-lib-op #:monolithic-dll-op #:monolithic-deliver-asd-op
#:concatenate-source-op #:concatenate-source-op
......
...@@ -29,16 +29,16 @@ ...@@ -29,16 +29,16 @@
(when (version< version-nums "1.2.0") (when (version< version-nums "1.2.0")
(leave-test "Your old ABCL is known to fail this test script, so skipping it." 0))) (leave-test "Your old ABCL is known to fail this test script, so skipping it." 0)))
(defparameter *bundle-1* (output-file 'fasl-op :test-asdf/bundle-1)) (defparameter *bundle-1* (output-file 'compile-bundle-op :test-asdf/bundle-1))
(defparameter *bundle-2* (output-file 'fasl-op :test-asdf/bundle-2)) (defparameter *bundle-2* (output-file 'compile-bundle-op :test-asdf/bundle-2))
(defparameter *mono-bundle-2* (output-file 'monolithic-fasl-op :test-asdf/bundle-2)) (defparameter *mono-bundle-2* (output-file 'monolithic-compile-bundle-op :test-asdf/bundle-2))
(DBG :test-bundle *bundle-1* *bundle-2*) (DBG :test-bundle *bundle-1* *bundle-2*)
(assert-equal (list *bundle-2*) (assert-equal (list *bundle-2*)
(input-files 'load-fasl-op :test-asdf/bundle-2)) (input-files 'load-bundle-op :test-asdf/bundle-2))
(delete-file-if-exists *bundle-1*) (delete-file-if-exists *bundle-1*)
(delete-file-if-exists *bundle-2*) (delete-file-if-exists *bundle-2*)
(delete-file-if-exists *mono-bundle-2*) (delete-file-if-exists *mono-bundle-2*)
(operate 'load-fasl-op :test-asdf/bundle-2) (operate 'load-bundle-op :test-asdf/bundle-2)
(DBG "Check that the bundles were indeed created.") (DBG "Check that the bundles were indeed created.")
(assert (probe-file *bundle-2*)) (assert (probe-file *bundle-2*))
(assert (probe-file *bundle-1*)) (assert (probe-file *bundle-1*))
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
(assert (symbol-value (find-symbol* :*file1* :test-package))) (assert (symbol-value (find-symbol* :*file1* :test-package)))
(assert (symbol-value (find-symbol* :*file3* :test-package))) (assert (symbol-value (find-symbol* :*file3* :test-package)))
(DBG "Now for the mono-fasl") (DBG "Now for the mono-fasl")
(operate 'monolithic-fasl-op :test-asdf/bundle-2) (operate 'monolithic-compile-bundle-op :test-asdf/bundle-2)
(assert (probe-file *mono-bundle-2*)) (assert (probe-file *mono-bundle-2*))
;;; Test dll-op and monolithic-dll-op on ECL and MKCL ;;; Test dll-op and monolithic-dll-op on ECL and MKCL
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
(defparameter *good-classes* (defparameter *good-classes*
'(build-op '(build-op
compile-bundle-op
compile-concatenated-source-op compile-concatenated-source-op
compile-op compile-op
concatenate-source-op concatenate-source-op
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
fasl-op fasl-op
image-op image-op
lib-op lib-op
load-bundle-op
load-compiled-concatenated-source-op load-compiled-concatenated-source-op
load-concatenated-source-op load-concatenated-source-op
load-fasl-op load-fasl-op
...@@ -32,7 +34,7 @@ ...@@ -32,7 +34,7 @@
monolithic-lib-op monolithic-lib-op
monolithic-load-compiled-concatenated-source-op monolithic-load-compiled-concatenated-source-op
monolithic-load-concatenated-source-op monolithic-load-concatenated-source-op
prepare-fasl-op prepare-bundle-op
prepare-op prepare-op
prepare-source-op prepare-source-op
program-op program-op
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
;;; the test-asdf-location-change.fasb is linked and loaded, ;;; the test-asdf-location-change.fasb is linked and loaded,
;;; but that fails to create the :second-version package; ;;; but that fails to create the :second-version package;
;;; loading the same .fasb in another ecl works fine, and defined (second-version:wtf). WTF? ;;; loading the same .fasb in another ecl works fine, and defined (second-version:wtf). WTF?
;;; Test it by replacing load-op below by load-fasl-op, and trace load* and other functions. ;;; Test it by replacing load-op below by load-bundle-op, and trace load* and other functions.
(operate 'load-op foo) (operate 'load-op foo)
(assert (symbol-value (find-symbol* :loaded :second-version))) (assert (symbol-value (find-symbol* :loaded :second-version)))
(assert-equal 42 (symbol-call :second-version :wtf)) (assert-equal 42 (symbol-call :second-version :wtf))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment