gh-112301: Enable warning emitting options and ignore warnings in CI#123020
gh-112301: Enable warning emitting options and ignore warnings in CI#123020hugovk merged 125 commits intopython:mainfrom
Conversation
sethmlarson
left a comment
There was a problem hiding this comment.
My comments are resolved, I'll leave a +1 review.
I spoke with @nohlson privately about potentially breaking up the addition of warnings into separate pull requests so they're only "active" while we're actively remediating the individual warnings. This would minimize the chances that core developers are going to "run into" this effort slightly.
After Nate dug into it, it turns out that almost all of the existing warnings come from -Wconversion and the other options produce far fewer warnings, some of which already have pull requests out for their remediation (like -Wformat=2).
For this reason I am okay proceeding with this PR as-is as the gains from splitting up the individual options seems smaller than I originally imagined, if other devs have concerns about this approach please leave them below.
hugovk
left a comment
There was a problem hiding this comment.
We can't merge this yet because the CI is failing:
https://github.com/python/cpython/actions/runs/10609035033/job/29404117175?pr=123020
How can we fix it?
The warning ignore files need to be updated immediately before merging. This is because any warnings that have merged to |
hugovk
left a comment
There was a problem hiding this comment.
Unsurprisingly there were new warnings when merging main in again, but the CI error message was useful: it told me which file had a different number of warnings, and linked to the devguide instructions on how to update.
Thanks @nohlson, let's merge!
…arnings in CI (python#123020)" This reverts commit cfe6074.
This PR introduces new compiler options that only emit warnings and don't affect runtime performance and some improvements to the warning check tooling.
Warning check tooling improvements:
lstrip()from the file path parsed from the compiler outputCompiler options enabled:
-Wconversion-Wimplicit-fallthrough-Werror=format-security-Wbidi-chars=any-WallThis PR also modifies the reusable-macos and reusable-ubuntu jobs so that compiler output is only written to a file and warning checking is only performed on the specific jobs that we want:
All warnings have been added to the warning ignore files for the respective platforms.
This is one step in the roadmap for compiler hardening.