-
Notifications
You must be signed in to change notification settings - Fork 37.7k
depends: Build the native_capnp
and capnp
packages with CMake
#28856
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. 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. |
cc @ryanofsky |
Any reason to not change |
|
Not really, but it's a bit odd to be building the same code, in two different ways, in depends. Would be good to know why one build fails and the other doesn't. |
fe0796e
to
d1604d4
Compare
capnp
with CMakenative_capnp
and capnp
packages with CMake
Done. |
Concept ACK - I think this will now also fix #26943, and the build failure coming from the lib vs lib64 discrepency. |
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.
Code review ACK d1604d4. I left a question and suggestion, but they are not critical. Overall seems good to switch from autotools to cmake here. I'm actually not sure why I didn't write this using cmake originally, since the cmake build has been around since capnproto 0.5. It also seems good to get rid of the special --disable-shared flag for android, since that was inconsistent with other platforms.
I think I understand how this change works around the mingw32 build issue #28735 (comment) reported upstream capnproto/capnproto#1833, but I don't understand how this would fix either of the two problems the closed PR #28846 was supposed to fix. Overall though using cmake consistently and dropping the android special case should make debugging simpler and at least help out that way.
depends/packages/libmultiprocess.mk
Outdated
@@ -20,7 +20,7 @@ define $(package)_config_cmds | |||
endef | |||
|
|||
define $(package)_build_cmds | |||
$(MAKE) | |||
$(MAKE) multiprocess |
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.
In commit "depends: Build capnp
package with CMake" (2cdb2f8)
This change seems like a good way to speed things up by only building the libmultiprocess runtime library, not the code generation tool in the non-native cross build (assuming that is the intention here). But it would be good to write this in a comment so it is clear what is going on.
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.
Although this change is an improvement, I dropped it in the recent push as it is not related to the changes in this PR.
You are right, this PR doesn't fix at least the first problem, which is configure failing to find libmultiprocess: checking for libmultiprocess... no
configure: error: --enable-multiprocess=yes option specified but libmultiprocess library was not found. May need to install libmultiprocess library, or specify install path with PKG_CONFIG_PATH environment variable. Running 'pkg-config --debug libmultiprocess' may be helpful for debugging. |
Yea, happy for 156366f to be cherry-picked in here. |
In case you do cherry pick it, I suggested a comment to go along with the code here: #28846 (comment). I think it would also be good link to bitcoin-core/libmultiprocess#79 in the commit message or pull request description since that's what triggered the problem. Also seems fine if you don't want to cherrypick it here, since it's not directly related to this PR and might make it more confusing. I'm happy to open a new PR or review one if it doesn't get cherrypicked. |
Please do. Thank you. |
I'll just reopen my PR then. Not sure we need a third PR, for what is a really straightforward bugfix. |
This change fixes the `capnp` package cross-compiling for the `x86_64-w64-mingw32` and `arm64-apple-darwin` platforms.
Rebased to include the recent changes in the depends build system. The PR description has been updated to mention one more fixed bug. |
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.
Is this #28993, which turned out to not be a bug, or is this a different bug? Because that conclusion from #28993 was that cross-compilation for Darwin, using master, does work? If so, what is this PR fixing in regards to cross-compiling for |
A different one, which is outdated
Right. Cross-compiling for
CMake does not rely on |
…ckages with CMake 11d797e depends: Build `native_capnp` package with CMake (Hennadii Stepanov) 90389c9 depends: Build `capnp` package with CMake (Hennadii Stepanov) Pull request description: The first commit fixes two bugs when cross-compiling the `capnp` package on the master branch @ 160d236: - for `x86_64-w64-mingw32` (see bitcoin#28735 (comment)): ``` libtool: link: x86_64-w64-mingw32-g++-posix -shared -nostdlib /usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtbegin.o src/kj/.libs/cidr.o src/kj/.libs/common.o src/kj/.libs/units.o src/kj/.libs/memory.o src/kj/.libs/refcount.o src/kj/.libs/array.o src/kj/.libs/list.o src/kj/.libs/string.o src/kj/.libs/string-tree.o src/kj/.libs/source-location.o src/kj/.libs/hash.o src/kj/.libs/table.o src/kj/.libs/encoding.o src/kj/.libs/exception.o src/kj/.libs/debug.o src/kj/.libs/arena.o src/kj/.libs/io.o src/kj/.libs/mutex.o src/kj/.libs/thread.o src/kj/.libs/time.o src/kj/.libs/filesystem.o src/kj/.libs/filesystem-disk-unix.o src/kj/.libs/filesystem-disk-win32.o src/kj/.libs/test-helpers.o src/kj/.libs/main.o src/kj/parse/.libs/char.o -L/home/hebasto/git/bitcoin/depends/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtend.o -mthreads -O2 -mthreads -mthreads -o .libs/libkj-1-0-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libkj.dll.a /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x1dc): undefined reference to `__imp_inet_ntop' /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x44b): undefined reference to `__imp_inet_pton' collect2: error: ld returned 1 exit status ``` - for `arm64-apple-darwin`: ``` checking build system type... x86_64-pc-linux-gnu checking host system type... Invalid configuration `arm64-apple-darwin': machine `arm64-apple' not recognized configure: error: /bin/bash build-aux/config.sub arm64-apple-darwin failed ``` The second commit applies the same changes for the `native_capnp` package for [consistency](bitcoin#28856 (comment)). ACKs for top commit: ryanofsky: Code review ACK 11d797e. Since last review arm64-apple-darwin platform is now mentioned in the commit message, and the change to `depends/packages/libmultiprocess.mk` in d1604d4 which was unrelated (but probably still a good optimization) was reverted. Tree-SHA512: c636e53073ce6fcda9724723bc59f3990fa9629a3b2f73d93dbc102a5a1badfbe8f4c5fef841f03588ebcad5cd4883f3ce32b128afcd75f6bc21eb801796a586
…ckages with CMake 11d797e depends: Build `native_capnp` package with CMake (Hennadii Stepanov) 90389c9 depends: Build `capnp` package with CMake (Hennadii Stepanov) Pull request description: The first commit fixes two bugs when cross-compiling the `capnp` package on the master branch @ 160d236: - for `x86_64-w64-mingw32` (see bitcoin#28735 (comment)): ``` libtool: link: x86_64-w64-mingw32-g++-posix -shared -nostdlib /usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtbegin.o src/kj/.libs/cidr.o src/kj/.libs/common.o src/kj/.libs/units.o src/kj/.libs/memory.o src/kj/.libs/refcount.o src/kj/.libs/array.o src/kj/.libs/list.o src/kj/.libs/string.o src/kj/.libs/string-tree.o src/kj/.libs/source-location.o src/kj/.libs/hash.o src/kj/.libs/table.o src/kj/.libs/encoding.o src/kj/.libs/exception.o src/kj/.libs/debug.o src/kj/.libs/arena.o src/kj/.libs/io.o src/kj/.libs/mutex.o src/kj/.libs/thread.o src/kj/.libs/time.o src/kj/.libs/filesystem.o src/kj/.libs/filesystem-disk-unix.o src/kj/.libs/filesystem-disk-win32.o src/kj/.libs/test-helpers.o src/kj/.libs/main.o src/kj/parse/.libs/char.o -L/home/hebasto/git/bitcoin/depends/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtend.o -mthreads -O2 -mthreads -mthreads -o .libs/libkj-1-0-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libkj.dll.a /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x1dc): undefined reference to `__imp_inet_ntop' /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x44b): undefined reference to `__imp_inet_pton' collect2: error: ld returned 1 exit status ``` - for `arm64-apple-darwin`: ``` checking build system type... x86_64-pc-linux-gnu checking host system type... Invalid configuration `arm64-apple-darwin': machine `arm64-apple' not recognized configure: error: /bin/bash build-aux/config.sub arm64-apple-darwin failed ``` The second commit applies the same changes for the `native_capnp` package for [consistency](bitcoin#28856 (comment)). ACKs for top commit: ryanofsky: Code review ACK 11d797e. Since last review arm64-apple-darwin platform is now mentioned in the commit message, and the change to `depends/packages/libmultiprocess.mk` in d1604d4 which was unrelated (but probably still a good optimization) was reverted. Tree-SHA512: c636e53073ce6fcda9724723bc59f3990fa9629a3b2f73d93dbc102a5a1badfbe8f4c5fef841f03588ebcad5cd4883f3ce32b128afcd75f6bc21eb801796a586
…ckages with CMake 11d797e depends: Build `native_capnp` package with CMake (Hennadii Stepanov) 90389c9 depends: Build `capnp` package with CMake (Hennadii Stepanov) Pull request description: The first commit fixes two bugs when cross-compiling the `capnp` package on the master branch @ 160d236: - for `x86_64-w64-mingw32` (see bitcoin#28735 (comment)): ``` libtool: link: x86_64-w64-mingw32-g++-posix -shared -nostdlib /usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtbegin.o src/kj/.libs/cidr.o src/kj/.libs/common.o src/kj/.libs/units.o src/kj/.libs/memory.o src/kj/.libs/refcount.o src/kj/.libs/array.o src/kj/.libs/list.o src/kj/.libs/string.o src/kj/.libs/string-tree.o src/kj/.libs/source-location.o src/kj/.libs/hash.o src/kj/.libs/table.o src/kj/.libs/encoding.o src/kj/.libs/exception.o src/kj/.libs/debug.o src/kj/.libs/arena.o src/kj/.libs/io.o src/kj/.libs/mutex.o src/kj/.libs/thread.o src/kj/.libs/time.o src/kj/.libs/filesystem.o src/kj/.libs/filesystem-disk-unix.o src/kj/.libs/filesystem-disk-win32.o src/kj/.libs/test-helpers.o src/kj/.libs/main.o src/kj/parse/.libs/char.o -L/home/hebasto/git/bitcoin/depends/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtend.o -mthreads -O2 -mthreads -mthreads -o .libs/libkj-1-0-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libkj.dll.a /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x1dc): undefined reference to `__imp_inet_ntop' /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x44b): undefined reference to `__imp_inet_pton' collect2: error: ld returned 1 exit status ``` - for `arm64-apple-darwin`: ``` checking build system type... x86_64-pc-linux-gnu checking host system type... Invalid configuration `arm64-apple-darwin': machine `arm64-apple' not recognized configure: error: /bin/bash build-aux/config.sub arm64-apple-darwin failed ``` The second commit applies the same changes for the `native_capnp` package for [consistency](bitcoin#28856 (comment)). ACKs for top commit: ryanofsky: Code review ACK 11d797e. Since last review arm64-apple-darwin platform is now mentioned in the commit message, and the change to `depends/packages/libmultiprocess.mk` in d1604d4 which was unrelated (but probably still a good optimization) was reverted. Tree-SHA512: c636e53073ce6fcda9724723bc59f3990fa9629a3b2f73d93dbc102a5a1badfbe8f4c5fef841f03588ebcad5cd4883f3ce32b128afcd75f6bc21eb801796a586
2f751ed fixup! Merge bitcoin#30567: qt, build: Drop `QT_STATICPLUGIN` macro (pasta) 142245d Merge bitcoin#29733: build, macos: Drop unused `osx_volname` target (fanquake) 02f81e5 Merge bitcoin#23511: require glibc 2.18+ (pasta) 9f0e4ae Merge bitcoin#29706: depends: set two CMake options globally (fanquake) be07bbe Merge bitcoin#28846: depends: fix libmultiprocess build on aarch64 (fanquake) 0dea194 Merge bitcoin#28856: depends: Build the `native_capnp` and `capnp` packages with CMake (fanquake) a23eee1 partial Merge bitcoin#23619: build: Propagate user-defined flags to host packages (fanquake) 7cdacdc Merge bitcoin#30513: depends: Bump `libmultiprocess` for CMake fixes (merge-script) 4f44750 Merge bitcoin#30491: Fix MSVC warning C4273 "inconsistent dll linkage" (merge-script) 5ba1309 Merge bitcoin#30567: qt, build: Drop `QT_STATICPLUGIN` macro (merge-script) Pull request description: ## Issue being fixed or feature implemented Batch of more PRs that I found during make work ## What was done? ## How Has This Been Tested? hasn't yet ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: knst: utACK 2f751ed UdjinM6: utACK 2f751ed Tree-SHA512: 1d8433daaf8dc8c8f04beca1cf0281f0dc29a623e5e8ed941bcb556568d72d8ce0ac5b5c001b10645fdffaa4e7083b76d61075049b2418bb8dd9b5ba0f53a8a9
The first commit fixes two bugs when cross-compiling the
capnp
package on the master branch @ 160d236:x86_64-w64-mingw32
(see depends: Bump to capnproto-c++-1.0.1 #28735 (comment)):arm64-apple-darwin
:The second commit applies the same changes for the
native_capnp
package for consistency.