-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo shouldn't set /WX
(-Werror
for MSVC linker) outside of CI
#13620
Comments
Linker warnings (unlike compiler warnings) are very rare and almost always indicate an actual problem with the build (e.g. arguments being ignored). This is as relevant for local builds as for CI. Note that The better solution here would be for Rust to show linker warnings instead of hiding them. |
That first sentence should more accurately be "linker warnings that are not immediately followed by a fatal error are very rare". |
This was added in #13131 (from which the issue is quoting). The motivation @ChrisDenton gave at the time was
I generally agree that @tbu- do you have a motivation for this outside of risk for the Cargo team? You posted on #13131 several months after the PR was merged so I assume you ran into a problem and backtracked to it. |
I do not remember how I found that issue.
|
When rust-lang/rust#119286 is merged, it would ease my mind a bit. In any case I would still maintain that If someone is encountering an actual problem caused by using |
Why do we override MSVC's decision for what is a warning and what is an error? |
My original reason for doing so was that rustc entirely swallows warnings unless there is also an error. Which is definitely wrong. |
I guess we can just block this on rust-lang/rust#119286, and disable cargo's work-around to the rustc bug afterwards. |
The cargo team discussed this today, and agree that we probably don't want to change this unless something like rust-lang/rust#119286 is merged. |
cargo/build.rs
Lines 99 to 100 in 8bcecfe
Setting
/WX
might make versions of Cargo harder to build in the future. If a new version of MSVC gets released that throws a warning here, users wanting to build an old version of Cargo will need to patch it to even make them build. See https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/ ("-Werror Introduces a Toolchain Version Dependency"). It's better to only enable/WX
in CI, this way you can always change it, but don't leave users who want to compile Cargo with errors.(from #13131 (comment)).
The text was updated successfully, but these errors were encountered: