Commit 822e8afa authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Restore proper use of required-components, with explanation

Undo part of 0e0a851b, that changed the keep-operation in invocations of
required-components from compile-op to load-op. Explain why in a comment of
bundle.lisp: so any compiled file for the component itself be included,
which notably matters when using a package-inferred-system.

This notably fixes test-bundle.script, test-program.script on mkcl and ecl,
and test-concatenate-source.script on ecl.

Also simplify the test-bundle support files and remove some warnings.
parent af7c2b18
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -88,9 +88,17 @@ 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 compile-op as the keep-operation works
            ;; for our needs of gathering all the files we want to include in a bundle.
            (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 'compile-op)))
      `((,(or (gather-operation o) (if mono 'lib-op 'compile-op)) ,@deps)
        ,@(call-next-method))))

+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 'compile-op
                        :other-systems (operation-monolithic-p operation))
          :append
          (when (typep c 'cl-source-file)
+2 −18
Original line number Diff line number Diff line
(defpackage :test-asdf/monodll-1 (:use)) ;; dummy, for package-inferred-system dependencies.

#+ecl
(ffi:clines "
extern int always_7();

int always_7()
{
        return 7;
}
")

#+clasp (leave-test "Not supported by CLASP yet" 0)

#+mkcl
(ffi:clines "
extern MKCL_DLLEXPORT int always_7(void);

int always_7(void)
{
(ffi:clines
 "extern " #+mkcl "MKCL_DLLEXPORT " "int always_7() {
        return 7;
}
")
+3 −18
Original line number Diff line number Diff line
(defpackage :test-asdf/monodll (:use :test-asdf/monodll-1)) ;; dummy, for package-inferred-system dependencies.

#+ecl
(ffi:clines "
extern int always_42();

int always_42()
{
        return 6*always_7();
}
")

#+clasp (leave-test "Not supported by CLASP yet" 0)

#+mkcl
(ffi:clines "
extern MKCL_DLLEXPORT int always_42(void);

int always_42(void)
{
(ffi:clines
 "extern int always_7();"
 "extern " #+mkcl "MKCL_DLLEXPORT " "int always_42() {
        return 6*always_7();
}
")