emscripten-core / emscripten-core/emscripten
Respect the XDG Base Directory Specification
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.