Skip to content

cmake: add --compile-no-warning-as-error to default cmakeFlags#454937

Closed
LunNova wants to merge 1 commit intoNixOS:stagingfrom
LunNova:push-wtysmkqvvnyp
Closed

cmake: add --compile-no-warning-as-error to default cmakeFlags#454937
LunNova wants to merge 1 commit intoNixOS:stagingfrom
LunNova:push-wtysmkqvvnyp

Conversation

@LunNova
Copy link
Member

@LunNova LunNova commented Oct 23, 2025

--compile-no-warning-as-error suppresses the COMPILE_WARNING_AS_ERROR target property which adds -Werror. This seems to be the best practice way for projects to have -Werror on in development and is the intended mechanism for disabling it in cases where it does not make sense.

https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_WARNING_AS_ERROR.html

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

--compile-no-warning-as-error suppresses the COMPILE_WARNING_AS_ERROR
target property which adds Werror. This seems to be the best practice
way for projects to have Werror on in development and is the intended
mechanism for disabling it in cases where it does not make sense.

https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_WARNING_AS_ERROR.html
@LunNova LunNova changed the base branch from master to staging October 23, 2025 15:06
@nixpkgs-ci nixpkgs-ci bot closed this Oct 23, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Oct 23, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Oct 23, 2025
@emilazy
Copy link
Member

emilazy commented Oct 23, 2025

(I have some reservations about this, but am still thinking a lot about -Werror in light of #451301, so no concrete opinion yet. Mostly posting this to cc myself :) )

@LunNova LunNova marked this pull request as ready for review October 23, 2025 15:29
@LunNova
Copy link
Member Author

LunNova commented Oct 23, 2025

Marking ready/unready to ping

@nix-owners nix-owners bot requested review from LnL7 and ttuegel October 23, 2025 15:31
@LunNova LunNova marked this pull request as draft October 23, 2025 15:31
@LunNova
Copy link
Member Author

LunNova commented Oct 23, 2025

via @OPNA2608

please only gated behind an option to disable the addition of that flag. I do want to know when new warnings pop up in stuff i maintain...

@LunNova
Copy link
Member Author

LunNova commented Oct 23, 2025

In light of that maybe doing this only makes sense if we ever get infra that can surface warnings to maintainers in a reasonable way.

@LunNova LunNova closed this Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants