cargo install
doesn't set env variable defined in .cargo/config.toml
#15609
Labels
A-configuration
Area: cargo config files and env vars
C-bug
Category: bug
Command-install
S-triage
Status: This issue is waiting on initial triage.
Problem
Hi,
In our project, coreutils, we have the following section in
.cargo/config.toml
:We then use the
env!
macro fromstd
to retrieve the value. The macro emits a compilation error if the environment variable is not defined.Everything works fine if I use
cargo install
with--path
:However, if I try to install it from
crates.io
with:I get many errors about the environment variable not being defined at compile time, for example:
My initial thought was that
.cargo/config.toml
is missing from the crates file, but that's not the case as you can see when downloading the crates file from https://crates.io/api/v1/crates/coreutils/0.1.0/download.Steps
I guess the steps are:
[env]
section to.cargo/config.toml
and define an env variableenv!
macro in the applicationcargo install <crate_name> --locked
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: