No way to pass environment information to compiler flags defined in Cargo configuration #7352
Labels
A-configuration
Area: cargo config files and env vars
A-environment-variables
Area: environment variables
A-rustflags
Area: rustflags
C-bug
Category: bug
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
The
.cargo/config
file, through itsbuild.rustflags
key, allows you to add arbitrary compiler flags, which are appended to those passed by Cargo at build-time. These flags, however, are not parsed or evaluated in any way, which means that no environment information can be used in these flags.Steps
${BAR}
variable was not expanded:Possible Solution(s)
There are two obvious solutions to this:
rustflags
before passing them to the compiler.Notes
Output of
cargo version
: cargo 1.39.0-nightly (fe0e5a4 2019-09-04)The original issue that prompted this is that there is no way to pass the Cargo output directory as a part of the
-Map
linker flag, which means that the map file is always generated in the source directory (highly undesirable).The text was updated successfully, but these errors were encountered: