Should asdf-build-system/sbcl use load-system instead of compile-system?

DoneSubmitted by Pierre Neidhardt.
Details
3 participants
  • Guillaume Le Vaillant
  • Liliana Marie Prikler
  • Pierre Neidhardt
Owner
unassigned
Severity
normal
P
P
Pierre Neidhardt wrote on 1 Jul 12:16 +0200
(address . bug-guix@gnu.org)(address . glv@posteo.net)
87edz5jfxm.fsf@ambrevar.xyz
While trying to package


I hit a strange issue in which it would fail to compile, while calling
`asdf:load-system' locally worked.

Then I realized that our asdf-build-system/sbcl uses
`asdf:compile-system' instead of `asdf:load-system'.

From the ASDF doc:

Toggle snippet (7 lines)
This will make sure all the files in the system are compiled, but not
necessarily load any of them in the current image; on most systems, it
will _not_ load all compiled files in the current image. This function
exists for symmetry with 'load-system' but is not recommended unless you
are writing build scripts and know what you're doing.

So should we really use it?

By the way this _may_ be related to the issue we've got with loading the
tests of some packages, like sbcl-jonathan:

Toggle snippet (4 lines)
;; Tests fail with: Component JONATHAN-ASD::JONATHAN-TEST not found,
;; required by #<SYSTEM "jonathan">. Why?

Recipe to reproduce:

- cd Cleavir
- guix shell sbcl sbcl-acclimation sbcl-concrete-syntax-tree sbcl-closer-mop -- sbcl
- (asdf:initialize-source-registry `(:source-registry (:tree ,(uiop:getcwd)) :inherit-configuration))
- (asdf:compile-system :cleavir-abstract-interpreter)

Toggle snippet (22 lines)
debugger invoked on a SB-PCL:CLASS-NOT-FOUND-ERROR in thread
#<THREAD "main thread" RUNNING {100B598173}>:
There is no class named CLEAVIR-ABSTRACT-INTERPRETER:STRATEGY.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [TRY-RECOMPILING ] Recompile control and try loading it again
1: [RETRY ] Retry
loading FASL for #<CL-SOURCE-FILE "cleavir-abstract-interpreter" "control">.
2: [ACCEPT ] Continue, treating
loading FASL for #<CL-SOURCE-FILE "cleavir-abstract-interpreter" "control">
as having been successful.
3: Retry ASDF operation.
4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
configuration.
5: Retry ASDF operation.
6: Retry ASDF operation after resetting the
configuration.
7: [ABORT ] Exit debugger, returning to top level.

And then

- (asdf:load-system :cleavir-abstract-interpreter)

works like a charm!

Thoughts?

Pierre
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmK+yZUSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/I3QH/A0cPGfqAbnZBiYtwx8KJ5wStVSlodQZ
rep9sWLtWpLe8+EO/RTQoz2tkV43hKf0zB7Xo8OWO5dagsFG4Q/3UD2k/Duj1NLT
Tvp9GG/6BqBunTzHqNlAp5V+XXoFWU/hWli1XpxrMqS2ITtcn2NR4vary0pFGLHf
pLP8UkS/5LNMGXEjFMuctxRguDFV08tH+nj630GuSj9Tc0CrMvfJV+vHGbOSQyQ1
eYkpJq5IzKYwwL1x+DFLe/yGW5vejESbhDqucFzPr/tIK7UF81GtcDaD61MWBbNX
2sW+mSPIFoYT4yMJ89N+t8nrEzb8oBOz8DLuN5Snhz3GMlkfw+D6PZE=
=SecM
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 1 Jul 13:13 +0200
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 56334@debbugs.gnu.org)
87o7y9yss4.fsf@kitej
Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (29 lines)
> While trying to package
>
> https://github.com/s-expressionists/Cleavir
>
> I hit a strange issue in which it would fail to compile, while calling
> `asdf:load-system' locally worked.
>
> Then I realized that our asdf-build-system/sbcl uses
> `asdf:compile-system' instead of `asdf:load-system'.
>
> From the ASDF doc:
>
> This will make sure all the files in the system are compiled, but not
> necessarily load any of them in the current image; on most systems, it
> will _not_ load all compiled files in the current image. This function
> exists for symmetry with 'load-system' but is not recommended unless you
> are writing build scripts and know what you're doing.
>
>
> So should we really use it?
>
> By the way this _may_ be related to the issue we've got with loading the
> tests of some packages, like sbcl-jonathan:
>
> ;; Tests fail with: Component JONATHAN-ASD::JONATHAN-TEST not found,
> ;; required by #<SYSTEM "jonathan">. Why?
>
> [...]

Hi,

The cl-gamepad package has a similar issue (and a custom build phase
using load-system instead of compile-system as a workaround).

If the doc of ASDF indicates that load-system is the preferred way to
compile systems, we should probably do that, and remove current
workarounds and check if everything is still working.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYr7ayw8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j85gwD8DCcYTON9Xz6HHIJzg7JhBKpfEdkHJfmVWcgp
cP/8aCgA/A8adxjVcoJBJSJ8LCSF8bNvmv9wG0/ZZW3XSUlYl3Na
=f1GX
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 1 Jul 13:45 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
87tu81vyxe.fsf@ambrevar.xyz
Do you have time to try it out?
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmK+3m0SHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/1iUH/jF0ORW9blN0zNehm2WWNNy2sEl9YwTq
UXyBGUb5A/w4cXNjnZj4NKoFh7PaVzse7+r4FgHcL42wll7BqREHdx0ZdPjyI0va
990gjUZZHBn3LvL22G22NemkFoEs3lqX7n3H1r+pIb83tjGOU5eGsV1YpRLxkXbC
2SEGxMGoWob7DZi/6IzgjXWTISDKSqxUiGhT+35diln0jtrhW6scvzOlV5NlF+a3
k6adT4ZfzUpLX6A5KnLD+G0H5jltF2IeQSXAKK/jkWV15ZZdFwVU2TkM1+GmdDRZ
kYmQ0HHDDTa4nK4X44RNAZKdukihgXh5phaGnY24lFE9iObLY/LCVts=
=17B2
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 1 Jul 14:22 +0200
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 56334@debbugs.gnu.org)
87k08xypu9.fsf@kitej
Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (2 lines)
> Do you have time to try it out?

Not right now, as I'm about to take a vacation.

The main change is a one-liner in the 'compile-systems' function in
"guix/build/lisp-utils.scm"; that would be quick.
However recompiling all the Lisp packages and finding which of them
could be simplified thanks to the change would take more time...

So, if you have the time, go for it.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYr7prg8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+iRAD/a9mmOND6PGsR4/DNXQvL1jR4a9J3VRe+I48C
yiXqb1wA/R00iLrPQ/4QIMb8oQiII4CIuB7AaoUmjgLzKI15Ucls
=YOS8
-----END PGP SIGNATURE-----

L
L
Liliana Marie Prikler wrote on 1 Jul 16:30 +0200
(address . glv@posteo.net)
c65487060149d53a70d13cdfb50332b68ac440a6.camel@ist.tugraz.at
Am Freitag, dem 01.07.2022 um 12:16 +0200 schrieb Pierre Neidhardt:
Toggle quote (14 lines)
> [...]
>
> From the ASDF doc:
>
> --8<---------------cut here---------------start------------->8---
> This will make sure all the files in the system are compiled, but not
> necessarily load any of them in the current image; on most systems,
> it will _not_ load all compiled files in the current image.  This
> function exists for symmetry with 'load-system' but is not
> recommended *unless you are writing build scripts* and know what
> you're doing.
> --8<---------------cut here---------------end--------------->8---
>
> So should we really use it?
In this case, I'd argue that we *are* the build script and that
packagers know what they're doing when they override build in case that
asdf:compile-system fails. Unless I'm wrong, we're not actually
interested in loading all compiled files into the current image, are
we?

Cheers
P
P
Pierre Neidhardt wrote on 1 Jul 16:43 +0200
(address . glv@posteo.net)
87r134x59q.fsf@ambrevar.xyz
Hi Liliana,

It's tempting to think that Guix packages are good candidates for "build
scripts", but in the face of it, it may very well be that ASDF authors
had something completely different in mind.

In any case, asdf:compile-system seems to be underused to the point that
barely anyone beside Guix packagers ever experience it.

Cheers!
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmK/CBESHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/70wH/3IeboIPzW0vdycyTQeKAi/ecbSsOe6N
v3Gt2+4cSflnOP57TsH8MmRfJPQytVuXg6mpOfrLjbQOpBVLrAAEaTsKm1EmjeZq
aVkWhMypNoZ8+VNri0Vfgy1PNf4f7DxuLzQ+RIEpvKbFqBpUlA4rLAGH9K+8xKbF
9vKgEyEqs+4VmL3UA/Gx3g5B8OMDk8hQfTEEkY2isnLmqVbvWuWfFieyeEKto7ZP
0W1399/WhY66txb5H0qVashVs0325jYa65Vjb8DXIrPNcVYwdtwNYaIDFgoZoXnd
MOGxlcdaubJbqaSrmIHrTSsMMykXBGwH+bOn7j+/oxMreK1HRqfJ2wA=
=rUjb
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 1 Jul 16:46 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
87o7y8x544.fsf@ambrevar.xyz
Hi Guillaume,

I gave it a go and your suggestion indeed cuts it for cleavir and
cl-gamepad.

It did not fix it for the tests though.

I did some more testing, and this is what I found out on one of the
failing systems (cl-reexport): from a --pure sbcl repl, if I load the
.asd files manually then run test-system, I can reproduce the issue.

However, if I run

