Open Gankra opened 6 months ago
On Unix in particular, we should adopt the FHS layout. This lines up with the layouts used by both Linux and macOS. The paths we install to should be, essentially, mini FHS layouts with bin
for binaries, lib
for libraries, and we can consider things like share
for config, etc.
We use a version of this today in the Homebrew installer config.
so there was a long discussion in our internal channel about the merits of this normalization, which i will do my best to summarize here for a future design conversation in the near future.
bin dir
config key that defaults to .
(current behavior) but can be set to "bin"
to achieve the new behavior, and we can see how that plays out with usersbin suffixing
(an alias for this proposed feature) could work in our current install directory feature, but it would potentially make it harder to maintain. she elaborated that the updater and the installer need to communicate about the bin suffix being appended and implied that that was already pretty complexpersonally speaking i think what i've realized typing this out is that if we go with this heirarchical structure, we are assuming that the dir a user is providing is not shared by multiple apps (likely using a different install/release process, and/or outside the repo). this comes down to the question- should an install dir and an app be 1:1. currently we take no stand on this, but i do think adding more structure means that we need to have a stronger opinion on this and/or let folks choose/opt-in to structures.
i started drawing this out in miro but typing file systems sucks so i didn't finish but hopefully this gestures at the issue. drawing this- another solution here is to have users make their install dir namespaced if they know they are publishing multiple apps there.
Because we initially regarded the CARGO_HOME structure as "overkill" the
~/some/path
and$MY_ENV_VAR/some/path
installdir strategies do not make a separatebin/
subfolder, which limits the scalability of the approach somewhat, and adds a ton of special case paths to installers/updaters.Also the MSI installer really does its own thing altogether when installing to ProgramFiles.
We should change everything to be shaped like CARGO_HOME, with
./bin/
and./env
(on unix), with room to expand to having libs dirs as well.This will require migrating existing users of
~/some/path
, but will be good longterm.