Subject: bug#45017: asdf-build-system packages have priority over user ones

From: Pierre Neidhardt <[email-masked]>
Date: Thu, 03 Dec 2020 13:40:02 +0100

Oh, I had missed that!  Good thing I asked you first then ;)

> --8<---------------cut here---------------start------------->8---
> (substitute* dst-asdf
>   (("\\(xdg-config-pathname \\*source-registry-directory\\* direction\\)")
>    "`(:source-registry
>       (:include (xdg-config-home \"common-lisp/source-registry.conf.d/\"))
>       ,@(loop
>            for dir in (xdg-config-dirs
>                        \"common-lisp/source-registry.conf.d/\")
>            collect `(:include ,dir))
>       :inherit-configuration)")
>   (("\\(xdg-config-pathname \\*output-translations-directory\\* direction\\)")
>    "`(:output-translations
>       (:include (xdg-config-home \"common-lisp/asdf-output-translations.conf.d/\"))
>       ,@(loop
>            for dir in (xdg-config-dirs
>                        \"common-lisp/asdf-output-translations.conf.d/\")
>            collect `(:include ,dir))
>       :inherit-configuration)")))
> --8<---------------cut here---------------end--------------->8---

Hmm, I don't think this would work when the user has no
~/.config/common-lisp/source-registry.conf.
Would it?

> Or maybe we could make a better patch not changing
> 'user-source-registry-directory', but adding a new
> 'guix-source-registry' between 'default-user-source-registry' and
> 'system-source-registry' in the list of registries (and likewise for
> output-translations).
> I think this way the systems in '$HOME/.config/...', '$HOME/.local/...'
> or '$HOME/common-lisp/...' will have priority on the ones in Guix
> profiles.

I like it!

Possible pitfall: if the user set *default-source-registries* in their
Lisp RC file (e.g. ~/.sbclrc) this will prevent ASDF from seeing this
new Guix source registry.

Alternately, we could simply move the patch from
user-source-registry-directory to system-source-registry-directory; same
for the output translation.

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/