Toggle snippet (6 lines)
(asdf:initialize-source-registry
`(:source-registry (:tree ,(uiop:getcwd))
:inherit-configuration))
(asdf:test-system :cl-reexport)

then it works!

In other words, I believe that `asdf:load-asd' is yet another under-used
ASDF function, and we should probably go with the officially recommended
way, namely adding the source folder to the ASDF registry.

Thoughts?

I'll try it out then send a patch.

Cheers!
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmK/CNsSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/pNsH/AmNpDwOYzhYcl74U6DJJieJeHSVbXQD
sswQlVO7MtldapOqbC1jovsvAN3fSiF6hWM7b11bwtJC49fKZq1zX1G9I57q3Mnv
YSyzmto9ERf32eAR18z2tvccmUMx9rJhcHc9isCFXrxFff7KPB6DdpS8pUPXpXT6
+gGTXcVhssztZOOC+SecH7n3c/Do0zUtAGbYeJvF1fGMMock9XcFqNhlDwA18yPk
fWHOEuTu/I8BlD5odomGA0PR6MV+uECKEzTLofzPY4hPUX9ux/Ku/r6sfbSPLnNE
Kt/LYeHyxx+8XuRdwILGdphQIV8Fv5RKLh8Ly3AQ0zGnpMAWRUlG6lk=
=BgXf
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 1 Jul 18:40 +0200
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 56334@debbugs.gnu.org)
87fsjkzsl4.fsf@kitej
Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (30 lines)
> Hi Guillaume,
>
> I gave it a go and your suggestion indeed cuts it for cleavir and
> cl-gamepad.
>
> It did not fix it for the tests though.
>
> I did some more testing, and this is what I found out on one of the
> failing systems (cl-reexport): from a --pure sbcl repl, if I load the
> .asd files manually then run test-system, I can reproduce the issue.
>
> However, if I run
>
> (asdf:initialize-source-registry
> `(:source-registry (:tree ,(uiop:getcwd))
> :inherit-configuration))
> (asdf:test-system :cl-reexport)
>
> then it works!
>
> In other words, I believe that `asdf:load-asd' is yet another under-used
> ASDF function, and we should probably go with the officially recommended
> way, namely adding the source folder to the ASDF registry.
>
> Thoughts?
>
> I'll try it out then send a patch.
>
> Cheers!

I think using the 'initialize-source-registry' technique instead of
'load-asd' would also make the '#:asd-files' and '#:test-asd-file'
arguments of the build system unnecessary, so they could be removed.
P
P
Pierre Neidhardt wrote on 1 Jul 19:07 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
87fsjkwylz.fsf@ambrevar.xyz
Exactly, I already wrote the patch that did! :)

Will send soon, need to do some more testing.
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmK/KcgSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/8IIH/iBWNMYTQ7bkhahHGoHCY30QSMdycn9K
MxYH0KRMPLSTBSxbAZcaEdpYURYTyxqwLrDeeJPYRsqgfJi+++I2ckMEXJb9VCTo
Vke6cBYx5eTkgWPpAK9j0/on2UxwiYTKf0rSvYhxtq7p71Mk3LKbAgpyUn97h3zp
A2TxgiVSbuzPfLNYfWF0eC2qUukua/wpf578lo7mEWwWuKA4HYQXf5ZpOU1zYib8
UCjnaEqmSAX1ZGQlozv9NHYIHdCJq8SOeor8uq/qoqKQQ1N6RfigJmuqQJxS6Etg
kmM+Vxd4ae/753zv+hoh90kM+WDUGMjkzsYod1LDjIX9oYbFpiQle/s=
=uexg
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 2 Jul 12:17 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
875ykfkedc.fsf@ambrevar.xyz
Robert Goldman from ASDF found out why the "COMPONENT not found" issue happens:


So either we fix most of the Prove-depending libraries, or we just do
what's expected from every one, that is, add the directory to the ASDF
registries.

The latter is much easier of course...
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLAGz8SHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/HJYIAKeew3qq/Nv9HIu32hZxbwDRNXuAI81r
S1nj13S76+qV4FiJSciQ0JX9yutqf2dtiXuZk9exNrzcuySiWpCtqROzOmtGxb+D
h4yj6rzrph42zGn/DkjEivwPkTHhgFLqZhh8Vw8JvOCttmgRiZJ+AtRbicThqvv7
MKfAwDkrF0IbyoskeX0oicX4hcJac7xR9jkpoYGh4CuJ6xHkyJIli03ZXPAo6Ta1
Jym3fU3Yn4PusKZ3ZONhTsrdxFGj/JSxsLYvYZjNGsejeFk2eHWhwTetJbLrz0T2
3WLClDvPkbDmCuJ/rJ+Ky+1cfTztbF3MdzH4j5HHC2xElclXRMXXjws=
=SMpt
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 3 Jul 12:19 +0200
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 56334@debbugs.gnu.org)
87tu7ypk5s.fsf@kitej
Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (10 lines)
> Robert Goldman from ASDF found out why the "COMPONENT not found" issue happens:
>
> https://gitlab.common-lisp.net/asdf/asdf/-/issues/119#note_9808
>
> So either we fix most of the Prove-depending libraries, or we just do
> what's expected from every one, that is, add the directory to the ASDF
> registries.
>
> The latter is much easier of course...

As adding the build directory to ASDF's registry is easier and also
simplifies asdf-build-system, would should do that. And we could still
open issues upstream for libraries that are starting their test suites
in a wrong way.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYsFurw8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+zGQD+NiigCw05fFad42t8lMoQS25tKkEr4AGKdUEz
/8yuzxoA/0H6AN61R4q0qmxVK4LzOEsEuJB6OFLrNc6iqVI69GBC
=rcI8
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 4 Jul 17:18 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
87tu7woqis.fsf@ambrevar.xyz
I found a blocker: Some StumpWM contribs like sbcl-stumpwm kbd-layout
make calls at the top level which expect a running session of StumpWM,
and thus asd:load-system will fail on them, while asdf:compile-system
used to work.

Suggestion: add an option to our build system to choose between
asdf:load-system and asdf:compile-system. We default to
asdf:load-system and use asdf:compile-system in stumpwm-contrib.

Thoughts?
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLDBLsSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/EHQH+gKcQShbtEUkxMWqC8zRnP6TVPhmUUQr
TM58zHOV93V+DyxKiM07DB8a9B8l69jGXBqVbKpO4B5ElJ2WFjGwre71WSxR9ef0
UGPHVj/NY3434sU65Lg2ZfBmUShuk2feYa2hmbb54omtNgoaW2qkNSYP2P4oEJZ9
3tnQOm+p7T4S4tLk+Nei9hvx1+oNJ9FjOd3PZLiAu2QEzg6UR1w99oLLDUALIRdP
Q2VzCfb8dhRSBGunvItG0toVpzMlCIRTS7+Ks13+C9OXC0G6IlUeZe82qfv6SlyR
DpgWhJD95sko7m6j/qcvsivJ32HdLfAggU+uyhyS5+OJHllSNMvdK7Q=
=69ZX
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 4 Jul 21:57 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
875ykc3b2h.fsf@ambrevar.xyz
Find the first draft attached. Do not merge, we need to figure out what
to do with sbcl-stumpwm-kbd-layouts.
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLDRjYSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/MJMH/2Zyf5+6xD7beuVkLFIM3tZgLxbjMtc7
l+TVqFDIoD3RESsT21tntLr/pWfdg0trZrMZtpxrdNJvOP+OCXP8M37wdpfvgYpE
LmF7VNMTxxVR4cU+xZGSsVQ7ZwJZjvUY9rD+lfB0mdgP916mudkJYnxhBf+MIh4P
x0kHfYhtwJCNyTzOIoDGIaF9/OpAEZXVBi5btb2LXHzJM8pCFerpGkA0yMdTFZK4
9j+rRfjX5nO5/dqaVcFNBk157Uc36Ua3OjkC07ZRWVO80gDm4pUoSFUT6SgA57FS
tiNdBasWSLhxTQER26XHBpcioRGIVwWRjeEvxEIbEulmN6TDA3p4/Og=
=iOEH
-----END PGP SIGNATURE-----

This fixes 2 flaws in the asdf-build-system:

1. Use asdf:load-system instead of asdf:compile-system. The latter is not
recommended by the manual and fails with at least 2 systems.

2. Add the build directory to the ASDF registry so that .asd files are
automatically found. This has a double benefit:
- It dramatically simplifies package definition writing.
- It fixes a bug which used to cause the check phase to fail.

All commits after the first two adapt the Common Lisp package definitions to
the new build system and in particular fix many check phases.
From fd4eb6c4d5fce8d3c1ef205b541ddf76ed0c478a Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Fri, 1 Jul 2022 16:37:44 +0200
Subject: [PATCH 01/18] guix: build: Switch from asdf:compile-system to
asdf:load-system.

* guix/build/lisp-utils.scm (compile-systems): Switch from asdf:compile-system
to asdf:load-system.

According to the ASDF manual:

This will make sure all the files in the system are compiled, but not
necessarily load any of them in the current image; on most systems, it
will _not_ load all compiled files in the current image. This function
exists for symmetry with 'load-system' but is not recommended unless you
are writing build scripts and know what you're doing.
---
guix/build/lisp-utils.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 17d2637f87..bd6b21d5a6 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -116,7 +116,7 @@ (define (compile-systems systems asd-files)
               `(asdf:load-asd (truename ,asd-file)))
             asd-files)
      ,@(map (lambda (system)
-              `(asdf:compile-system ,system))
+              `(asdf:load-system ,system))
             systems))))
 
 (define (test-system system asd-files test-asd-file)
-- 
2.32.0
From 2395f5bef855cb734d13745b9c90a3bbae550d56 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Fri, 1 Jul 2022 17:17:32 +0200
Subject: [PATCH 02/18] build-system: asdf: Let ASDF locate the .asd files.

* guix/build-system/asdf.scm (package-with-build-system): Remove 'asd-files'
and replace 'test-asd-file' by 'asd-test-systems'.
(lower): Same.

* guix/build/asdf-build-system.scm (source-asd-file): Remove since ASDF does
it better than us.
(find-asd-files): Same.
(build): Remove unused asd-files argument.
(check): Remove asd-files argument and replace asd-systems by
asd-test-systems.

* guix/build/lisp-utils.scm (compile-systems): Call to ASDF to find the
systems.
(test-system): Same.

This approach has many benefits:

- It's simplifies the build system.
- The package definitions are easier to write.
- It fixes a bug with systems that call asdf:clear-system which would cause
the load to fail. See for instance test systems using Prove.
---
guix/build-system/asdf.scm | 13 +++++++-----
guix/build/asdf-build-system.scm | 28 ++++++-------------------
guix/build/lisp-utils.scm | 35 ++++++++++++++------------------
3 files changed, 29 insertions(+), 47 deletions(-)

Toggle diff (169 lines)
diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index a0f4634db0..98231714d9 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -202,7 +202,7 @@ (define (new-inputs inputs-getter)
       (define base-arguments
         (if target-is-source?
             (strip-keyword-arguments
-             '(#:tests? #:asd-files #:lisp #:asd-systems #:test-asd-file)
+             '(#:tests? #:lisp #:asd-systems #:asd-test-systems)
              (package-arguments pkg))
             (package-arguments pkg)))
 
@@ -270,9 +270,8 @@ (define (asdf-build lisp-type)
   (lambda* (name inputs
                  #:key source outputs
                  (tests? #t)
-                 (asd-files ''())
                  (asd-systems ''())
-                 (test-asd-file #f)
+                 (asd-test-systems ''())
                  (phases '%standard-phases)
                  (search-paths '())
                  (system (%current-system))
@@ -292,6 +291,11 @@ (define systems
             `(quote ,(list package-name)))
           asd-systems))
 
