Skip to content

Add -DPYBIND11_WERROR=ON to mingw cmake commands #4073

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

Merged
merged 10 commits into from
Aug 1, 2022
Merged

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Jul 16, 2022

Description

Add -DPYBIND11_WERROR=ON to mingw cmake commands, plus a couple minor tweaks to resolve warnings.

Brings the two MINGW jobs on par with all other CI jobs.

Suggested changelog entry:

@rwgk rwgk marked this pull request as ready for review July 18, 2022 20:43
@rwgk rwgk requested a review from henryiii as a code owner July 18, 2022 20:43
@rwgk rwgk requested a review from Skylion007 July 18, 2022 20:43
@rwgk
Copy link
Collaborator Author

rwgk commented Jul 18, 2022

@henryiii this is ready for review now (I don't know if you get auto notifications, in addition to the auto-add as reviewer).

@rwgk
Copy link
Collaborator Author

rwgk commented Jul 21, 2022

@Skylion007 @henryiii did you see this PR?

I believe this is a very quick review. Just a little bit of tweaking to silence warnings about Eigen code, and about statics in a couple simple tests that are guarded from deletes only by runtime ifs.

I believe that extra little noise is a very small price to pay for having -DPYBIND11_WERROR=ON for mingw.

@rwgk
Copy link
Collaborator Author

rwgk commented Jul 29, 2022

@Skylion007
@henryiii

Hoping you can take a look. This is a very simple PR, plugging an obvious hole in our PYBIND11_WERROR coverage.

@@ -929,7 +929,7 @@ jobs:
run: git clean -fdx

- name: Configure C++14
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DDOWNLOAD_CATCH=ON -S . -B build2
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build2
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build2

@@ -947,7 +947,7 @@ jobs:
run: git clean -fdx

- name: Configure C++17
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DDOWNLOAD_CATCH=ON -S . -B build3
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build3
Copy link
Collaborator

@henryiii henryiii Jul 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build3
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build3

Let's be consistent, and this type is really only to help cmake-gui anyway.

Copy link
Collaborator

@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, but otherwise seems fine. Verbose makefile make logs a bit long, not sure I prefer them, but okay if you want to.

@rwgk
Copy link
Collaborator Author

rwgk commented Aug 1, 2022

Thanks for the review!

Verbose makefile make logs a bit long, not sure I prefer them, but okay if you want to.

This setting is only for the CI. I often analyze the logs with scripts. Having the information in the logs makes the difference between day and night (seeing and being blind). Another way to look at this: reducing is easy and conclusive, guessing is hard and ambiguous.

@rwgk rwgk merged commit 3665530 into pybind:master Aug 1, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 1, 2022
@rwgk rwgk deleted the mingw_werror branch August 1, 2022 13:19
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants