Mechanism to switch ~/.cargo/config.toml
/.cargo/config.toml
based on channel
#4047
Labels
~/.cargo/config.toml
/.cargo/config.toml
based on channel
#4047
Problem you are trying to solve
There are some options I like to enable globally when using cargo (via
cargo
'sconfig.toml
):rustflags = ["-C", "link-arg=-fuse-ld=/usr/sbin/mold"]
(for all channels)rustflags = ["-Z", "threads=<N>"]
(for nightly only)I've tried:
RUSTFLAGS
viarust-toolchain.toml
(not an option)config.toml
(not possible,cargo
doesn't understand the idea of multiple toolchains).cargo/config.toml
in each individual crate (inefficient, and if I decide to try using+stable
in a+nightly
-configured crate, I get an error)-Z threads=<N>
will eventually land in stable, but I can envision similar feature incompatibilities between the channels in the future.Solution you'd like
Much like the
cargo
binary is swapped out byrustup
, I'd like an option to swap outconfig.toml
files as if I really was using a fully isolated and separate toolchain.It could be that
rustup
has an equivalent location to wherecargo
will look forconfig.toml
for each toolchain, but it's not clear if this file will be preserved between installation/updates/removal.Notes
I can see a few ways to approach this, but they all have pros/cons so I'm curious to hear from rustup devs what their thoughts are.
The text was updated successfully, but these errors were encountered: