-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] crates-io mirror environment config #12724
Comments
Configuring Cargo via environment variables is documented here: https://doc.rust-lang.org/cargo/reference/environment-variables.html#configuration-environment-variables. You can also set configuration via Is there something missing you're looking for specifically? |
Seems not working. Expected [source.crates-io]
replace-with = 'mirror'
[source.mirror]
registry = "sparse+https://mirror/crates.io-index/" $ cargo build
...
Updating `mirror` index
... Actual $ env \
CARGO_REGISTRIES_MIRROR_INDEX="sparse+https://mirror/crates.io-index/" \
CARGO_REGISTRY_DEFAULT="mirror" \
cargo build
...
Updating crates.io index
... |
In your second example you set https://doc.rust-lang.org/cargo/reference/config.html#registrydefault but in the ferst you set https://doc.rust-lang.org/cargo/reference/config.html#sourcenamereplace-with witch do very difrent things. (despite the confusing naming, sorry.) |
Also, as you may have read, a Cargo config value usually but not always has a counterpart of environment variable
Besides, there is a pretty unstable feature Thank you for the report :) |
Problem
Let package manager env-configure-able is very convenient for scenario like
docker
devcontainer
.devcontainer/devcontainer.json
within container
But currently, cargo seems not env-configure-able, only accept
.cargo/config
.Proposed Solution
Let cargo config env-configure-able.
Notes
No response
The text was updated successfully, but these errors were encountered: