GNU bug report logs - #45017
asdf-build-system packages have priority over user ones

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Thu, 3 Dec 2020 09:43:02 UTC

Severity: normal

Done: Guillaume Le Vaillant <glv <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 45017 <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 45017 <at> debbugs.gnu.org
Subject: Re: asdf-build-system packages have priority over user ones
Date: Sat, 05 Dec 2020 11:03:21 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> Tested!
>
> I've installed sbcl to my "common-lisp" profile along quri.
> I've also cloned quri to ~/common-lisp.
>
> Then:
>
> --8<---------------cut here---------------start------------->8---
> $ sbcl
> * (asdf:locate-system :quri)
> T
> NIL
> #P"/gnu/store/5gj1inwiqpn2fm9w384zd0grpyadx96m-sbcl-quri-0.1.0-2.b53231c/share/common-lisp/sbcl/quri/quri.asd"
> NIL
> NIL
> NIL
>
> ;; Indeed:
> * (asdf:user-source-registry-directory)
> #P"/gnu/store/75qppl3a062b138fkrn324qq8f912zqh-profile/etc/common-lisp/source-registry.conf.d/"
> --8<---------------cut here---------------end--------------->8---
>
> It does not work because the sbcl package definition sets the
> XDG_CONFIG_DIRS native search path which is picked by
> user-source-registry-directory, which has higher priority than
> default-user-source-registry.
>
> I think the flaw is ASDF's this time:
>
> --8<---------------cut here---------------start------------->8---
>   (defun user-source-registry-directory (&key (direction :input))
>     (xdg-config-pathname *source-registry-directory* direction))
>
> ;...
>
>   (defun xdg-config-pathnames (&rest more)
>     "Return a list of pathnames for application configuration.
> MORE may contain specifications for a subpath relative to these directories: a
> subpathname specification and keyword arguments as per RESOLVE-LOCATION \(see
> also \"Configuration DSL\"\) in the ASDF manual."
>     (filter-pathname-set
>      `(,(xdg-config-home more)
>        ,@(xdg-config-dirs more))))
> --8<---------------cut here---------------end--------------->8---
>
> So the user registry looks into XDG_CONFIG_DIRS, while really it should
> just look at XDG_CONFIG_HOME.
>

The same test works for me. I think it's because I have
a ".config/common-lisp/source-registry.conf.d" directory (even if it's
empty), and '(user-source-registry-directory)' returns it instead of the
first directory in XDG_CONFIG_DIRS.

> So this patch should do (untested):
>
> --8<---------------cut here---------------start------------->8---
> - (defun user-source-registry-directory (&key (direction :input))
> -   (xdg-config-pathname *source-registry-directory* direction))
> + (defun user-source-registry-directory (&key (direction :input))
> +   (find-preferred-file (list (xdg-config-home *source-registry-directory*)) :direction direction))
> --8<---------------cut here---------------end--------------->8---
>
> If you confirm, then we should also report upstream I think.
>
> Cheers!

I don't know if the fact that ASDF can give priority to XDG_CONFIG_DIRS
over "~/common-lisp" is a feature or a bug, so you could ask upstream.
Anyway in our case, your patch makes sense since we always want to give
priority to "~/common-lisp" and other usual user directories. I'll add
it to our patch for cl-asdf.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.