Subject: Re: ASDF build system sometimes fails to load .asd files properly

From: Guillaume Le Vaillant <[email-masked]>
Date: Fri, 12 Feb 2021 11:25:48 +0100

Pierre Neidhardt <[email-masked]> skribis:

> Yesterday I pushed 3aba721da73fbdc3382cc098c41596d5cfbb29eb
> "gnu: sbcl-quri: Update to 20200209", which fixes the tests for sbcl-quri.
>
> I noted:
>
> --8<---------------cut here---------------start------------->8---
>        ;; Test system must be loaded before, otherwise tests fail with:
>        ;; Component QURI-ASD::QURI-TEST not found, required by #<SYSTEM
>        ;; "quri">.
>        '(#:asd-systems '("quri-test" "quri")))
> --8<---------------cut here---------------end--------------->8---
>
> Our build system should be able to do better, we should not even have to
> specify the asd-systems here.  After all, ASDF is smart enough.
>
> Note that:
>
> - If we don't specify the systems, the tests are still run and
>   succeed(!), it's only the phase that fails with the aforementioned
>   error.
>
> - If we specify the systems in the reverse order, it still fails!
>
> We've got this issue for many SBCL packages.
>
> Any clue?  Guillaume?

Currently we are using the 'asdf:load-asd' function to load system
definitions (see the 'build' function in
'guix/build/asdf-build-system.scm' and the 'compile-systems' function in
'guix/build/lisp-utils.scm').

This function can only load one '.asd' file at a time, which is the
cause of the issue. If we find how ASDF does the "lazy-load" of all the
'.asd' files in a directory tree, and if we use that instead of
'load-asd', I think it would solve the issue and we could get rid of the
'asd-files' parameter in Guix package definitions.