user-configuration-directories suboptimal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
E-mail and response from Robert:
Jason Miller wrote:
> Hi,
>
> With $XDG_CONFIG_DIRS unset, (uiop:user-
> returns only $XDG_CONFIG_
>
> However, with it set to "/etc/xdg" it returns a list that starts with
> "/etc/xdg/
>
> There are two problems with this:
>
> 1) The XDG Base Directory Specification says that "If $XDG_CONFIG_DIRS is
> either not set or empty, a value equal to /etc/xdg should be used."
>
> 2) My understanding of uiop:user-
> listed in order of importance, but, from the XDG spec:
>
> "The base directory defined by $XDG_CONFIG_HOME is considered more
> important than any of the base directories defined by
> $XDG_CONFIG_DIRS"
>
> So, what I think is correct is that with $XDG_CONFIG_DIRS set it should
> return a list starting with $XDG_CONFIG_HOME, followed by the lists in
> $XDG_CONFIG_DIRS, and with it not set, should return a list of
> $XDG_CONFIG_HOME followed by /etc/xdg/
>
> Even if that's not correct, due to #1 the current implementation is
> definitely wrong.
>
> Regards,
> Jason
>
1. Please put a ticket to this effect on the launchpad bugs page,
https:/
2. I am not sure that this is a bug. The XDG specifies how a general
framework for user configuration should operate. But AFAICT
UIOP:USER-
specified by this standard, but rather, claims to return a list of user
configuration directories *FOR COMMON LISP* that somehow comply with the
specification. I.e., adding "common-lisp/" is acceptable.
I'm not sure about this since the documentation string for the UIOP
function does not clearly state what it claims to be supplying.
"Determine user configuration directories" is not specific enough to
support claims about whether the implementation is correct or buggy.
3. If we can determine that the implementation is erroneous, I would
welcome patches that would fix it. I do not plan to try to fix it
myself. I don't use this means of configuration, and don't have the time
to investigate it, or the specification that underlies it. I still use
ASDF:*CENTRAL-
in common lisp without using a DSL or wandering off into configuration
files which the shell will hide from me when I am confused about my
configuration.
Best,
r
Changed in asdf: | |
status: | Fix Committed → Fix Released |
After that e-mail, I dug a bit and found a few things:
1) Other parts of ASDF that claim to implement the XDG standard do use this function
2) A few other people do use (in-user- configuration- directory) to generate their own configuration files; this will break on e.g. Gentoo linux which sets XDG_CONFIG_DIRS but not XDG_CONFIG_HOME; this is how I originally stumbled upon this
3) We actually do prioritize XDG_CONFIG_HOME over XDG_CONFIG_DIRS when both are set, but we don't ever provide a fallback value for either of them; we manually add in $HOME/. config/ common- lisp at the end.
The fix is fairly simple: just insert the default values if either of the two environment variables we query isn't set. I've attached a patch that does it one way. Another way that might be preferrable would be to extend getenvp to take a default value.