-
Notifications
You must be signed in to change notification settings - Fork 36.8k
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
build: extract $(BOOST_CPPFLAGS) from $(BITCOIN_INCLUDES) #26056
Conversation
Concept ACK. |
Concept ACK. Hah, I was working on this at the same time (on top of master, though). Rather than adding it where it looked like it would be needed, I added a depends commit to move boost out of the common prefix path, that way we'll actually detect missing headers: theuni@e131d8f . Then I rebuilt everything and added |
Looks like the only difference between ours (other than test_util) is missing ACK after adding that (and after c-i is happy). |
With flag reordering as follows: diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 4fe79652e..602a11825 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -295,7 +295,7 @@ BITCOIN_QT_RC = qt/res/bitcoin-qt-res.rc
BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS -DQT_USE_QSTRINGBUILDER
qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
- $(BOOST_CPPFLAGS) $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(QR_CFLAGS)
+ $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(QR_CFLAGS) $(BOOST_CPPFLAGS)
qt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
qt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)
diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
index afcd4106b..89c659d4b 100644
--- a/src/Makefile.qttest.include
+++ b/src/Makefile.qttest.include
@@ -27,7 +27,7 @@ TEST_QT_H = \
qt/test/wallettests.h
qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
- $(BOOST_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES)
+ $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(BOOST_CPPFLAGS)
qt_test_test_bitcoin_qt_SOURCES = \
init/bitcoin-qt.cpp \ your commit fixes #25947 as well. |
3549509
to
eb8b52d
Compare
The bin I didn't test compiling 😅. Rebased on master and fixed this up. |
This diff: --- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -753,7 +753,7 @@ bitcoin_node_LDADD = $(LIBBITCOIN_NODE) $(bitcoin_bin_ldadd) $(LIBBITCOIN_IPC) $
# bitcoin-cli binary #
bitcoin_cli_SOURCES = bitcoin-cli.cpp
-bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
+bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS)
bitcoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
fixes macOS native build. |
Concept ACK |
I don't think that's the right solution, and would actually just hide the underlying problem. Re-adding Given that the CI runs with Looking at the log, we've got In file included from bitcoin-cli.cpp:40:
/usr/local/include/event2/buffer.h:210:11: error: parameter 'buffer' not found in the function declaration [-Werror,-Wdocumentation]
* @param buffer the evbuffer that the callback is watching.
^~~~~~ so I assume the reason these are currently being suppressed is actually due to the Boost cppflags always being present, which adds |
@fanquake thanks for the explanation. I was struggling to understand why only osx would need boost when there doesn't seem to be any dependency, but that explanation makes sense. |
From ./ci/test/00_setup_env_native_asan.sh :
From .cirrus.yml:
Seems we're pulling libevent (and a few others) from 2 places for MacOS. Why? |
It is a bit messy, but the brew macos build doesn't use the Ubuntu apt, so there should only be one place where this is installed: Line 332 in 5558d2f
You can also check the logs produced at runtime to double check. |
I played around a little bit with this locally and was able to reproduce with a minimal test-case. I believe this commit (untested) should fix the root issue here: theuni@7929a2a (see the comment for a description of the issue). @hebasto do you have an easy way of testing? If not, I can just open a PR with these two commits and see if c-I is happy. Edit: updated to include a test. |
I do think specifying explicitly probed include paths (bdb/sqlite/qt5/miniupnpc/natpmp) before the others for brew whenever we can makes sense as a policy. And in this case, I agree that it would fix the problem. That said, I'm not sure we can always do this (include order may matter for other reasons), and homebrew isn't exactly our top priority. So, since I don't see any reason not to in this case... ACK reversing the order as you suggested. |
eb8b52d
to
814582b
Compare
Rebased on master / #26070.
I've ordered the flags in this way, however I agree that doing this is not ideal, and somewhat fragile. |
…rs installed from homebrew b50a4b7 build: quiet warnings in system headers installed from homebrew (Cory Fields) Pull request description: From the included comment: Homebrew may create symlinks in `/usr/local/include` for some packages. Because MacOS's clang internally adds `-I /usr/local/include` to its search paths, this will negate efforts to use `-isystem` for those packages, as they will be found first in `/usr/local`. Use the internal `-internal-isystem` option to system-ify all `/usr/local/include` paths without adding it to the list of search paths in case it's not already there. This fixes the issue explained here: bitcoin/bitcoin#26056 (comment) ~Also temporarily includes #26056 as a test. I will remove that commit if/when c-i is happy, and fanquake can rebase it post-merge.~ I've removed this commit now that c-i succeeded with it. ACKs for top commit: hebasto: ACK b50a4b7, tested as a part of bitcoin/bitcoin#26056 on macOS Monterey 12.6 (21G115, both Intel and Apple M1) + Apple clang 14.0.0: Tree-SHA512: 163aa359d27c31d52b444252762e32dd8a11acc043cf1a2aa953f902d1dab77ece52e2dfedcce637e6a1dda47e4c566bfeb8d3b092f82bfc73923843b7bc619c
This leaves $(BITCOIN_INCLUDES) as internal dependencies, and gives finer control over Boost includes.
814582b
to
12de8f6
Compare
Rebased for #26070. |
…lled from homebrew b50a4b7 build: quiet warnings in system headers installed from homebrew (Cory Fields) Pull request description: From the included comment: Homebrew may create symlinks in `/usr/local/include` for some packages. Because MacOS's clang internally adds `-I /usr/local/include` to its search paths, this will negate efforts to use `-isystem` for those packages, as they will be found first in `/usr/local`. Use the internal `-internal-isystem` option to system-ify all `/usr/local/include` paths without adding it to the list of search paths in case it's not already there. This fixes the issue explained here: bitcoin#26056 (comment) ~Also temporarily includes bitcoin#26056 as a test. I will remove that commit if/when c-i is happy, and fanquake can rebase it post-merge.~ I've removed this commit now that c-i succeeded with it. ACKs for top commit: hebasto: ACK b50a4b7, tested as a part of bitcoin#26056 on macOS Monterey 12.6 (21G115, both Intel and Apple M1) + Apple clang 14.0.0: Tree-SHA512: 163aa359d27c31d52b444252762e32dd8a11acc043cf1a2aa953f902d1dab77ece52e2dfedcce637e6a1dda47e4c566bfeb8d3b092f82bfc73923843b7bc619c
ACK 12de8f6 It's nice that we're now forced to make all external dependencies explicit. I suspect this will eventually lead to a few more boost removals. |
Verified that it fixes #25947. Tested on macOS 10.15.7 with $ brew list --version | grep qt
qt 6.3.1_3
qt@5 5.15.5_2 5.15.3 |
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 12de8f6, tested on macOS Monterey 12.6 (21G115, Intel).
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 12de8f6
… is not supported" 34a2f91 Revert "doc: note that brew installed qt is not supported" (Hennadii Stepanov) Pull request description: As bitcoin/bitcoin#26056 fixes bitcoin/bitcoin#25947 it looks reasonable to revert bitcoin/bitcoin#21988. ACKs for top commit: fanquake: ACK 34a2f91 - haven't tested at all. jarolrod: ACK bitcoin/bitcoin@34a2f91 Tree-SHA512: 4470f21fb6ea32970d7572c83ba064bcbe6e3282cea79122312f8ac203a5b1617b21952db1d6e47ba5b6f605abc23f72c04c07cef7251272e22fb593ff317beb
…supported" 34a2f91 Revert "doc: note that brew installed qt is not supported" (Hennadii Stepanov) Pull request description: As bitcoin#26056 fixes bitcoin#25947 it looks reasonable to revert bitcoin#21988. ACKs for top commit: fanquake: ACK 34a2f91 - haven't tested at all. jarolrod: ACK bitcoin@34a2f91 Tree-SHA512: 4470f21fb6ea32970d7572c83ba064bcbe6e3282cea79122312f8ac203a5b1617b21952db1d6e47ba5b6f605abc23f72c04c07cef7251272e22fb593ff317beb
This leaves
$(BITCOIN_INCLUDES)
as internal dependencies, and gives finer control over Boost includes.Fixes #25947.