Skip to content

Cargo shouldn't set /WX (-Werror for MSVC linker) outside of CI #13620

Open
@tbu-

Description

@tbu-

cargo/build.rs

Lines 99 to 100 in 8bcecfe

// Turn linker warnings into errors.
println!("cargo:rustc-link-arg-bin=cargo=/WX");

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)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-building-cargo-itselfArea: issues with building cargoA-reproducibilityArea: reproducible / deterministic buildsC-bugCategory: bugO-windowsOS: WindowsS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions