XDG Base Directory Specification missing for executable installation location
It has become fairly common practice to install executables that don't need to be available to all users in the user's home dir, typically at ~/.local/bin
. While this is rather common practice, some users set things up otherwise, and it's always possible for some distro to make a change to that convention.
When that occurs, and just as a matter of having a documented standard about what should be happening, it's useful to have some common reference as to where to put executables that are being installed on a user level, e.g. by Python's pip
, or Rust's cargo
.
This was tossed around in the XDG basedir spec around 0.7, but it seems discussion dwindled and disappeared, though the name XDG_BIN_HOME
was discussed here, and Simon McVittie also tossed out XDG_PREFIX
or XDG_LOCAL_INSTALL
as alternatives.
There didn't seem to be any disagreement that it could be useful, just as to whether or not it's desired or would be considered useful. Speaking in reference to a Rust issue that's been open for a while on conforming to the XDG Basedir spec, yes, this is desirable.
From the spec,
$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
I think that the name $XDG_BIN_HOME
fits in nicely with the other variable names, and a good statement for it could be:
$XDG_BIN_HOME defines the base directory relative to which user specific executable files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/bin should be used. $XDG_BIN_HOME may be and typically is in the user's $PATH, but the path in $XDG_BIN_HOME should not be added to the user's $PATH unless such action is specified by the user.