Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precedence in XDG_CONFIG_DIRS is handled wrongly #4582

Closed
runiq opened this issue Jul 18, 2024 · 2 comments
Closed

Precedence in XDG_CONFIG_DIRS is handled wrongly #4582

runiq opened this issue Jul 18, 2024 · 2 comments
Labels
Milestone

Comments

@runiq
Copy link

runiq commented Jul 18, 2024

Per the XDG basedir spec:

The order of base directories denotes their importance; the first directory listed is the most important. When the same information is defined in multiple places the information defined relative to the more important base directory takes precedent.

Meaning that, if I set XDG_CONFIG_DIRS to $HOME/hi:$HOME/lo, then $HOME/hi should have higher priority.

EasyBuild handles this the wrong way, though:

$ export XDG_CONFIG_DIRS=$HOME/hi:$HOME/lo
$ mkdir -p $HOME/{hi,lo}/easybuild.d
$ touch $HOME/{hi,lo}/easybuild.d/bla.cfg
$ eb --show-default-configfiles
Default list of configuration files:

[with $XDG_CONFIG_HOME: (not set), $XDG_CONFIG_DIRS: /home/runiq/hi:/home/runiq/lo]

* user-level: ${XDG_CONFIG_HOME:-$HOME/.config}/easybuild/config.cfg
  -> /home/runiq/.config/easybuild/config.cfg => found
* system-level: ${XDG_CONFIG_DIRS:-/etc}/easybuild.d/*.cfg
  -> {/home/runiq/hi, /home/runiq/lo}/easybuild.d/*.cfg => /home/runiq/hi/easybuild.d/bla.cfg, /home/runiq/lo/easybuild.d/bla.cfg

Default list of existing configuration files (3): /home/runiq/hi/easybuild.d/bla.cfg, /home/runiq/lo/easybuild.d/bla.cfg, /home/runiq/.config/easybuild/config.cfg
@boegel boegel added this to the 5.0 milestone Jul 31, 2024
@boegel boegel added the EasyBuild-5.0 EasyBuild 5.0 label Jul 31, 2024
@boegel boegel moved this to Breaking changes in EasyBuild v5.0 Aug 26, 2024
@boegel
Copy link
Member

boegel commented Sep 9, 2024

@bartoldeman Was this fixed via #4591?

bartoldeman added a commit to bartoldeman/easybuild-framework that referenced this issue Sep 11, 2024
https://specifications.freedesktop.org/basedir-spec/latest/
says precedence should be

XDG_CONFIG_HOME > 1st entry of XDG_CONFIG_DIRS > 2nd entry ...

EasyBuild had this reversed for XDG_CONFIG_DIRS

Fixes easybuilders#4582
@boegel
Copy link
Member

boegel commented Nov 6, 2024

fixed by #4630

@boegel boegel closed this as completed Nov 6, 2024
@boegel boegel removed this from EasyBuild v5.0 Nov 6, 2024
lexming pushed a commit to lexming/easybuild-framework that referenced this issue Nov 10, 2024
https://specifications.freedesktop.org/basedir-spec/latest/
says precedence should be

XDG_CONFIG_HOME > 1st entry of XDG_CONFIG_DIRS > 2nd entry ...

EasyBuild had this reversed for XDG_CONFIG_DIRS

Fixes easybuilders#4582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants