Commit cd3992ff authored by Robert Goldman's avatar Robert Goldman
Browse files

Merge branch 'fixes' into 'master'

Fixes

Various fixes.

See merge request !43
parents b63ee5fa bd65bcea
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -144,8 +144,7 @@ by installing the source code, and running:

    (asdf:load-system :uiop) ;; loading uiop is simple
    (map () 'load ;; loading asdf/defsystem is tricky
     (mapcar 'asdf:component-pathname
      (asdf::required-components :asdf/defsystem :keep-component 'asdf:cl-source-file)))
     (asdf:input-files :concatenate-source-op "asdf/defsystem"))

Note that the above can be adapted in a general recipe to get all the files in a system, in order.
To also have the files in systems it transitively depends on, add the `:other-systems t` keyword
+4 −3
Original line number Diff line number Diff line
@@ -359,12 +359,13 @@ using the JUST-DONE flag."))
  (defgeneric compute-action-stamp (plan operation component &key just-done)
    (:documentation "Has this action been successfully done already,
and at what known timestamp has it been done at or will it be done at?
Takes two keywords JUST-DONE and PLAN:
* PLAN is a plan object modelling future effects of actions,
  or NIL to denote what actually happened.
* OPERATION and COMPONENT denote the action.
Takes keyword JUST-DONE:
* JUST-DONE is a boolean that is true if the action was just successfully performed,
  at which point we want compute the actual stamp and warn if files are missing;
  otherwise we are making plans, anticipating the effects of the action.
* PLAN is a plan object modelling future effects of actions,
  or NIL to denote what actually happened.
Returns two values:
* a STAMP saying when it was done or will be done,
  or T if the action involves files that need to be recomputed.
+21 −5
Original line number Diff line number Diff line
@@ -88,9 +88,19 @@ itself."))
  (defmethod component-depends-on ((o gather-operation) (s system))
    (let* ((mono (operation-monolithic-p o))
           (deps
            ;; Required-components only looks at the dependencies of an action, excluding the action
            ;; itself, so it may be safely used by an action recursing on its dependencies (which
            ;; may or may not be an overdesigned API, since in practice we never use it that way).
            ;; Therefore, if we use :goal-operation 'load-op :keep-operation 'load-op, which looks
            ;; cleaner, we will miss the load-op on the requested system itself, which doesn't
            ;; matter for a regular system, but matters, a lot, for a package-inferred-system.
            ;; 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.
            (required-components
             s :other-systems mono :component-type (if mono 'system '(not system))
              :goal-operation 'load-op :keep-operation 'load-op)))
             :goal-operation 'load-op :keep-operation 'basic-compile-op)))
      `((,(or (gather-operation o) (if mono 'lib-op 'compile-op)) ,@deps)
        ,@(call-next-method))))

@@ -120,6 +130,9 @@ On CLASP, ECL, MKCL, these object files _also_ include the contents of Lisp file
themselves. In any case, this operation will produce what you need to further build
a static runtime for your system, or a dynamic library to load in an existing runtime."))

  ;; What works: On ECL (and CLASP?), we link the .a output of lib-op into a .so;
  ;; on MKCL, we link the many .o files from the system directly into the .so;
  ;; on other implementations, we combine (usually concatenate) the .fasl files into one.
  (defclass compile-bundle-op (basic-compile-bundle-op selfward-operation
                               #+(or clasp ecl mkcl) link-op #-(or clasp ecl) gather-operation)
    ((selfward-operation :initform '(prepare-bundle-op #+(or clasp ecl) lib-op)
@@ -476,9 +489,11 @@ or of opaque libraries shipped along the source code."))
           (version (component-version s))
           (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
                 (remove-if-not 'builtin-system-p
                                (required-components s :component-type 'system
                                                       :keep-operation 'load-op))
                                                       :keep-operation 'basic-load-op))
                 (while-collecting (x) ;; resolve the sideway-dependencies of s
                   (map-direct-dependencies
                    t 'load-op s
@@ -488,7 +503,8 @@ or of opaque libraries shipped along the source code."))
           (depends-on (mapcar 'coerce-name dependencies)))
      (when (pathname-equal asd (system-source-file s))
        (cerror "overwrite the asd file"
                "~/asdf-action:format-action/ is going to overwrite the system definition file ~S which is probably not what you want; you probably need to tweak your output translations."
                "~/asdf-action:format-action/ is going to overwrite the system definition file ~S ~
which is probably not what you want; you probably need to tweak your output translations."
                (cons o s) asd))
      (with-open-file (s asd :direction :output :if-exists :supersede
                             :if-does-not-exist :create)
+3 −3
Original line number Diff line number Diff line
@@ -62,9 +62,9 @@ into a single file"))
          :with other-encodings = '()
          :with around-compile = (around-compile-hook s)
          :with other-around-compile = '()
          :for c :in (required-components
                      s :goal-operation 'load-op
                        :keep-operation 'load-op
          :for c :in (required-components  ;; see note about similar call to required-components
                      s :goal-operation 'load-op ;;  in bundle.lisp
                        :keep-operation 'basic-compile-op
                        :other-systems (operation-monolithic-p operation))
          :append
          (when (typep c 'cl-source-file)
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

;; (setf output-translations) between 2.27 and 3.0.3 was using a defsetf macro
;; for the sake of obsolete versions of GCL 2.6. Make sure it doesn't come to haunt us.
#-mkcl ; mkcl 1.1.9 can't fmakunbound a setf function.
(when-upgrading (:version "3.1.2") (fmakunbound '(setf output-translations)))

(with-upgradability ()
@@ -54,7 +55,7 @@ and the order is by decreasing length of namestring of the source pathname.")
                                            (pathname-directory (car x)))))
                                      (if (listp directory) (length directory) 0))))))))
    new-value)
  (defun* ((setf output-translations)) (new-value) (set-output-translations new-value))
  (defun (setf output-translations) (new-value) (set-output-translations new-value))

  (defun output-translations-initialized-p ()
    "Have the output-translations been initialized yet?"
Loading