-
Notifications
You must be signed in to change notification settings - Fork 38.7k
build: Set AUTHOR_WARNING on warnings #33144
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
base: master
Are you sure you want to change the base?
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33144. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
|
Rebased, tested it with: diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt (revision 27e4b8c6856194fa8db028b6f7356f83ea3d7e3a)
+++ b/CMakeLists.txt (date 1754504896922)
@@ -186,6 +186,7 @@
string(APPEND CMAKE_CXX_LINK_EXECUTABLE " ${APPEND_LDFLAGS}")
set(configure_warnings)
+list(APPEND configure_warnings "Testing https://github.com/bitcoin/bitcoin/pull/33144")
include(CheckLinkerSupportsPIE)
check_linker_supports_pie(configure_warnings)running: rm -rfd build && cmake -B build 2>&1 | grep -C1 WarningPrints before the change: CMake Warning at CMakeLists.txt:709 (message):
Testing https://github.com/bitcoin/bitcoin/pull/33144After the change: CMake Warning at CMakeLists.txt:709 (message):
Testing https://github.com/bitcoin/bitcoin/pull/33144
--
CMake Warning (dev) at CMakeLists.txt:712 (message):
Warnings have been encountered!
This warning is for project developers. Use -Wno-dev to suppress it.ACK fa6497b |
stickies-v
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fa6497b
It makes sense to have an option to have configuration warnings dealt as errors, and it's unfortunate that the most elegant way to do that is by somewhat abusing AUTHOR_WARNING, but this seems like the least bad solution to me, until CMake has a -Werror=all option.
I've also been thinking about an alternative approach. configure_warnings is currently used for:
- missing Python interpreter, which is necessary (without build failure) for the functional test suite, and is necessary (but build will fail) for maintenance and macos deploy targets
- missing PIE support
- ccache misconfiguration
For:
- I think a
FATAL_ERRORwhen functional tests are configured (e.g. f529c14) might be appropriate. - it similarly might make sense to trigger a
FATAL_ERROR(e.g. c988ca5), I'm not sure if we actually want to support compiling without PIE? - this might be more controversial, but I don't think
WITH_CCACHEshould be part of our build system.
Those changes combined would remove configure_warnings entirely, removing the need for this PR, but it obviously is a much bigger change. I've implemented it in 7cc9a08...stickies-v:2025-09/cmake-remove-configure-warnings just to try it out.
|
Sounds good. Happy to put this in draft for now to see if your removal of |
Thanks for the feedback, I've opened #33278.
The changes in this/your PR are small, straightforward, can easily be reverted, and offer immediate practical benefit, so I think it makes sense to not block this on my much less straightforward alternative, so my ACK still stands and I'd be happy if this makes progress. |
|
I don't see how abusing the semantics of
Edit: On further thought, 7cc9a08...stickies-v:2025-09/cmake-remove-configure-warnings wouldn't really be a shift from the current approach, we don't generally change build configuration based on what is found on the user's system, that was true in the old build system: bitcoin/build-aux/m4/bitcoin_qt.m4 Lines 5 to 17 in 44d8b13
Edit: Edit: Also see discussion here: #33290 (comment) |
|
+GHA CI |
Now that the cmake setting
-Werror=devis set since commit 6a13a61 for the CI, guix and the dev cmake preset, it could make sense to notify developers about any warnings.So do that with a single
AUTHOR_WARNING.This can be tested by introducing a bug, like:
Fixes #31476.