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

Open
runiq opened this issue Jul 18, 2024 · 1 comment
Open

Precedence in XDG_CONFIG_DIRS is handled wrongly #4582

runiq opened this issue Jul 18, 2024 · 1 comment
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Breaking changes
Development

No branches or pull requests

2 participants