+    (define test-systems
+      (if (null? (cadr asd-test-systems))
+          systems
+          asd-test-systems))
+
     (define builder
       (with-imported-modules imported-modules
         #~(begin
@@ -302,9 +306,8 @@ (define builder
                            (%lisp-type #$lisp-type))
               (asdf-build #:name #$name
                           #:source #+source
-                          #:asd-files #$asd-files
                           #:asd-systems #$systems
-                          #:test-asd-file #$test-asd-file
+                          #:asd-test-systems #$test-systems
                           #:system #$system
                           #:tests? #$tests?
                           #:phases #$phases
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index 6186613e52..2cce72c5c1 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -78,16 +78,6 @@ (define (output-translation source-path
     (,(library-directory object-output)
      :**/ :*.*.*)))
 
-(define (source-asd-file output name asd-file)
-  (string-append (lisp-source-directory output name) "/" asd-file))
-
-(define (find-asd-files output name asd-files)
-  (if (null? asd-files)
-      (find-files (lisp-source-directory output name) "\\.asd$")
-      (map (lambda (asd-file)
-             (source-asd-file output name asd-file))
-           asd-files)))
-
 (define (copy-files-to-output out name)
   "Copy all files from the current directory to OUT.  Create an extra link to
 any system-defining files in the source to a convenient location.  This is
@@ -190,7 +180,7 @@ (define* (configure #:key inputs #:allow-other-keys)
     (setenv "XDG_CONFIG_DIRS" (string-append out "/etc")))
   #t)
 
-(define* (build #:key outputs inputs asd-files asd-systems
+(define* (build #:key outputs inputs asd-systems
                 #:allow-other-keys)
   "Compile the system."
   (let* ((out (library-output outputs))
@@ -198,26 +188,20 @@ (define* (build #:key outputs inputs asd-files asd-systems
          (source-path (string-append out (%lisp-source-install-prefix)))
          (translations (wrap-output-translations
                         `(,(output-translation source-path
-                                               out))))
-         (asd-files (find-asd-files out system-name asd-files)))
+                                               out)))))
     (setenv "ASDF_OUTPUT_TRANSLATIONS"
             (replace-escaped-macros (format #f "~S" translations)))
     (setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache
-    (compile-systems asd-systems asd-files))
+    (compile-systems asd-systems (lisp-source-directory out system-name)))
   #t)
 
-(define* (check #:key tests? outputs inputs asd-files asd-systems
-                test-asd-file
+(define* (check #:key tests? outputs inputs asd-test-systems
                 #:allow-other-keys)
   "Test the system."
   (let* ((out (library-output outputs))
-         (system-name (main-system-name out))
-         (asd-files (find-asd-files out system-name asd-files))
-         (test-asd-file
-          (and=> test-asd-file
-                 (cut source-asd-file out system-name <>))))
+         (system-name (main-system-name out)))
     (if tests?
-        (test-system (first asd-systems) asd-files test-asd-file)
+        (test-system asd-test-systems (lisp-source-directory out system-name))
         (format #t "test suite not run~%")))
   #t)
 
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index bd6b21d5a6..82be117c68 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -107,38 +107,33 @@ (define (lisp-invocation program)
              "--eval" "(quit)"))
     (_ (error "The LISP provided is not supported at this time."))))
 
-(define (compile-systems systems asd-files)
+(define (compile-systems systems directory)
   "Use a lisp implementation to compile the SYSTEMS using asdf.
 Load ASD-FILES first."
   (lisp-eval-program
    `((require :asdf)
-     ,@(map (lambda (asd-file)
-              `(asdf:load-asd (truename ,asd-file)))
-            asd-files)
+     (asdf:initialize-source-registry
+      (list :source-registry (list :tree (uiop:ensure-pathname ,directory
+                                                               :truenamize t
+                                                               :ensure-directory t))
+            :inherit-configuration))
      ,@(map (lambda (system)
               `(asdf:load-system ,system))
             systems))))
 
-(define (test-system system asd-files test-asd-file)
+(define (test-system test-systems directory)
   "Use a lisp implementation to test SYSTEM using asdf.  Load ASD-FILES first.
 Also load TEST-ASD-FILE if necessary."
   (lisp-eval-program
    `((require :asdf)
-     ,@(map (lambda (asd-file)
-              `(asdf:load-asd (truename ,asd-file)))
-            asd-files)
-     ,@(if test-asd-file
-           `((asdf:load-asd (truename ,test-asd-file)))
-           ;; Try some likely files.
-           (map (lambda (file)
-                  `(when (uiop:file-exists-p ,file)
-                     (asdf:load-asd (truename ,file))))
-                (list
-                 (string-append system "-tests.asd")
-                 (string-append system "-test.asd")
-                 "tests.asd"
-                 "test.asd")))
-     (asdf:test-system ,system))))
+     (asdf:initialize-source-registry
+      (list :source-registry (list :tree (uiop:ensure-pathname ,directory
+                                                               :truenamize t
+                                                               :ensure-directory t))
+            :inherit-configuration))
+     ,@(map (lambda (system)
+              `(asdf:test-system ,system))
+            test-systems))))
 
 (define (string->lisp-keyword . strings)
   "Return a lisp keyword for the concatenation of STRINGS."
-- 
2.32.0
From 22de0cac8481df8b9645e08420f54bb2beabe1ed Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Fri, 1 Jul 2022 18:20:18 +0200
Subject: [PATCH 03/18] gnu: sbcl-cl-gamepad: Remove asdf:compile-system
workaround.

* gnu/packages/lisp-xyz.scm (sbcl-cl-gamepad)[arguments]: Remove 'build phase
patch now that asdf-build-system/sbcl builds using asdf:load-system which
fixes the bug.
---
gnu/packages/lisp-xyz.scm | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)

Toggle diff (43 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 3d6ce68fb8..3b13d1739e 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -17878,35 +17878,7 @@ (define-public sbcl-cl-gamepad
                (substitute* "evdev-cffi.lisp"
                  (("libevdev.so" all)
                   (string-append (assoc-ref inputs "libevdev")
-                                 "/lib/" all)))))
-           ;; Here we use a custom build phase to work around a compilation bug.
-           ;; Using 'asdf:compile-system' fails, but using 'asdf:load-system'
-           ;; succeeds (and also compiles the system).
-           ;; See https://github.com/Shirakumo/cl-gamepad/issues/8
-           (replace 'build
-             (lambda* (#:key outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (source-path (string-append out
-                                                  "/share/common-lisp/"
-                                                  (%lisp-type)))
-                      (translations `((,source-path
-                                       :**/ :*.*.*)
-                                      (,(string-append out
-                                                       "/lib/common-lisp/"
-                                                       (%lisp-type))
-                                       :**/ :*.*.*))))
-                 (setenv "ASDF_OUTPUT_TRANSLATIONS"
-                         (format #f "~S" `(:output-translations
-                                           ,translations
-                                           :inherit-configuration)))
-                 (setenv "HOME" (assoc-ref outputs "out"))
-                 (with-directory-excursion (string-append source-path
-                                                          "/cl-gamepad")
-                   (invoke (%lisp-type)
-                           "--eval" "(require :asdf)"
-                           "--eval" "(asdf:load-asd (truename \"cl-gamepad.asd\"))"
-                           "--eval" "(asdf:load-system :cl-gamepad)"
-                           "--eval" "(quit)"))))))))
+                                 "/lib/" all))))))))
       (inputs
        `(("cffi" ,sbcl-cffi)
          ("documentation-utils" ,sbcl-documentation-utils)
-- 
2.32.0
From 17d63b502101196c069c1e7d60c8a27392516ce6 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Fri, 1 Jul 2022 20:41:37 +0200
Subject: [PATCH 04/18] gnu: Remove obsolete references to asd-files and
test-asd-file.

* gnu/packages/lisp-check.scm: Do it.
* gnu/packages/lisp.scm: Do it.

In a previous commit we've update the build system to let ASDF locate the .asd
files for us, so package definition no longer need to provide this information.
---
gnu/packages/lisp-check.scm | 6 +-
gnu/packages/lisp-xyz.scm | 202 ++++++++----------------------------
2 files changed, 45 insertions(+), 163 deletions(-)

Toggle diff (610 lines)
diff --git a/gnu/packages/lisp-check.scm b/gnu/packages/lisp-check.scm
index 6b13daf9c5..097ab7b6ee 100644
--- a/gnu/packages/lisp-check.scm
+++ b/gnu/packages/lisp-check.scm
@@ -116,8 +116,7 @@ (define-public sbcl-checkl
        ;; Error while trying to load definition for system checkl-test from
        ;; pathname [...]/checkl-test.asd: The function CHECKL:DEFINE-TEST-OP
        ;; is undefined.
-       '(#:asd-files '("checkl.asd")
-         #:tests? #f))
+       '(#:tests? #f))
       (native-inputs
        (list sbcl-fiveam))
       (inputs
@@ -869,8 +868,7 @@ (define-public sbcl-try
              sbcl-mgl-pax
              sbcl-trivial-gray-streams))
       (arguments
-       `(#:asd-files '("try.asdf.asd" "try.asd")
-         ;; FIXME: Get tests to work
+       `(;; FIXME: Get tests to work
          #:tests? #f))
       (home-page "https://github.com/melisgl/try")
       (synopsis "Common Lisp test framework")
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 3b13d1739e..00fae19ab9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -265,12 +265,6 @@ (define-public sbcl-asdf-finalizers
       (native-inputs
        `(("fare-utils" ,sbcl-fare-utils)
          ("hu.dwim.stefil" ,sbcl-hu.dwim.stefil)))
-      (arguments
-       `(#:asd-files '("asdf-finalizers.asd"
-                       "list-of.asd"
-                       "asdf-finalizers-test.asd")
-         #:asd-systems '("asdf-finalizers"
-                         "list-of")))
       (home-page "https://gitlab.common-lisp.net/asdf/asdf-finalizers")
       (synopsis "Enforced calling of finalizers for Lisp code")
       (description "This library allows you to implement and enforce proper
@@ -373,10 +367,8 @@ (define-public sbcl-cl-irc
          ("split-sequence" ,sbcl-split-sequence)
          ("usocket" ,sbcl-usocket)))
       (arguments
-       `(#:asd-systems '("cl-irc") ;; Some inexisting "c" system is
-                                   ;; found by guix otherwise.
-         #:asd-files '("cl-irc.asd")
-         #:test-asd-file "test/cl-irc-test.asd"))
+        ;; Some inexisting "c" system is found by guix otherwise.
+       `(#:asd-systems '("cl-irc")))
       (synopsis "IRC client library for Common Lisp")
       (description "@code{cl-irc} is a Common Lisp IRC client library that
 features (partial) DCC, CTCP and all relevant commands from the IRC
@@ -867,8 +859,7 @@ (define-public sbcl-cl-ppcre-unicode
     (inputs
      (list sbcl-cl-ppcre sbcl-cl-unicode))
     (arguments
-     `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found"
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'disable-ppcre
            ;; cl-ppcre and cl-ppcre-unicode are put in different packages
@@ -996,8 +987,7 @@ (define-public sbcl-spatial-trees
            "11rhc6h501dwcik2igkszz7b9n515cr99m5pjh4r2qfwgiri6ysa"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       '(#:tests? #f           ; spatial-trees.test requires spatial-trees.nns
-         #:test-asd-file "spatial-trees.test.asd"))
+       '(#:tests? #f)) ; spatial-trees.test requires spatial-trees.nns
       (native-inputs
        (list sbcl-fiveam))
       (home-page "https://github.com/rpav/spatial-trees")
@@ -1449,8 +1439,7 @@ (define-public sbcl-trivial-features
         (base32 "0jsqah1znzqilxnw5vannb083ayk0d7phkackqzwwqkyg5hpn6pq"))))
     (build-system asdf-build-system/sbcl)
     (arguments
-     '(#:asd-files '("trivial-features.asd")
-       ;; FIXME: Tests disabled because of a circular dependency between
+     '(;; FIXME: Tests disabled because of a circular dependency between
        ;; trivial-features and cffi.
        #:tests? #f))
     ;; (native-inputs
@@ -2337,9 +2326,7 @@ (define-public sbcl-mgl-pax
              sbcl-pythonic-string-reader
              sbcl-slime-swank))
       (arguments
-       `(#:asd-files '("mgl-pax.asdf.asd"
-                       "mgl-pax.asd")
-         #:asd-systems '("mgl-pax"
+       `(#:asd-systems '("mgl-pax"
                          "mgl-pax/navigate"
                          "mgl-pax/document"
                          "mgl-pax/transcribe")
@@ -2980,11 +2967,6 @@ (define-public sbcl-cffi
                            (string-append
                             (assoc-ref outputs "out")
                             "/include/grovel")))))
-       #:asd-files '("cffi.asd"
-                     "cffi-toolchain.asd"
-                     "cffi-grovel.asd"
-                     "cffi-libffi.asd"
-                     "cffi-uffi-compat.asd")
        #:asd-systems '("cffi"
                        "cffi-libffi"
                        "cffi-uffi-compat")))
