axodotdev / axodotdev/cargo-dist
Feature: more install layouts
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
We have support for several kinds of install *locations*, and we're considering changing the default (refs #1194). However, we also need to support more install *layouts* than the ones we have right now.
We have one - sort of two - layouts at the moment, which I'd term "just a bunch of files". We install everything into a single directory[^1], with one minor exception[^2]. This gives us some problems for libraries, however, which we don't want installed alongside bins for a few reasons:
1. We don't want them on the `$PATH`, where autocomplete and other shell things will mistake them for runnable binaries;
2. The user may want them in standard places where the linker will look for them, which in Unix is by convention in `/lib` directories.
We will also likely be installing other types of files in the future, such as C headers, which by convention also go in other places on the system.
As a result, I'd like to suggest we add support for additional *install layouts*, probably as a separate setting alongside install prefix. We'll probably want several options, depending on user needs and, probably, OS. A couple initial examples:
* The current JBOF setup, with everything dumped in one directory;
* An FHS-style layout, like ones created by package managers on Unix, which places bin/lib/include/etc files in separate paths.
Our package manager-based installs, like Homebrew, will always use the package manager's layout, so those won't change. This is specific to the shell and powershell installers. In addition, we'll want to make sure of what's expected for this kind of software on Windows, because it's likely we'll want to do something different on there compared to Unix systems.
[^1]: We install extra includes in Homebrew, but AFAICT we don't install these in the other installers at the moment.
[^2]: The exception is the env file: in `CARGO_HOME` that goes in `CARGO_HOME` itself, one directory below the binaries, while in other installer types it goes alongside the bins.
Contributor guide
Assessment
This issue has not been assessed yet.