Skip to content
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

Build ignores RUSTFLAGS #98

Open
athei opened this issue Nov 4, 2020 · 3 comments
Open

Build ignores RUSTFLAGS #98

athei opened this issue Nov 4, 2020 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@athei
Copy link
Contributor

athei commented Nov 4, 2020

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.

@ltfschoen
Copy link

ltfschoen commented May 29, 2023

can we close this issue now that this PR has been merged that uses CARGO_ENCODED_RUSTFLAGS instead of RUSTFLAGS in contract-build crate?

@athei
Copy link
Contributor Author

athei commented Jun 19, 2023

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.

@ascjones
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants