Commit 7eb17a3a authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

bundle: add workaround to find mkcl's cmp.a

MKCL 1.1.10 (from git) installs bogus .asd files in its contrib/
directory – for instance cmp.asd is present there (and level-up),
and locate-system finds the first, bogus, definition, that
points to a cmp.a library in the wrong directory.

Bug identified by Daniel Kochmański.
parent 12cfcdd7
......@@ -548,10 +548,16 @@ for all the linkable object files associated with the system or its dependencies
(defmethod component-depends-on :around ((o image-op) (c system))
(destructuring-bind ((lib-op . deps)) (call-next-method)
(labels ((has-it-p (x) (find x deps :test 'equal :key 'coerce-name))
(linkable-system (x) (unless (has-it-p x)
(if (system-source-directory x)
`(,(find-system x))
`(,(make-library-system x))))))
(linkable-system (x)
(unless (has-it-p x)
(if (and (system-source-directory x)
#+mkcl ;; avoid bug in mkcl 1.1.10
(let ((s (find-system x)))
(or (not (typep s 'prebuilt-system))
(file-exists-p (prebuilt-system-static-library s)))))
(find-system x)
(make-library-system x))))))
,@(unless (no-uiop c)
(append (linkable-system "cmp")
  • this is wrong, because if the system doesn't exist (i.e MKCL maintainer decides to put asd file in "sys:", not "sys:contrib;") source-source-directory will fail with missing-component signal and the latter code won't get executed. Also find-system is called twice unnecessarily.

    Proper way to do the workaround is to make find-system-if-being-defined use cache (see de814305) and to use:

    (linkable-system (x)
      (unless (has-it-p x)
        (let ((system (and (locate-system x) (find-system x))))
          (if (and system
                   (or (not (typep system 'prebuilt-system))
                       (file-exists-p (prebuilt-system-static-library system))))
              (list system)
              (list (make-library-system x))))))
  • mentioned in merge request !14 (closed)

    Toggle commit list
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