@@ -3345,16 +3327,7 @@ (define-public sbcl-cl-cffi-gtk
          ("trivial-features" ,sbcl-trivial-features)
          ("trivial-garbage" ,sbcl-trivial-garbage)))
       (arguments
-       `(#:asd-files '("gtk/cl-cffi-gtk.asd"
-                       "glib/cl-cffi-gtk-glib.asd"
-                       "gobject/cl-cffi-gtk-gobject.asd"
-                       "gio/cl-cffi-gtk-gio.asd"
-                       "cairo/cl-cffi-gtk-cairo.asd"
-                       "pango/cl-cffi-gtk-pango.asd"
-                       "gdk-pixbuf/cl-cffi-gtk-gdk-pixbuf.asd"
-                       "gdk/cl-cffi-gtk-gdk.asd")
-         #:test-asd-file "test/cl-cffi-gtk-test.asd"
-         ;; TODO: Tests fail with memory fault.
+       `(;; TODO: Tests fail with memory fault.
          ;; See https://github.com/Ferada/cl-cffi-gtk/issues/24.
          #:tests? #f
          #:phases
@@ -4711,8 +4684,7 @@ (define-public sbcl-fast-io
       ;; Error while trying to load definition for system fast-io-test from
       ;; pathname [...]/fast-io-test.asd: The function CHECKL:DEFINE-TEST-OP
       ;; is undefined.
-      '(#:tests? #f
-        #:asd-files '("fast-io.asd")))
+      '(#:tests? #f))
      (native-inputs
       (list sbcl-fiveam sbcl-checkl))
      (inputs
@@ -4874,7 +4846,6 @@ (define-public sbcl-lack
                          "lack-util"
                          "lack-middleware-backtrace"
                          "lack-middleware-static")
-         #:test-asd-file "t-lack.asd"
          ;; XXX: Component :CLACK not found
          #:tests? #f))
       (home-page "https://github.com/fukamachi/lack")
@@ -5602,8 +5573,6 @@ (define-public sbcl-fare-utils
           (base32
            "01wsr1aap3jdzhn4hrqjbhsjx6qci9dbd3gh4gayv1p49rbg8aqr"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:test-asd-file "test/fare-utils-test.asd"))
       (native-inputs
        (list sbcl-hu.dwim.stefil))
       (synopsis "Collection of utilities and data structures")
@@ -5814,12 +5783,7 @@ (define-public sbcl-iolib
        ("split-sequence" ,sbcl-split-sequence)
        ("swap-bytes" ,sbcl-swap-bytes)))
     (arguments
-     '(#:asd-files '("iolib.asdf.asd"
-                     "iolib.conf.asd"
-                     "iolib.common-lisp.asd"
-                     "iolib.base.asd"
-                     "iolib.asd")
-       #:asd-systems '("iolib"
+     '(#:asd-systems '("iolib"
                        "iolib/os")
        #:phases
        (modify-phases %standard-phases
@@ -6151,8 +6115,7 @@ (define-public sbcl-lisp-namespace
       (native-inputs
        (list sbcl-fiveam))
       (arguments
-       `(#:test-asd-file "lisp-namespace.test.asd"
-        ;; XXX: Component LISP-NAMESPACE-ASD::LISP-NAMESPACE.TEST not found
+       `(;; XXX: Component LISP-NAMESPACE-ASD::LISP-NAMESPACE.TEST not found
          #:tests? #f))
       (synopsis "LISP-N, or extensible namespaces in Common Lisp")
       (description "Common Lisp already has major 2 namespaces, function
@@ -6305,8 +6268,6 @@ (define-public sbcl-type-i
          ("trivia.trivial" ,sbcl-trivia.trivial)))
       (native-inputs
        (list sbcl-fiveam))
-      (arguments
-       `(#:test-asd-file "type-i.test.asd"))
       (synopsis "Type inference utility on unary predicates for Common Lisp")
       (description "This library tries to provide a way to detect what kind of
 type the given predicate is trying to check.  This is different from inferring
@@ -6348,8 +6309,7 @@ (define-public sbcl-optima
        (list sbcl-eos))
       (arguments
        ;; XXX: Circular dependencies: tests depend on optima.ppcre which depends on optima.
-       `(#:tests? #f
-         #:test-asd-file "optima.test.asd"))
+       `(#:tests? #f))
       (synopsis "Optimized pattern matching library for Common Lisp")
       (description "Optima is a fast pattern matching library which uses
 optimizing techniques widely used in the functional programming world.")
@@ -6487,7 +6447,6 @@ (define-public sbcl-trivia
                        "trivia.quasiquote"
                        "trivia.cffi"
                        "trivia.fset")
-       #:test-asd-file "trivia.test.asd"
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-build
@@ -6562,8 +6521,7 @@ (define-public sbcl-cl-str
     (native-inputs
      (list sbcl-prove))
     (arguments
-     `(#:asd-systems '("str")
-       #:test-asd-file "str.test.asd"))
+     `(#:asd-systems '("str")))
     (synopsis "Modern, consistent and terse Common Lisp string manipulation library")
     (description "A modern and consistent Common Lisp string manipulation
 library that focuses on modernity, simplicity and discoverability:
@@ -6959,8 +6917,7 @@ (define-public sbcl-cl-containers
       (inputs
        `(("metatilities-base" ,sbcl-metatilities-base)))
       (arguments
-       '(#:asd-files '("cl-containers.asd")
-         #:phases
+       '(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'relax-version-checks
              (lambda _
@@ -7012,9 +6969,6 @@ (define-public sbcl-cambl
          ("cl-containers" ,sbcl-cl-containers)
          ("local-time" ,sbcl-local-time)
          ("periods" ,sbcl-periods)))
-      (arguments
-       '(#:asd-files '("fprog.asd"
-                       "cambl.asd")))
       (synopsis "Commoditized amounts and balances for Common Lisp")
       (description
        "CAMBL is a Common Lisp library providing a convenient facility for
@@ -7356,9 +7310,6 @@ (define-public sbcl-cl-slug
          (sha256
           (base32 "1asdq6xllmsvfw5fky9wblqcx9isac9jrrlkfl7vyxcq1wxrnflx"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:asd-files '("cl-slug-test.asd" "cl-slug.asd")
-         #:asd-systems '("cl-slug-test" "cl-slug")))
       (native-inputs
        (list sbcl-prove))
       (inputs
@@ -7716,8 +7667,6 @@ (define-public sbcl-cl-heap
     (build-system asdf-build-system/sbcl)
     (native-inputs
      (list sbcl-xlunit))
-    (arguments
-     `(#:test-asd-file "cl-heap-tests.asd"))
     (synopsis "Heap and priority queue data structures for Common Lisp")
     (description
      "CL-HEAP provides various implementations of heap data structures (a
@@ -8688,8 +8637,6 @@ (define-public sbcl-vas-string-metrics
          (sha256
           (base32 "11fcnd03ybzz37rkg3z0wsb727yqgcd9gn70sccfb34l89ia279k"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:test-asd-file "test.vas-string-metrics.asd"))
       (home-page "https://github.com/vsedach/vas-string-metrics")
       (synopsis "String distance algorithms for Common Lisp")
       (description
@@ -9522,8 +9469,7 @@ (define-public sbcl-hdf5-cffi
       (native-inputs
        (list sbcl-fiveam))
       (arguments
-       `(#:test-asd-file "hdf5-cffi.test.asd"
-         ;; Tests depend on hdf5-cffi.examples.asd in addition to hdf5-cffi.asd,
+       `(;; Tests depend on hdf5-cffi.examples.asd in addition to hdf5-cffi.asd,
          ;; I don't know if there is a way to tell asdf-build-system to load
          ;; an additional system first, so tests are disabled.
          #:tests? #f
@@ -9709,9 +9655,7 @@ (define-public sbcl-type-r
        `(("trivia" ,sbcl-trivia)
          ("alexandria" ,sbcl-alexandria)))
       (native-inputs
-       (list sbcl-fiveam))
-      (arguments
-       `(#:test-asd-file "type-r.test.asd")))))
+       (list sbcl-fiveam)))))
 
 (define-public cl-type-r
   (sbcl-package->cl-source-package sbcl-type-r))
@@ -9751,8 +9695,7 @@ (define-public sbcl-trivialib-type-unify
       (native-inputs
        (list sbcl-fiveam))
       (arguments
-       `(#:asd-systems '("trivialib.type-unify")
-         #:test-asd-file "trivialib.type-unify.test.asd")))))
+       `(#:asd-systems '("trivialib.type-unify"))))))
 
 (define-public cl-trivialib-type-unify
   (sbcl-package->cl-source-package sbcl-trivialib-type-unify))
@@ -9834,10 +9777,7 @@ (define-public sbcl-specialized-function
          ("trivial-cltl2" ,sbcl-trivial-cltl2)
          ("type-r" ,sbcl-type-r)))
       (native-inputs
-       (list sbcl-fiveam))
-      (arguments
-       `(#:asd-files '("specialized-function.asd")
-         #:test-asd-file "specialized-function.test.asd")))))
+       (list sbcl-fiveam)))))
 
 (define-public cl-specialized-function
   (sbcl-package->cl-source-package sbcl-specialized-function))
@@ -9874,10 +9814,7 @@ (define-public sbcl-constantfold
          ("iterate" ,sbcl-iterate)
          ("lisp-namespace" ,sbcl-lisp-namespace)))
       (native-inputs
-       (list sbcl-fiveam))
-      (arguments
-       `(#:asd-files '("constantfold.asd")
-         #:test-asd-file "constantfold.test.asd")))))
+       (list sbcl-fiveam)))))
 
 (define-public cl-constantfold
   (sbcl-package->cl-source-package sbcl-constantfold))
@@ -9915,10 +9852,7 @@ (define-public sbcl-gtype
          ("iterate" ,sbcl-iterate)
          ("type-r" ,sbcl-type-r)))
       (native-inputs
-       (list sbcl-fiveam))
-      (arguments
-       `(#:asd-files '("gtype.asd")
-         #:test-asd-file "gtype.test.asd")))))
+       (list sbcl-fiveam)))))
 
 (define-public cl-gtype
   (sbcl-package->cl-source-package sbcl-gtype))
@@ -9949,9 +9883,7 @@ (define-public sbcl-numcl
           (base32 "15m4spbgayawnw5jjz04zfp0jnk9g6hgq5fmr648hzjzj50j1d78"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       `(#:test-asd-file "numcl.test.asd"
-         #:asd-files '("numcl.asd")
-         ;; Tests often fail because they require a dynamic-space-size much
+       `(;; Tests often fail because they require a dynamic-space-size much
          ;; bigger than the default one. Disable them for now.
          #:tests? #f))
       (native-inputs
@@ -10333,7 +10265,6 @@ (define-public sbcl-uffi
     (build-system asdf-build-system/sbcl)
     (arguments
      `(#:tests? #f ; TODO: Fix use of deprecated ASDF functions
-       #:asd-files '("uffi.asd")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-permissions
@@ -10391,13 +10322,8 @@ (define-public sbcl-clsql
        ("uffi" ,sbcl-uffi)
        ("zlib" ,zlib)))
     (arguments
-     `(#:asd-files '("clsql.asd"
-                     "clsql-uffi.asd"
-                     "clsql-sqlite3.asd"
-                     "clsql-postgresql.asd"
-                     "clsql-postgresql-socket3.asd"
-                     "clsql-mysql.asd")
-       #:asd-systems '("clsql"
+     `(#:asd-systems '("clsql"
+                       "clsql-uffi"
                        "clsql-sqlite3"
                        "clsql-postgresql"
                        "clsql-postgresql-socket3"
@@ -10500,8 +10426,8 @@ (define-public ecl-clsql
        (alist-delete "uffi" (package-inputs pkg)))
       (arguments
        (substitute-keyword-arguments (package-arguments pkg)
-         ((#:asd-files asd-files '())
-          `(cons "clsql-cffi.asd" ,asd-files)))))))
+         ((#:asd-systems asd-systems '())
+          `(cons "clsql-cffi" ,asd-systems)))))))
 
 (define-public sbcl-sycamore
   (let ((commit "fd2820fec165ad514493426dea209728f64e6d18"))
@@ -10692,10 +10618,6 @@ (define-public sbcl-modularize
          (sha256
           (base32 "1zys29rfkb649rkgl3snxhajk8d5yf7ryxkrwy020kwdh7zdsg7d"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:test-asd-file "modularize-test-module.asd"
-         #:asd-files '("modularize.asd" "modularize-test-module.asd")
-         #:asd-systems '("modularize" "modularize-test-module")))
       (inputs
        `(("documentation-utils" ,sbcl-documentation-utils)
          ("trivial-package-local-nicknames" ,sbcl-trivial-package-local-nicknames)))
@@ -10901,7 +10823,9 @@ (define-public sbcl-quantile-estimator
          "0rlswkf0siaabsvvch3dgxmg45fw5w8pd9b7ri2w7a298aya52z9"))))
     (build-system asdf-build-system/sbcl)
     (arguments
-     '(#:asd-files '("quantile-estimator.asd")))
+     '(#:asd-test-systems '("quantile-estimator.test")
+       ;; TODO: Tests need https://github.com/sharplispers/mw-equiv.
+       #:tests? #f))
     (inputs
      `(("alexandria" ,sbcl-alexandria)))
     (home-page "https://github.com/deadtrickster/quantile-estimator.cl")
@@ -10948,13 +10872,7 @@ (define-public sbcl-prometheus
        ("split-sequence" ,sbcl-split-sequence)
        ("trivial-utf-8" ,sbcl-trivial-utf-8)))
     (arguments
-     '(#:asd-files '("prometheus.asd"
-                     "prometheus.collectors.sbcl.asd"
-                     "prometheus.collectors.process.asd"
-                     "prometheus.formats.text.asd"
-                     "prometheus.exposers.hunchentoot.asd"
-                     "prometheus.pushgateway.asd")
-       #:asd-systems '("prometheus"
+     '(#:asd-systems '("prometheus"
                        "prometheus.collectors.sbcl"
                        "prometheus.collectors.process"
                        "prometheus.formats.text"
@@ -11334,8 +11252,7 @@ (define-public sbcl-cl-online-learning
        `(("cl-libsvm-format" ,sbcl-cl-libsvm-format)
          ("cl-store" ,sbcl-cl-store)))
       (arguments
-       `(#:test-asd-file "cl-online-learning-test.asd"
-         #:asd-systems '("cl-online-learning-test"
+       `(#:asd-systems '("cl-online-learning-test"
                          "cl-online-learning")))
       (home-page "https://github.com/masatoi/cl-online-learning")
       (synopsis "Online Machine Learning for Common Lisp")
@@ -11373,8 +11290,7 @@ (define-public sbcl-cl-mpg123
              #t))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       `(#:asd-files '("cl-mpg123.asd" "cl-mpg123-example.asd")
-         #:asd-systems '("cl-mpg123" "cl-mpg123-example")
+       `(#:asd-systems '("cl-mpg123" "cl-mpg123-example")
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'fix-paths
@@ -11973,8 +11889,6 @@ (define-public sbcl-opticl
              sbcl-retrospectiff
              sbcl-skippy
              sbcl-zpng))
-      (arguments
-       '(#:asd-files '("opticl.asd")))
       (home-page "https://github.com/slyrus/opticl")
       (synopsis "Image processing library for Common Lisp")
       (description
@@ -12351,8 +12265,7 @@ (define-public sbcl-hu.dwim.defclass-star
              ;; ("hu.dwim.stefil" ,cl-hu.dwim.stefil)
              sbcl-hu.dwim.asdf))
       (arguments
-       `(#:test-asd-file "hu.dwim.defclass-star.test.asd"
-         ;; Tests require a circular dependency: hu.dwim.stefil -> hu.dwim.def
+       `(;; Tests require a circular dependency: hu.dwim.stefil -> hu.dwim.def
          ;; -> hu.dwim.util -> hu.dwim.defclass-star.
          #:tests? #f))
       (home-page "https://github.com/hu-dwim/hu.dwim.defclass-star")
@@ -12694,8 +12607,7 @@ (define-public sbcl-cl-project
          ("prove" ,sbcl-prove)))
       (arguments
        ;; Tests depend on caveman, which in turns depends on cl-project.
-       '(#:tests? #f
-         #:asd-files '("cl-project.asd")))
+       '(#:tests? #f))
       (synopsis "Generate a skeleton for modern Common Lisp projects")
       (description "This library provides a modern project skeleton generator.
 In contract with other generators, CL-Project generates one package per file
@@ -12742,12 +12654,7 @@ (define-public sbcl-caveman
          ("trivial-types" ,sbcl-trivial-types)
          ("prove" ,sbcl-prove)))
       (arguments
-       `(#:asd-files '("caveman2.asd"
-                       "caveman2-db.asd"
-                       "caveman2-test.asd"
-                       "caveman-middleware-dbimanager.asd")
-         #:test-asd-file "caveman2-test.asd"
-         #:asd-systems '("caveman2"
+       `(#:asd-systems '("caveman2"
                          "caveman2-db"
                          "caveman2-test"
                          "caveman-middleware-dbimanager")
@@ -13001,8 +12908,7 @@ (define-public sbcl-custom-hash-table
           (base32 "1k4mvrpbqqds2fwjxp1bxmrfmr8ch4dkwhnkbw559knbqshvrlj5"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       '(#:asd-files '("cl-custom-hash-table.asd")
-         #:asd-systems '("cl-custom-hash-table")))
+       '(#:asd-systems '("cl-custom-hash-table")))
       (home-page "https://github.com/metawilm/cl-custom-hash-table")
       (synopsis "Custom hash tables for Common Lisp")
       (description "This library allows creation of hash tables with arbitrary
@@ -13265,10 +13171,6 @@ (define-public sbcl-deploy
          (sha256
           (base32 "07pfkibaridihg8lbq2czwa4iqifqk24n6rx7bfnv7i49p1ppja1"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:test-asd-file "deploy-test.asd"
-         #:asd-files '("deploy.asd"
-                       "deploy-test.asd")))
       (native-inputs
        `(("cl-mpg123" ,sbcl-cl-mpg123)
          ("cl-out123" ,sbcl-cl-out123)))
@@ -14972,8 +14874,7 @@ (define-public sbcl-cl-difflib
       ;; Due to the age of this library tests use some deprecated
       ;; functionality and keep failing.
       (arguments
-       '(#:tests? #f
-         #:asd-files '("cl-difflib.asd")))
+       '(#:tests? #f))
       (home-page "https://github.com/wiseman/cl-difflib")
       (synopsis "Compute differences between pairs of sequences")
       (description
@@ -15589,8 +15490,6 @@ (define-public sbcl-quickproject
     (inputs
      `(("cl-fad" ,sbcl-cl-fad)
        ("html-template" ,sbcl-html-template)))
-    (arguments
-     '(#:asd-files '("quickproject.asd")))
     (home-page "https://xach.com/lisp/quickproject/")
     (synopsis "Create Common Lisp project skeletons")
     (description
@@ -15695,7 +15594,7 @@ (define-public sbcl-cl-conspack
      ;; failing test where it's in use.
      (arguments
       '(#:tests? #f
-        #:asd-files '("cl-conspack.asd")))
+        #:asd-test-systems '("cl-conspack-test")))
      (native-inputs
       (list sbcl-checkl))
      (inputs
@@ -16845,8 +16744,7 @@ (define-public sbcl-parser-combinators
       (arguments
        ;; FIXME: (Sharlatan-20210523T184237+0100): Tests require `femlisp', which
        ;; is quite chunky not packaged system yet, enable them when it's packed.
-       `(#:tests? #f
-         #:test-asd-file "parser-combinators-tests.asd"))
+       `(#:tests? #f))
       ;; (native-inputs
       ;;  `(("hu.dwim.stefil" ,sbcl-hu.dwim.stefil)
       ;;    ("infix" ,sbcl-femlisp)))
@@ -17151,11 +17049,9 @@ (define-public sbcl-flow
          (sha256
           (base32 "0ysw1kwiqlf8kzllhnz8v3q40dmvwf83fzq8bfkbmwy5hfjh3pxp"))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       ;; FIXME: (Sharlatan-20210527T203118+0100): FLOW-VISUALIZER requires
-       ;; COMMONQT which is not packed yet and required tweaks with QT. Remove
-       ;; this when it's ready.
-       `(#:asd-files '("flow.asd")))
+      ;; FIXME: (Sharlatan-20210527T203118+0100): FLOW-VISUALIZER requires
+      ;; COMMONQT which is not packed yet and required tweaks with QT. Remove
+      ;; this when it's ready.
       (inputs
        `(("closer-mop" ,sbcl-closer-mop)
          ("documentation-utils" ,sbcl-documentation-utils)))
@@ -17284,8 +17180,6 @@ (define-public sbcl-cepl
        (sha256
         (base32 "0izbw2advqm3wailj3dpq6zqfrfirwn14pw5qmqh8i71r51xwmm2"))))
      (build-system asdf-build-system/sbcl)
-     (arguments
-      `(#:asd-files '("cepl.asd" "cepl.build.asd")))
      (inputs
       `(("alexandria" ,sbcl-alexandria)
         ("bordeaux-threads" ,sbcl-bordeaux-threads)
@@ -17683,8 +17577,7 @@ (define-public sbcl-cl-posix-mqueue
           (base32 "04519rg8vc782z097dzlb8nx0skab2fy2zd0m60r6mz2nw8xdvh6"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       `(#:test-asd-file "cl-posix-mqueue-tests.asd"
-         #:phases
+       `(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'patch-librt-path
              (lambda* (#:key inputs #:allow-other-keys)
@@ -19930,10 +19823,6 @@ (define-public sbcl-bit-smasher
       (inputs
        `(("cl-base64" ,sbcl-cl-base64)
          ("cl-base58" ,sbcl-cl-base58)))
-      ;; Load order matters for tests, both for file reading and evaluation.
-      (arguments
-       `(#:asd-systems '("bit-smasher-test" "bit-smasher")
-         #:asd-files '("bit-smasher.asd" "bit-smasher-test.asd")))
       (home-page "https://github.com/thephoeron/bit-smasher/")
       (synopsis "Handle bit vectors, bit vector arithmetic, and type conversions")
       (description
@@ -19987,8 +19876,7 @@ (define-public sbcl-overlord
       (native-inputs
        (list sbcl-fiveam))
       (arguments
-       `(#:asd-files '("overlord.asd")
-         #:phases
+       `(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'include-overlord/net
              (lambda _
@@ -20746,9 +20634,6 @@ (define-public sbcl-asd-generator
            (base32 "0yiybl7b9x1f85v0drj0yw9821y3yfhya4n6gycnv5vvx6jp9by4"))
           (file-name (git-file-name "cl-asd-generator" commit))))
       (build-system asdf-build-system/sbcl)
-      (arguments
-       `(#:asd-systems '("asd-generator")
-         #:asd-files '("asd-generator.asd")))
       (inputs
        (list sbcl-cl-fad
              sbcl-iterate
@@ -21220,8 +21105,7 @@ (define-public sbcl-jzon
           (base32 "1048f6prz2lp859nxwcgghn6n38pc2pb580azzxpdhfcdi0034mj"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       '(#:asd-files '("src/com.inuoe.jzon.asd" "test/com.inuoe.jzon-tests.asd")
-         #:asd-systems '("com.inuoe.jzon" "com.inuoe.jzon-tests")))
+       '(#:asd-systems '("com.inuoe.jzon" "com.inuoe.jzon-tests")))
       (native-inputs
         (list sbcl-alexandria
               sbcl-fiveam
-- 
2.32.0
From 3f69d656a84a42f6ed593936057d96874ee81e58 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:02:28 +0200
Subject: [PATCH 05/18] gnu: quri: Remove obsolete test workaround.

* gnu/packages/lisp-xyz.scm (quri)[arguments]: Remove.
---
gnu/packages/lisp-xyz.scm | 6 ------
1 file changed, 6 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 00fae19ab9..255716f2e3 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -4441,12 +4441,6 @@ (define-public sbcl-quri
        (sha256
         (base32 "0zpwjhs2zz9832wsjs00kbkjjl4bcs96krlnq9y75gi4f34fxj1x"))))
     (build-system asdf-build-system/sbcl)
-    (arguments
-     ;; 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")))
     (native-inputs (list sbcl-prove))
     (inputs (list sbcl-babel sbcl-split-sequence sbcl-cl-utilities
                   sbcl-alexandria))
-- 
2.32.0
From 399cae8e71a33b99eacdfe28a1ad0f714e9ff358 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:03:48 +0200
Subject: [PATCH 06/18] gnu: sbcl-cl-reexport: Remove obsolete test workaround.

* gnu/packages/lisp-xyz.scm (sbcl-cl-reexport)[arguments]: Remove.
---
gnu/packages/lisp-xyz.scm | 5 -----
1 file changed, 5 deletions(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 255716f2e3..fc93aa47f8 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5960,11 +5960,6 @@ (define-public sbcl-cl-reexport
        (list sbcl-alexandria))
       (native-inputs
        (list sbcl-prove))
-      (arguments
-       ;; FIXME: Test fails with the following, why?
-       ;; Component "cl-reexport-test" not found, required by
-       ;; #<SYSTEM "cl-reexport-test">
-       `(#:tests? #f))
       (synopsis "Reexport external symbols in other Common Lisp packages")
       (description
        "Cl-reexport makes a package reexport symbols which are external
-- 
2.32.0
From 4e048b16ede8dd65dec67ae562806b8c17270736 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:11:31 +0200
Subject: [PATCH 07/18] gnu: Add legion.

* gnu/packages/lisp-xyz.scm (cl-legion, ecl-legion, sbcl-legion): New variables.
---
gnu/packages/lisp-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index fc93aa47f8..a483c10828 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -4697,6 +4697,41 @@ (define-public cl-fast-io
 (define-public ecl-fast-io
   (sbcl-package->ecl-package sbcl-fast-io))
 
+(define-public sbcl-legion
+  (let ((commit "599cca19f0e34246814621f7fe90322221c2e263")
+        (revision "1"))
+    (package
+     (name "sbcl-legion")
+     (version (git-version "0.1.1" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/fukamachi/legion/")
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0583pw0mf8bd4dj42w2xrlzcwfkl8q28n1bh8dpxxfg93crx4si6"))))
+     (build-system asdf-build-system/sbcl)
+     (native-inputs
+      (list sbcl-prove sbcl-local-time))
+     (inputs
+      (list
+       sbcl-bordeaux-threads
+       sbcl-cl-speedy-queue
+       sbcl-vom))
+     (home-page "https://github.com/fukamachi/legion")
+     (synopsis "Simple multithreading worker mechanism for Common Lisp")
+     (description
+      "This library provides a simple multithreading worker mechanism.")
+     (license license:bsd-3))))
+
+(define-public cl-legion
+  (sbcl-package->cl-source-package sbcl-legion))
+
+(define-public ecl-legion
+  (sbcl-package->ecl-package sbcl-legion))
+
 (define-public sbcl-jonathan
   (let ((commit "1f448b4f7ac8265e56e1c02b32ce383e65316300")
         (revision "1"))
-- 
2.32.0
From c616fe249857d20ed9e7af2995837e072f9aa5cc Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:13:40 +0200
Subject: [PATCH 08/18] gnu: sbcl-jonathan: Fix tests.

* gnu/packages/lisp-xyz.scm (sbcl-jonathan)[native-inputs]: Add missing
sbcl-legion input.
[arguments]: Enable tests.
---
gnu/packages/lisp-xyz.scm | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index a483c10828..5042b8814f 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -4748,12 +4748,8 @@ (define-public sbcl-jonathan
        (sha256
         (base32 "14x4iwz3mbag5jzzzr4sb6ai0m9r4q4kyypbq32jmsk2dx1hi807"))))
      (build-system asdf-build-system/sbcl)
-     (arguments
-      ;; Tests fail with: Component JONATHAN-ASD::JONATHAN-TEST not found,
-      ;; required by #<SYSTEM "jonathan">. Why?
-      `(#:tests? #f))
      (native-inputs
-      (list sbcl-prove))
+      (list sbcl-prove sbcl-legion))
      (inputs
       (list sbcl-cl-syntax sbcl-fast-io sbcl-proc-parse sbcl-cl-ppcre))
      (home-page "https://rudolph-miller.github.io/jonathan/overview.html")
-- 
2.32.0
From e7c9ed5e5849750dce88a50eea4ad35f8433ab42 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:21:53 +0200
Subject: [PATCH 09/18] gnu: sbcl-cl-irc: Fix tests.

* gnu/packages/lisp-xyz.scm (sbcl-cl-irc)[arguments]: Specify test system.
---
gnu/packages/lisp-xyz.scm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 5042b8814f..ebf61c2c5c 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -359,7 +359,6 @@ (define-public sbcl-cl-irc
           (base32 "1b3nqbb4pj377lxl47rfgrs82pidadnrc65l48bk553c2f59b52w"))))
       (build-system asdf-build-system/sbcl)
       (native-inputs
-       ;; Tests only.
        (list sbcl-rt))
       (inputs
        `(("cl+ssl" ,sbcl-cl+ssl)
@@ -367,8 +366,7 @@ (define-public sbcl-cl-irc
          ("split-sequence" ,sbcl-split-sequence)
          ("usocket" ,sbcl-usocket)))
       (arguments
-        ;; Some inexisting "c" system is found by guix otherwise.
-       `(#:asd-systems '("cl-irc")))
+       `(#:asd-test-systems '("cl-irc-test")))
       (synopsis "IRC client library for Common Lisp")
       (description "@code{cl-irc} is a Common Lisp IRC client library that
 features (partial) DCC, CTCP and all relevant commands from the IRC
-- 
2.32.0
From 71c8687604bb37cf46f1bc43677c39ecaea3befb Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 19:58:10 +0200
Subject: [PATCH 10/18] gnu: sbcl-spatial-trees: Build spatial-trees.nss and
fix tests.

* gnu/packages/lisp-xyz.scm (sbcl-spatial-trees)[arguments]: Do it.
[inputs] Add sbcl-alexandria, sbcl-optima, sbcl-iterate.
---
gnu/packages/lisp-xyz.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index ebf61c2c5c..157564dcfe 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -985,7 +985,11 @@ (define-public sbcl-spatial-trees
            "11rhc6h501dwcik2igkszz7b9n515cr99m5pjh4r2qfwgiri6ysa"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       '(#:tests? #f)) ; spatial-trees.test requires spatial-trees.nns
+       ;; We cannot build "spatial-trees-viz" here because it depends on
+       ;; mcclim which depends on spatial-trees.  FIXME: Break the circle.
+       '(#:asd-systems '("spatial-trees" "spatial-trees.nns")))
+      (inputs
+       (list sbcl-alexandria sbcl-optima sbcl-iterate))
       (native-inputs
        (list sbcl-fiveam))
       (home-page "https://github.com/rpav/spatial-trees")
-- 
2.32.0
From d0694b81a260561afae95b675e1033871c8abdd9 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 20:13:02 +0200
Subject: [PATCH 11/18] gnu: sbcl-lisp-namespace: Enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-lisp-namespace)[arguments]: Enable tests.
---
gnu/packages/lisp-xyz.scm | 3 ---
1 file changed, 3 deletions(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 157564dcfe..9785a29ab7 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -6136,9 +6136,6 @@ (define-public sbcl-lisp-namespace
        `(("alexandria" ,sbcl-alexandria)))
       (native-inputs
        (list sbcl-fiveam))
-      (arguments
-       `(;; XXX: Component LISP-NAMESPACE-ASD::LISP-NAMESPACE.TEST not found
-         #:tests? #f))
       (synopsis "LISP-N, or extensible namespaces in Common Lisp")
       (description "Common Lisp already has major 2 namespaces, function
 namespace and value namespace (or variable namespace), but there are actually
-- 
2.32.0
From 67874a3df882362bcb110c7e1bce578a09397f94 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 20:30:32 +0200
Subject: [PATCH 12/18] gnu: sbcl-cl-heap: Re-enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-cl-heap)[arguments]: Specify the name
of the test system.
---
gnu/packages/lisp-xyz.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 9785a29ab7..985422ab13 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -7686,6 +7686,8 @@ (define-public sbcl-cl-heap
     (build-system asdf-build-system/sbcl)
     (native-inputs
      (list sbcl-xlunit))
+    (arguments
+     '(#:asd-test-systems '("cl-heap-tests")))
     (synopsis "Heap and priority queue data structures for Common Lisp")
     (description
      "CL-HEAP provides various implementations of heap data structures (a
-- 
2.32.0
From 2a6674306f1b5784664ac9bb6f40a22299c94135 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 20:46:24 +0200
Subject: [PATCH 13/18] gnu: sbcl-vas-string-metrics: Re-enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-vas-string-metrics)[arguments]: Specify the name
of the test system and fix the .asd file to actually do something.
---
gnu/packages/lisp-xyz.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 985422ab13..953e5d3158 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -8658,6 +8658,18 @@ (define-public sbcl-vas-string-metrics
          (sha256
           (base32 "11fcnd03ybzz37rkg3z0wsb727yqgcd9gn70sccfb34l89ia279k"))))
       (build-system asdf-build-system/sbcl)
+      (arguments
+       '(#:asd-test-systems '("test.vas-string-metrics")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-test-asd
+             (lambda _
+               (substitute* "test.vas-string-metrics.asd"
+                 ((":depends-on")
+                  (string-append
+                   ":perform (test-op (op c) (symbol-call :vas-string-metrics :run-tests))"
+                   "\n"
+                   "  :depends-on"))))))))
       (home-page "https://github.com/vsedach/vas-string-metrics")
       (synopsis "String distance algorithms for Common Lisp")
       (description
-- 
2.32.0
From 3da4d4ce53ff539d194c0da464e75f507c3d730d Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 20:50:06 +0200
Subject: [PATCH 14/18] gnu: sbcl-hdf5-cffi: Enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-hdf5-cffi)[arguments]: Do it.
---
gnu/packages/lisp-xyz.scm | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 953e5d3158..f4b9cae360 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -9502,11 +9502,7 @@ (define-public sbcl-hdf5-cffi
       (native-inputs
        (list sbcl-fiveam))
       (arguments
-       `(;; Tests depend on hdf5-cffi.examples.asd in addition to hdf5-cffi.asd,
-         ;; I don't know if there is a way to tell asdf-build-system to load
-         ;; an additional system first, so tests are disabled.
-         #:tests? #f
-         #:phases
+       `(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'fix-paths
              (lambda* (#:key inputs #:allow-other-keys)
-- 
2.32.0
From 28e8197a9e65dd9a2dac7d6ce25d3fd14ece8b11 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 21:09:52 +0200
Subject: [PATCH 15/18] gnu: Add mw-equiv.

* gnu/packages/lisp-xyz.scm (cl-mw-equiv, ecl-mw-equiv, sbcl-mw-equiv): New variables.
---
gnu/packages/lisp-xyz.scm | 52 +++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)

Toggle diff (65 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f4b9cae360..6a2156f7cd 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -10836,6 +10836,58 @@ (define-public cl-clx-xembed
 (define-public ecl-clx-xembed
   (sbcl-package->ecl-package sbcl-clx-xembed))
 
+(define-public sbcl-mw-equiv
+  (let ((commit "3ae871458685b1ef7cd6a996ee22c8c5e738a03d")
+        (revision "1"))
+    (package
+      (name "sbcl-mw-equiv")
+      (version (git-version "0.1.2" revision commit))
+      (home-page "https://github.com/sharplispers/mw-equiv/")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/sharplispers/mw-equiv/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1fl90wp0jp7l90mps53fq0kzb28f10qfr739527h03xwqccyylad"))))
+      (build-system asdf-build-system/sbcl)
+      (synopsis "Extensible object equivalence protocol for Common Lisp")
+      (description "Common Lisp comes with quite some functions to compare
+objects for equality, yet none is applicable in every situation and in general
+this is hard, as equality of objects depends on the semantics of operations on
+them.  As consequence, users find themselves regularly in a situation where
+they have to roll their own specialized equality test.
+
+This module provides one of many possible equivalence relations between
+standard Common Lisp objects.  However, it can be extended for new objects
+through a simple CLOS protocol.  The rules when two objects are considered
+equivalent distinguish between @emph{mutating} and @emph{frozen objects}.  A
+frozen object is promised not to be mutated in the future in a way that
+operations on it can notice the difference.
+
+We have chosen to compare mutating objects only for identity (pointer
+equality), to avoid various problems.  Equivalence for frozen objects on the
+other hand is established by recursing on the objects' constituent parts and
+checking their equivalence.  Hence, two objects are equivalent under the
+@code{OBJECT=} relation, if they are either identical, or if they are frozen
+and structurally equivalent, i.e. their constituents are point-wise
+equivalent.
+
+Since many objects are potentially mutable, but are not necessarily mutated
+from a certain point in their life time on, it is possible to promise to the
+equivalence relation that they remain frozen for the rest of their life time,
+thus enabling coarser equivalence than the often too fine-grained pointer
+equality.")
+      (license license:bsd-2))))
+
+(define-public cl-mw-equiv
+  (sbcl-package->cl-source-package sbcl-mw-equiv))
+
+(define-public ecl-mw-equiv
+  (sbcl-package->ecl-package sbcl-mw-equiv))
+
 (define-public sbcl-quantile-estimator
   (package
     (name "sbcl-quantile-estimator")
-- 
2.32.0
From e0a00f33226849beb4c436ccc74352fbb6b02e75 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 21:10:05 +0200
Subject: [PATCH 16/18] gnu: sbcl-quantile-estimator: Enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-quantile-estimator)[arguments]: Do it.
[native-inputs]: Add sbcl-mw-equiv, sbcl-prove, sbcl-log4cl.
---
gnu/packages/lisp-xyz.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 6a2156f7cd..3f78cc2b9b 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -10904,11 +10904,11 @@ (define-public sbcl-quantile-estimator
          "0rlswkf0siaabsvvch3dgxmg45fw5w8pd9b7ri2w7a298aya52z9"))))
     (build-system asdf-build-system/sbcl)
     (arguments
-     '(#:asd-test-systems '("quantile-estimator.test")
-       ;; TODO: Tests need https://github.com/sharplispers/mw-equiv.
-       #:tests? #f))
+     '(#:asd-test-systems '("quantile-estimator.test")))
     (inputs
-     `(("alexandria" ,sbcl-alexandria)))
+     (list sbcl-alexandria))
+    (native-inputs
+     (list sbcl-mw-equiv sbcl-prove sbcl-log4cl))
     (home-page "https://github.com/deadtrickster/quantile-estimator.cl")
     (synopsis
      "Effective computation of biased quantiles over data streams")
-- 
2.32.0
From 0cbf96a85f9f9595dcaf5b728ae4d237af24ea21 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 21:12:26 +0200
Subject: [PATCH 17/18] gnu: sbcl-cl-online-learning: Remove unnecessary
arguments.

* gnu/packages/lisp-xyz.scm (sbcl-cl-online-learning)[arguments]: Do it.

The updated build system is now able to find the system on its own.
---
gnu/packages/lisp-xyz.scm | 3 ---
1 file changed, 3 deletions(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 3f78cc2b9b..20c7c10ee2 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -11332,9 +11332,6 @@ (define-public sbcl-cl-online-learning
       (inputs
        `(("cl-libsvm-format" ,sbcl-cl-libsvm-format)
          ("cl-store" ,sbcl-cl-store)))
-      (arguments
-       `(#:asd-systems '("cl-online-learning-test"
-                         "cl-online-learning")))
       (home-page "https://github.com/masatoi/cl-online-learning")
       (synopsis "Online Machine Learning for Common Lisp")
       (description
-- 
2.32.0
From e7c633fcadd723f86166bee6b05b098935bef1be Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Mon, 4 Jul 2022 21:46:56 +0200
Subject: [PATCH 18/18] gnu: sbcl-jzon: Enable tests.

* gnu/packages/lisp-xyz.scm (sbcl-jzon)[arguments]: Move test system
to #:asd-test-systems.
Add phase to fix test .asd to actually run the tests.
---
gnu/packages/lisp-xyz.scm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 20c7c10ee2..cf4f6ffde6 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -21183,7 +21183,19 @@ (define-public sbcl-jzon
           (base32 "1048f6prz2lp859nxwcgghn6n38pc2pb580azzxpdhfcdi0034mj"))))
       (build-system asdf-build-system/sbcl)
       (arguments
-       '(#:asd-systems '("com.inuoe.jzon" "com.inuoe.jzon-tests")))
+       '(#:asd-systems '("com.inuoe.jzon")
+         #:asd-test-systems '("com.inuoe.jzon-tests")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-test-asd
+             (lambda _
+               (substitute* "test/com.inuoe.jzon-tests.asd"
+                 ((":depends-on")
+                  (string-append
+                   ":perform (test-op (op c) (symbol-call :fiveam :run!"
+                   " (find-symbol \"JZON\" :com.inuoe.jzon-tests)))"
+                   "\n"
+                   "  :depends-on"))))))))
       (native-inputs
         (list sbcl-alexandria
               sbcl-fiveam
-- 
2.32.0
P
P
Pierre Neidhardt wrote on 5 Jul 10:56 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
87edz0os32.fsf@ambrevar.xyz
While we are rebuilding the Lisp world, I suggest we remove Coreutils
from the SBCL closure since it's only needed on LispWorks and on
non-Linux:

Toggle snippet (17 lines)
(add-after 'install 'remove-coreutils-references
;; They are only useful on non-Linux, non-SBCL.
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(share-dir (string-append out "/share/sbcl/")))
(substitute* (string-append share-dir "src/code/run-program.lisp")
(("\\(run-program \".*uname\"")
"(run-program \"uname\""))
(substitute* (string-append share-dir "contrib/asdf/asdf.lisp")
(("\\(\".*/usr/bin/env\"")
"(\"/usr/bin/env\""))
(substitute* (string-append share-dir "contrib/asdf/uiop.lisp")
(("\\(\".*/usr/bin/env\"")
"(\"/usr/bin/env\""))

#t)))
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLD/NESHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/5fUIAImr260T3mc3j03S0i++uYP9MAnN+0tT
UE9y81Xy9Rtu/xGdtiILQFPGFS8tbje4GHhYL52E3tYNdCC0Ww1AlN5sM12nI1nQ
AAXZElyQdqmrxA+0pizFmXxAPxlh81qtPln/a9OQBSKwjPCQICC2+JTtd+8lRXWi
RE8mJHlk0Rdvn8vDNgQYhO3RsvM8JYgb4njjducbBmt58SbW3bHD6X1/eGY9nrQB
G7LgFZZOwauhFOzzy4Zg6oPJNS32SBfRfAeLXAQjK58dYkHP5xP9hVjmZf/Uc+Hl
l1+AvwAt/4Mh5I8ZTBs5PVjp4ZORg6/BjNd4Q736mrmQUOZgpAOaRqM=
=II63
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 17 Jul 18:19 +0200
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334@debbugs.gnu.org)
875yjvsod1.fsf@ambrevar.xyz
I've pushed the SBCL closure size reduction.

I'll be the road for a while, unable to work on this patch, so if anyone
wants to work on it and merge, please go ahead :)

Left to do:

- Suggestion: add a keyword to choose between asdf:compile-system and
asdf:load-system (default should be asdf:load-system).
- Make sure sbcl-stumpwm-kbd-layouts usees asdf:compile-system.
- Rebuild the Lisp world to test.

Cheers!
Pierre
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLUNqoSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/SfIH/2LU7dr1CqEEeiqYLnDUTBdahtzsADbH
ih0dSTtOluFbzWWokSEDKQI2fN2syuGnUk+DUSGvFm8Umuoq5ftQYpkHYQM8UuXa
AGysbzo5Ox9o67njp4dZ+SJP1ZLkZ2lb39KrUtZakjkb7J0e45yCImjscDAV6DWi
eRTiRMp+gmKjHCyk8jmXoC2pXIozp1ix+b5vShZHRwBBYRZgeMMY/fPqNZyC63Kz
rP43Lt5/MvfTy6EFTsemups5AybseQndmUsmP6PyRBYyLrqi3UUSj1y3QT39z5NC
Yqr/QhlIFtEqwGxmdwbqNvDBqf/clqa/s1rhBpCAH8hAML8DNrHBVW0=
=kzwI
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote 7 days ago
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 56334-done@debbugs.gnu.org)
875yj974v2.fsf@kitej
Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (10 lines)
> I'll be the road for a while, unable to work on this patch, so if anyone
> wants to work on it and merge, please go ahead :)
>
> Left to do:
>
> - Suggestion: add a keyword to choose between asdf:compile-system and
> asdf:load-system (default should be asdf:load-system).
> - Make sure sbcl-stumpwm-kbd-layouts usees asdf:compile-system.
> - Rebuild the Lisp world to test.

I added a 'asd-operation' keyword parameter with a default value of
"load-system", and I used it in the package definition of
sbcl-stumpwm-kbd-layouts to use "compile-system" instead.

Patches pushed as 6b5ef03a2582ab23228478018fd356e17db1daea and
following.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYuqMog8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+4RgD/ZtlSwXSwWUWEP2pvEIy/5R5Zw3tktUNJOU+2
EJL7LOUBAI9CMSnPCy5JCUrC455KcxVly+iFMPHzO6gX4XQRaDUR
=xX79
-----END PGP SIGNATURE-----

Closed
P
P
Pierre Neidhardt wrote 6 days ago
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 56334-done@debbugs.gnu.org)
87v8r8ds5z.fsf@ambrevar.xyz
Excellent, thanks a lot! :)
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmLr0SgSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/Tl0H/R//ha5JXUjQ14fab9CLe8wRDyjH00uB
CFPliPyUYvU3rrGADDbuqnZgV1kvhytx4+x9N11py7SZceTW3BBMABGZ9Py0uWsm
q2W+bQGE392vxPcdQ+fYXpjCc5QUFncLXAYpnsee8F1J0rqI2Ihnsld/HOvnGAta
9XquQBt5oO6I3i2o0r7ZIDmxz/IEYf5DQzSg6FQij45hmp8HHpDPeEzbKJYQYpyc
ntgmatdEdoYMIQ/RJR1Z4AqrEEuOkYhaymkcjuETffwHcMMM+tIcSQRtUEjsVKbO
URfaiTSi72CBBoONMEZylnUaJOYNbuR2rJJM6nmES9g6BCZc9vMocsM=
=Ug7p
-----END PGP SIGNATURE-----

Closed
?