Cargo shouldn't set `/WX` (`-Werror` for MSVC linker) outside of CI
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/build.rs#L99-L100
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 https://github.com/rust-lang/cargo/pull/13131#discussion_r1534936304).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect build.rs at lines 99-100 and the linked Cargo pull-request discussion to understand how /WX is currently enabled. Change the configuration so /WX is used only in CI; done means normal user builds no longer require the MSVC linker warning flag while CI still enables it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100