-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Respect the XDG Base Directory Specification #3624
Comments
Emscripten uses Python for this - do you know if there is a good way to do it in Python, that would automatically work across platforms? Right now we just ask Python for the "home dir", I am wondering if there is a proper way to get the right XDG dir. |
There is pyxdg available in pypi, but I think it would be best to only take the relevant functions, as they are simple enough to not warrant a dependency. |
I agree it would be better to not take a dependency for this. |
I'd like to add to the list following files besides mentioned that appear in my setup):
What Emscripten currently does in home directory is a mess. |
This is avoided at least when using Emscripten SDK, if the SDK is configured in |
The file |
Good to know I can remove those files, but the thing is that they shouldn't be created directly in my home directory in the first place. |
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Issue is still relevant |
I've noticed other projects (like e.g. wasmer) creating a single directory |
Well, I don't like that many apps decide they are important enough to create own directory in my |
I agree with @nazar-pc here. However I kind of have plan to try to eliminate stuff from the home directory in most cases. But after I'm done I'll be sure that any remaining stuff goes in ~/.config, ~/.cache and ~/.local. We basically have three types of users:
3 and 4 are basically the same. Not that (1) and especially (2) may not have write access to the emscripten directory. However (1) and (2) also shouldn't need a config file at all because it all pre-configured for them. In my ideal world the emscripten config belongs in the emscripten directory itself and any ports that get build belong in emscripten/system/usr/.. somewhere. I looks like this idea was started with the Anyway.. I'm hijacking this issue here. I should start a fresh one. |
It would be nice to have some documentation of what files are for what purpose so package maintainers can also write their own script to populate to appropriate xdg directories instead of relying on pyhon. So far I can deduce that *.bat are DOS files and not needed for Linux/Mac, and cmake can be installed in appropriate cmake sub-directory. But I'm not sure about site, src, system, and tools. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Here is some activity, ridiculous bot usage. |
Currently, emscripten is putting a bunch of files right in the user’s home directory. This needlessly pollute the home directory with files whose role isn’t always obvious to the user.
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html is a specification in use since about 2003 which describes where to put application files using simple rules, in user-modifiable directories.
On my system there are four files and directories being created, I would suggest moving them that way:
$HOME/.emscripten
→$XDG_CONFIG_HOME/emscripten/config
(defaults to$HOME/.config/emscripten/config
)$HOME/.emscripten_cache__last_clear
→$XDG_CACHE_HOME/emscripten/last_clear
(defaults to$HOME/.cache/emscripten/last_clear
)$HOME/.emscripten_sanity
→$XDG_CACHE_HOME/emscripten/sanity
(defaults to$HOME/.cache/emscripten/sanity
)$HOME/.emscripten_ports
→$XDG_DATA_HOME/emscripten/ports
(defaults to$HOME/.local/share/emscripten/ports
)I’m not totally sure how to handle that in a cross-platform way, on Linux and *BSD it’s a given this scheme is expected by users, but OSX and Windows have different default directories I think, so you might want to keep the old location for them.
There is also the issue of migration, I don’t know how exactly you would want to handle that, if it is ok to just move the old files to their new location, or if you prefer to read the new location and if there is no file there to fallback to the legacy one, or just to change the location without bothering with any migration plan.
The text was updated successfully, but these errors were encountered: