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

[Modular CLI]: Do follow Freedesktop's XDG Base Directory Specification #739

Closed
gdonval opened this issue Sep 11, 2023 · 5 comments
Closed
Labels
enhancement New feature or request modular-cli modular tool issues mojo-repo Tag all issues with this label

Comments

@gdonval
Copy link

gdonval commented Sep 11, 2023

Issue description

modular behaves like a punk, trying to dump state and garbage in ~/.modular.

Please follow the XDG Base Directory Specification. The minimum would be following $XDG_CONFIG_HOME/modular (falling back to ~/.config/modular if not set). You could also use $XDG_STATE_HOME/modular to store auth tokens for the time being (defaults to ~/.local/state/modular). I am not sure yet where mojo is eventually installed, but $XDG_DATA_HOME/modular/mojo (defaulting to ~/.local/share/modular) would probably be the right place for a user install.

Steps to reproduce

  • rm -rf ~/.modular
  • chmod -R a-w ~/
  • modular auth XXX
    modular: error: ~/.modular could not be created: Permission denied

Version Info

- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.1.4 (6b54d308)

- What OS did you install modular CLI on ?
Ubuntu
@gdonval gdonval added the modular-cli modular tool issues label Sep 11, 2023
@dualvtable dualvtable added the enhancement New feature or request label Sep 11, 2023
@zbowling
Copy link

A partial workaround today is to set MODULAR_HOME to your $XDG_CONFIG_HOME.

Eg:

export MODULAR_HOME="$XDG_STATE_HOME/modular"
modular auth ...
modular install ...

@bzcheeseman
Copy link
Contributor

Closing since a workaround exists, and this is not on our roadmap.

@gdonval
Copy link
Author

gdonval commented Sep 16, 2023

Put it on your roadmap. Not following standards is not "playing nicely".

Your workaround is just that, a workaround. If what you were providing was a toaster, I would be complaining that providing a toaster with a UK power plug in the US does not make sense: follow the standards. Your workaround is akin to telling people to have a UK power socket fitted in your US home, when what I ask for is a converter on the plug you provide.

@ksandvik
Copy link

There is a workaround and the future of the installation system could change.

@gdonval
Copy link
Author

gdonval commented Sep 17, 2023

Not if you don't put it on your roadmap.

Changing a custom, Modular-specific, environment variable is not following the standard. I'm not even sure why you think that is. The default should be .config/modular or $XDG_CONFIG_HOME/modular with your custom variable overriding that if set.

The fix is super easy, if the code wasn't closed, I could provide one in 20 minutes max, without having had a look at the code before.

The problem with this is that if left alone, there will be always someone to complain in the dev team that ~/.modular has always been the place and it will be rejected because "users would be confused". Modular is offensive to Linux users, not playing along, forcing them to do something special (i.e. fitting UK power sockets in US homes) to get it work as intended. Just provide the right power cable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request modular-cli modular tool issues mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

6 participants