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

Incorrect implementation of XDG Base Directory spec #455

Open
nelind3 opened this issue Jan 7, 2024 · 0 comments · May be fixed by #456
Open

Incorrect implementation of XDG Base Directory spec #455

nelind3 opened this issue Jan 7, 2024 · 0 comments · May be fixed by #456

Comments

@nelind3
Copy link

nelind3 commented Jan 7, 2024

Describe the bug
If you run mcaselector on a linux system that has flatpak installed the log files will end up in ~/.local/share/flatpak/exports/share/mcaselector (or equivalent if XDG_DATA_HOME is set). This happens because mcaselector incorretly writes to the first directory set in XDG_DATA_DIRS if XDG_DATA_HOME isn't set.

To Reproduce
Steps to reproduce the behavior:

  1. Install flatpak on any linux distro that implements XDG Base Directory
  2. Set up mcaselector
  3. mcaselector log files will end up in the wrong place

Expected behavior
If XDG_DATA_HOME isnt set mcaselector should fall back to ~/.local/share/mcaselector as that is the fallback specified in the spec (same goes for XDG_CONFIG_DIRS and its default ~/.config).
As per the XDG Base Directory spec XDG_DATA_DIRS and XDG_CONFIG_DIRS should only be searched for pre-existing data and config files new files shouldnt be written to any of the set directories. See the 6th and 7th points in the bullet point list in the spec under Basics. This is why most distros will not set most of the XDG Base Directory env variables because they explicitly fall back to their respective default paths and not XDG_DATA_DIRS or XDG_CONFIG_DIRS.
Additionally as of version 0.8 of the XDG Base Directory spec log files should be put in XDG_STATE_HOME (defaulting to ~/.local/state) instead of XDG_DATA_HOME. See the relevant section of the Environment Variables section of the spec

Environment (please complete the following information):

  • OS: Linux (Fedora linux in my case but any modern distribution will have the same issue)
  • Java version: 17.0.9
  • Version of MCA Selector: as far as i can see in App does not use OS cache directories #127 any version after 1.12.3 will exhibit this behaviour
@nelind3 nelind3 linked a pull request Jan 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant