cargo-contract
cargo-contract copied to clipboard
Build ignores RUSTFLAGS
cargo contract build
ignores flags passed in through the RUSTFLAGS
environment variable. Variables passed in through the cargo config are also ignored. The reason is likely that they are overridden here:
https://github.com/paritytech/cargo-contract/blob/f8f048fbace9c10bb414fb4da0df91df772a12d8/src/cmd/build.rs#L57-L61
They should be merged with the pre-existing options where pre-existing options take precedence in case of conflicts.
Likely a similar change is necessary for metadata generation.
can we close this issue now that this PR has been merged that uses CARGO_ENCODED_RUSTFLAGS
instead of RUSTFLAGS
in contract-build
crate?
I don't know if cargo
merged those two or if one takes precedence in the presence of both. If the former is true we can close this.
Indeed we would need to confirm which is true, the docs are not enlightening. Even if the former is true the issue will still exist for CARGO_ENCODED_RUSTFLAGS
.