-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
The cargo install
command should read configuration from $HOME/.cargo/config
but not from other configuration files.
Normally cargo looks for configuration in $PWD/.cargo/config
, $PWD/../.cargo/config
, etc., and in $HOME/.cargo/config
. For cargo install
, however, the tree walking behavior is surprising. cargo install foo
should work the same regardless of the directory from which we run it.
This surprising behavior resulted in #5850 and PR #5874. That PR causes cargo install
to ignore any configured build.target
value from a configuration file.
However, that change does both too little and too much. It does too much because we don't want to ignore configured values in $HOME/.cargo/config
. Values set there make sense for cargo install
. E.g., we might use that to set musl as our default build target. On the other hand, the change does too little because we want to ignore all configuration values from $PWD/(../)*/.cargo/config
, not just build.target
.
The correct behavior is that cargo install
should load only $HOME/.cargo/config
and should apply all values found there.