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

Support XDG or platform-specific paths for .erlang and .erlang.cookie files #5016

Closed
hauleth opened this issue Jun 30, 2021 · 2 comments · Fixed by #5408
Closed

Support XDG or platform-specific paths for .erlang and .erlang.cookie files #5016

hauleth opened this issue Jun 30, 2021 · 2 comments · Fixed by #5408
Assignees
Labels
enhancement team:VM Assigned to OTP team VM

Comments

@hauleth
Copy link
Contributor

hauleth commented Jun 30, 2021

Is your feature request related to a problem? Please describe.

Due to unfortunate decision of early UNIX developers to use path[0] == '.' instead of strcmp(path, ".") || strcmp(path, "..") in ls when filtering out the default paths, people started to using "dotfiles" stored in the $HOME of the current user to provide configuration and runtime commands for various files. Erlang currently follows that unfortunate trend in form of .erlang and .erlang.cookie files. To solve that mess that is all the dotfiles in home directory and all of mixing of configuration, caches, logs, data, etc. in the same directories and/or more files in home directory. Erlang already uses platform-specific paths for shell history, but .erlang and .erlang.cookie are still where these were before.

Describe the solution you'd like

Use either XDG Base Directory specification on all OSes or platform-specific approach for all files. This could be implemented in a way that "old" paths are fallbacks if the "new" files do not exists.

Describe alternatives you've considered

Do nothing.

@KennethL KennethL added the team:VM Assigned to OTP team VM label Jul 5, 2021
@garazdawi
Copy link
Contributor

I had a look at this. Doing it for .erlang is no problem.

However for .erlang.cookie I'm unsure about where the generated cookie should be placed. I think that in order to keep backward compatibility, it would need to be placed in ~/.erlang.cookie. That way jinterface, erl_interface and old erlang versions would still use the same default created cookie.

@garazdawi garazdawi self-assigned this Oct 25, 2021
@hauleth
Copy link
Contributor Author

hauleth commented Oct 25, 2021

The .erlang.cookie can be phased out in multi-step approach. It first can be left as is, and read XDG cookie if exists, then make position of .erlang.cookie configurable, then warn if .erlang.cookie position is not set, and then move to the new position. In that way the transition should be done somewhere around OTP 30.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants