-
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
Build script not rerun when target rustflags change #13003
Comments
@rustbot claim |
From #13502
@heisen-li bringing this back here because this is more a question of problem and design, rather than implementation. For me, the first step would be to dig into this part of the Issue:
I admit, I'm not aware of what this is talking about but we should make sure we understand that so we can consider all options for addressing this issue. |
The docs for
|
So our options are
@ehuss when you marked this as |
Sorry I wasn't clear about what was expected. I was expecting that it would re-run the build script whenever the Requiring the user to set |
In most of those cases, the variable is assumed to be a dependency. Here, we are depending on something that is technically unrelated to the actual build unit which feels wrong. However, the over-builds from this are not likely to be a problem so not willing to block this over it. |
[fix]:Build script not rerun when target rustflags change ### What does this PR try to resolve? Fixes #13003
Problem
Some crates such as
anyhow
utilize theCARGO_ENCODED_RUSTFLAGS
to customize their build. When a build is performed with only the target rustflags changed the build script does not get rerun, so the build customization from it is inconsistent with the build environment for the library itself.Steps
Possible Solution(s)
It seems like Cargo's input environment variables to the build-script-execution should be part of its fingerprint, since by my understanding it's not possible for the build script to use
rerun-if-env-changed
with these variables.Notes
Without
--target
the build-script-build is influenced by the RUSTFLAGS and so implicitly the build-script-execution is rerun after rebuilding the script itself.Version
The text was updated successfully, but these errors were encountered: