Skip to content

Conversation

theuni
Copy link
Member

@theuni theuni commented Jan 11, 2024

Split out of #21778.

cctools' libtool (and llvm's clone) are unnecessary these days, and were only used (unnecessarily) in miniupnpc and libnatpnp. Both of those projects now have CMake support which eliminates their use.

This PR switches those builds to use CMake, then removes our libtool machinery.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 11, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto
Concept ACK fanquake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27897 (guix: use GCC 12.3.0 to build releases by fanquake)
  • #25972 (build: no-longer disable WARN_CXXFLAGS when CXXFLAGS is set by fanquake)
  • #25573 ([POC] guix: produce a fully -static-pie bitcoind by fanquake)
  • #25391 (guix: Use LTO to build releases by fanquake)
  • #24123 (build: Pointer Authentication and Branch Target Identification for aarch64 Linux (Guix) by fanquake)
  • #21778 (build: LLD based macOS toolchain by fanquake)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake
Copy link
Member

Looks good. Have tested this in the LLD PR. Will ACK after rebase and adding the PIC fix for libnatpmp.

@theuni
Copy link
Member Author

theuni commented Jan 11, 2024

Rebased on master and fixed up pic.

@fanquake
Copy link
Member

fanquake commented Jan 11, 2024

Actually, you'll also need to move cmake-minimal from the darwin target into the package list for all targets, in our Guix manifest. Ideally as the first commit. Otherwise this wont Guix build (for non-darwin).

@theuni theuni force-pushed the depends-no-libtool branch from 623d75a to a28c6bb Compare January 11, 2024 17:08
@theuni
Copy link
Member Author

theuni commented Jan 11, 2024

Actually, you'll also need to move cmake-minimal from the darwin target into the package list for all targets, in our Guix manifest. Ideally as the first commit. Otherwise this wont Guix build (for non-darwin).

Thanks, done.

@fanquake
Copy link
Member

Guix build (aarch64 & x86_64):

73062e70b4ec1fa814c0c25f12cbbcfbabfd3a5e82827a3bfeb2f29b30d0b84f  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/SHA256SUMS.part
0965ed91f84129a64b6e0873b5feb182d83cae0dac6d89a51667d5fbe46fc68c  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/bitcoin-a28c6bbde0bc-aarch64-linux-gnu-debug.tar.gz
87ee5bc2103fc10b8e7acbfa776430918538f05fccf024b624f224f73987f745  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/bitcoin-a28c6bbde0bc-aarch64-linux-gnu.tar.gz
c9bad44733b9f9a90d26e7d82b50bd2d11586723ec2fc330d47924e520d4d4a2  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/SHA256SUMS.part
6c6d4bfd8e3db6509c0e3710b78b2e78fef7d17f7779db9ad16da4e4987cdb23  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/bitcoin-a28c6bbde0bc-arm-linux-gnueabihf-debug.tar.gz
29de9c2f7b4196e56a30a31ced90693a5040dca8464383a4989e28bab411a73e  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/bitcoin-a28c6bbde0bc-arm-linux-gnueabihf.tar.gz
962d22bb3927fa32b92fb6eca5b9d783bd06eb9543910bd84a916c6664a3fc78  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/SHA256SUMS.part
57c30bca8156b16b6d49327fb5fa67adade9126553ab4dbbd40eb154bf093bc1  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin-unsigned.tar.gz
06b291838e73557b6f7d104216b63c1d93da3db8300bb9923e9785efcad87e1c  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin-unsigned.zip
5046771fa256969d780c479498d22f420cfc59a7a9b52a1cf906d2f0e1d351f1  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin.tar.gz
459a0433a4b275b38db0010972de6bc2bd81f107f30fdac81c205c7cd2f4202c  guix-build-a28c6bbde0bc/output/dist-archive/bitcoin-a28c6bbde0bc.tar.gz
34c599140cd538ebedf3e1443eb9ade80a3f649cdfcb56d3adb2bba2c05d1e3d  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/SHA256SUMS.part
3d37246d4b3a9bf64746bae08e25fae938cc11a1d88d5fadd804bbc195adbf26  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64-linux-gnu-debug.tar.gz
4d594e1e7ac8c3dcb41852583a0e574bd919e8d166f1f463bb0f01792e55b35f  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64-linux-gnu.tar.gz
13f5630869aae0b628d5a7163fed467df05b0d83e9d5ead22db1f57c3915128d  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/SHA256SUMS.part
26577922d5c1eb9f125b87876ffb3b1572c60597fb362347db97bf2c7acc7824  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64le-linux-gnu-debug.tar.gz
1c1ecb9fca5bed82b5f342310573ad16720516d338dfdf10d8e2dfece18e61d3  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64le-linux-gnu.tar.gz
a9dd2a4b8e612c1c514e5f08cd14b603bd7e5699319b903c84d93fc6bdd07936  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/SHA256SUMS.part
b4306afe81a87e3b616ca4da28d17644a9ea1af1fde894a07c1f3aff685d1d38  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/bitcoin-a28c6bbde0bc-riscv64-linux-gnu-debug.tar.gz
8c3fe1305e1030fe5b8d6b519148dc4385428a685e2cbc2c6ea665ac6ebbb594  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/bitcoin-a28c6bbde0bc-riscv64-linux-gnu.tar.gz
a7eefad4e2d73c46ffa711d16901348ee9b353ce8f5d9f3b77ff379472ff938a  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/SHA256SUMS.part
e38858ef2a2a45cb2a882eb7921f3db28492e28c5f9ee9782346a4155f3dc983  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin-unsigned.tar.gz
8623edd712e843a1186175e89fadf1b78e67ace0f8daec1f9eb6e3981d4058f8  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin-unsigned.zip
1031b5fe622ffc1aa0adfdb57cfe271e2c09226d99e1389fcd9204c2c839c400  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin.tar.gz
29989368d745d3fd84b02839edff446f2bc8be877eeb0067d8f65e0eab0f9093  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/SHA256SUMS.part
4f879a6d03df624ffb5c0ba9de2547ff3fea5692c184658feb38838911627214  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/bitcoin-a28c6bbde0bc-x86_64-linux-gnu-debug.tar.gz
9c5d3373134aefd4d2144c4913436e0a75fff73c977b0f54a3f9d25b18b580da  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/bitcoin-a28c6bbde0bc-x86_64-linux-gnu.tar.gz
85d5d934d4ae09426bf6235b6e81b3ed722905a4eaf5169212d712fac08754a4  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/SHA256SUMS.part
d7a6e9bea26b1b856d8017d8f1fb17b5868080e2d0971e746b2d1157f6c2cb1e  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-debug.zip
b93f1e6c307cefbba41bb274d6e49673530f930e37cd9919317da0678a0d1c3c  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-setup-unsigned.exe
7cb9624ca622e5430dc4aef39ca30a3858ee558c2eff8a77e00bbc212b8661e1  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-unsigned.tar.gz
f3f1fba109ebfe22fa74930a80902e868b0640413cc1d52297d060977e1e6e4d  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64.zip

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64)

File commit 4baa162
(master)
commit d51f474
(master and this pull)
SHA256SUMS.part ed7581de976a7f8f... 6db248e85f53dff6...
*-aarch64-linux-gnu-debug.tar.gz 906c468cce7f7696... e32209d82910bdc6...
*-aarch64-linux-gnu.tar.gz 328f06ece720f6a8... 486842d1032af8dd...
*-arm-linux-gnueabihf-debug.tar.gz 16d184b07787265a... 29ce22105bdb89d8...
*-arm-linux-gnueabihf.tar.gz 74dbdd6eec952600... 5098c9870212bad3...
*-arm64-apple-darwin-unsigned.tar.gz 3e1fe9185837c6d5... ab67a804c82b182e...
*-arm64-apple-darwin-unsigned.zip 5c58e1cccccd5bbd... c2e3767b6eceab80...
*-arm64-apple-darwin.tar.gz 7f1912cc0dab857c... 0484d5f5945cf5cf...
*-powerpc64-linux-gnu-debug.tar.gz ad504aa6cf46a010... 700bc50b60c09f9f...
*-powerpc64-linux-gnu.tar.gz e6835c285c384cd1... 74ca9258b5c90bbe...
*-powerpc64le-linux-gnu-debug.tar.gz 436a64f3c52bcc50... b2ddfea22148971c...
*-powerpc64le-linux-gnu.tar.gz 723337e91f6c7aab... 392fffc7e40a0ed3...
*-riscv64-linux-gnu-debug.tar.gz 6438d68de4712930... ec830d4f9fed79c2...
*-riscv64-linux-gnu.tar.gz 8694ec5acf8e3f2e... 344556e7d32b2206...
*-x86_64-apple-darwin-unsigned.tar.gz 41f58ac8864e403d... d023ba2774afad53...
*-x86_64-apple-darwin-unsigned.zip 83a152bccb3e86e2... f0040b89efb49781...
*-x86_64-apple-darwin.tar.gz 1038f4e9637125b2... 11a9a8cd3546b2e5...
*-x86_64-linux-gnu-debug.tar.gz e500bc3ea05a3528... c25bcd3f88aa2c6c...
*-x86_64-linux-gnu.tar.gz f0f11506b593a248... eb45a762d9886af6...
*.tar.gz b757aef5514ef31b... 9a4b350538e6a2db...
guix_build.log 3d9641ff8342529f... a9482d2bbe5eb7e2...
guix_build.log.diff e31b2c39aa6b09fe...

@TheCharlatan
Copy link
Contributor

TheCharlatan commented Jan 13, 2024

Guix builds (x86):

73062e70b4ec1fa814c0c25f12cbbcfbabfd3a5e82827a3bfeb2f29b30d0b84f  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/SHA256SUMS.part
0965ed91f84129a64b6e0873b5feb182d83cae0dac6d89a51667d5fbe46fc68c  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/bitcoin-a28c6bbde0bc-aarch64-linux-gnu-debug.tar.gz
87ee5bc2103fc10b8e7acbfa776430918538f05fccf024b624f224f73987f745  guix-build-a28c6bbde0bc/output/aarch64-linux-gnu/bitcoin-a28c6bbde0bc-aarch64-linux-gnu.tar.gz
c9bad44733b9f9a90d26e7d82b50bd2d11586723ec2fc330d47924e520d4d4a2  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/SHA256SUMS.part
6c6d4bfd8e3db6509c0e3710b78b2e78fef7d17f7779db9ad16da4e4987cdb23  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/bitcoin-a28c6bbde0bc-arm-linux-gnueabihf-debug.tar.gz
29de9c2f7b4196e56a30a31ced90693a5040dca8464383a4989e28bab411a73e  guix-build-a28c6bbde0bc/output/arm-linux-gnueabihf/bitcoin-a28c6bbde0bc-arm-linux-gnueabihf.tar.gz
962d22bb3927fa32b92fb6eca5b9d783bd06eb9543910bd84a916c6664a3fc78  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/SHA256SUMS.part
57c30bca8156b16b6d49327fb5fa67adade9126553ab4dbbd40eb154bf093bc1  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin-unsigned.tar.gz
06b291838e73557b6f7d104216b63c1d93da3db8300bb9923e9785efcad87e1c  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin-unsigned.zip
5046771fa256969d780c479498d22f420cfc59a7a9b52a1cf906d2f0e1d351f1  guix-build-a28c6bbde0bc/output/arm64-apple-darwin/bitcoin-a28c6bbde0bc-arm64-apple-darwin.tar.gz
459a0433a4b275b38db0010972de6bc2bd81f107f30fdac81c205c7cd2f4202c  guix-build-a28c6bbde0bc/output/dist-archive/bitcoin-a28c6bbde0bc.tar.gz
34c599140cd538ebedf3e1443eb9ade80a3f649cdfcb56d3adb2bba2c05d1e3d  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/SHA256SUMS.part
3d37246d4b3a9bf64746bae08e25fae938cc11a1d88d5fadd804bbc195adbf26  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64-linux-gnu-debug.tar.gz
4d594e1e7ac8c3dcb41852583a0e574bd919e8d166f1f463bb0f01792e55b35f  guix-build-a28c6bbde0bc/output/powerpc64-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64-linux-gnu.tar.gz
13f5630869aae0b628d5a7163fed467df05b0d83e9d5ead22db1f57c3915128d  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/SHA256SUMS.part
26577922d5c1eb9f125b87876ffb3b1572c60597fb362347db97bf2c7acc7824  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64le-linux-gnu-debug.tar.gz
1c1ecb9fca5bed82b5f342310573ad16720516d338dfdf10d8e2dfece18e61d3  guix-build-a28c6bbde0bc/output/powerpc64le-linux-gnu/bitcoin-a28c6bbde0bc-powerpc64le-linux-gnu.tar.gz
a9dd2a4b8e612c1c514e5f08cd14b603bd7e5699319b903c84d93fc6bdd07936  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/SHA256SUMS.part
b4306afe81a87e3b616ca4da28d17644a9ea1af1fde894a07c1f3aff685d1d38  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/bitcoin-a28c6bbde0bc-riscv64-linux-gnu-debug.tar.gz
8c3fe1305e1030fe5b8d6b519148dc4385428a685e2cbc2c6ea665ac6ebbb594  guix-build-a28c6bbde0bc/output/riscv64-linux-gnu/bitcoin-a28c6bbde0bc-riscv64-linux-gnu.tar.gz
a7eefad4e2d73c46ffa711d16901348ee9b353ce8f5d9f3b77ff379472ff938a  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/SHA256SUMS.part
e38858ef2a2a45cb2a882eb7921f3db28492e28c5f9ee9782346a4155f3dc983  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin-unsigned.tar.gz
8623edd712e843a1186175e89fadf1b78e67ace0f8daec1f9eb6e3981d4058f8  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin-unsigned.zip
1031b5fe622ffc1aa0adfdb57cfe271e2c09226d99e1389fcd9204c2c839c400  guix-build-a28c6bbde0bc/output/x86_64-apple-darwin/bitcoin-a28c6bbde0bc-x86_64-apple-darwin.tar.gz
29989368d745d3fd84b02839edff446f2bc8be877eeb0067d8f65e0eab0f9093  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/SHA256SUMS.part
4f879a6d03df624ffb5c0ba9de2547ff3fea5692c184658feb38838911627214  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/bitcoin-a28c6bbde0bc-x86_64-linux-gnu-debug.tar.gz
9c5d3373134aefd4d2144c4913436e0a75fff73c977b0f54a3f9d25b18b580da  guix-build-a28c6bbde0bc/output/x86_64-linux-gnu/bitcoin-a28c6bbde0bc-x86_64-linux-gnu.tar.gz
85d5d934d4ae09426bf6235b6e81b3ed722905a4eaf5169212d712fac08754a4  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/SHA256SUMS.part
d7a6e9bea26b1b856d8017d8f1fb17b5868080e2d0971e746b2d1157f6c2cb1e  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-debug.zip
b93f1e6c307cefbba41bb274d6e49673530f930e37cd9919317da0678a0d1c3c  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-setup-unsigned.exe
7cb9624ca622e5430dc4aef39ca30a3858ee558c2eff8a77e00bbc212b8661e1  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64-unsigned.tar.gz
f3f1fba109ebfe22fa74930a80902e868b0640413cc1d52297d060977e1e6e4d  guix-build-a28c6bbde0bc/output/x86_64-w64-mingw32/bitcoin-a28c6bbde0bc-win64.zip

@hebasto
Copy link
Member

hebasto commented Jan 13, 2024

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK a28c6bb

mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\
install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
install libminiupnpc.a $($(package)_staging_prefix_dir)/lib
$(MAKE) DESTDIR=$($(package)_staging_dir) install
Copy link
Member

Choose a reason for hiding this comment

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

nit: Using the underlying build system call directly makes CMake re-build all targets again. That could be avoided by using CMake's invocation like that:

Suggested change
$(MAKE) DESTDIR=$($(package)_staging_dir) install
cmake --install . --prefix $($(package)_staging_prefix_dir)

Could be verified by building sequentially the miniupnpc_built and miniupnpc_staged targets.

Copy link
Member

Choose a reason for hiding this comment

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

Incorporated into #29707.

$(package)_config_opts = -DUPNPC_BUILD_SAMPLE=OFF -DUPNPC_BUILD_SHARED=OFF
$(package)_config_opts += -DUPNPC_BUILD_STATIC=ON -DUPNPC_BUILD_TESTS=OFF
$(package)_config_opts += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
$(package)_cppflags_mingw32=-U_WIN32_WINNT -D_WIN32_WINNT=0x0601
Copy link
Member

Choose a reason for hiding this comment

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

nit: Maybe add a comment that this line might be revised in the future considering miniupnp/miniupnp#659?

Copy link
Member

@fanquake fanquake Jan 15, 2024

Choose a reason for hiding this comment

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

It's weird that miniupnpc would add a special build system option for setting a single, Windows-only define. It's not really clear what the benefits of that are over just using CPPFLAGS, which should always work. The only rationale from the PR author for not doing that was I don't like it..

Copy link
Member

Choose a reason for hiding this comment

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

Also incoroprated this in #29707.

index 433fc732..007ac729 100644
--- a/miniupnpc/CMakeLists.txt
+++ b/miniupnpc/CMakeLists.txt
@@ -99,7 +99,7 @@ if (UPNPC_BUILD_STATIC)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@@ -99,7 +99,7 @@ if (UPNPC_BUILD_STATIC)
@@ -116,7 +116,7 @@ if (UPNPC_BUILD_STATIC)

to avoid Hunk #1 succeeded at 116 (offset 17 lines).

endef

define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include $($(package)_staging_prefix_dir)/lib &&\
install *.h $($(package)_staging_prefix_dir)/include &&\
install ../*.h $($(package)_staging_prefix_dir)/include &&\
Copy link
Member

Choose a reason for hiding this comment

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

nit: Maybe skip headers that are used only to build the package:

Suggested change
install ../*.h $($(package)_staging_prefix_dir)/include &&\
install ../natpmp.h ../natpmp_declspec.h $($(package)_staging_prefix_dir)/include &&\

?

@fanquake
Copy link
Member

Looks good.

I spoke too soon. There are multiple issues here.

The main one is differences in the upstream Autotools & CMake buildsystems that make master and this PR produce completely different output. One example, when building miniupnpc, its Autotools build sets MINIUPNPC_GET_SRC_ADDR, which means recvfrom is used. However its CMake build does not, meaning recv is used instead. i.e:

# master
nm -C depends/aarch64-unknown-linux-gnu/lib/libminiupnpc.a | grep recv
                 U recvfrom
# this PR
nm -C depends/aarch64-unknown-linux-gnu/lib64/libminiupnpc.a | grep recv
                 U recv

So CMake isn't a drop-in replacement; and I'm assuming there will be other subtle differences (which may or may not matter to us). Anything we find are probably bugs that should be fixed upstream, unless they are not concerned about keeping the two build systems in sync?

Another issue is the same one that we had to fix in #28846. The upstream CMake build system uses GNUInstallDirs. So as you can see in the output above, with this PR, libs might end up in /lib64, depending on the system, which means we won't find them:

checking for miniupnpc/miniupnpc.h... yes
checking for miniupnpc/upnpcommands.h... yes
checking for miniupnpc/upnperrors.h... yes
checking for upnpDiscover in -lminiupnpc... no
...
  with upnp       = no

@theuni
Copy link
Member Author

theuni commented Jan 23, 2024

Closing in favor of #29298.

@theuni theuni closed this Jan 23, 2024
fanquake added a commit that referenced this pull request Jan 29, 2024
5b9d5bf depends: remove (darwin) libtool now that it's no longer used (Cory Fields)
3ef6563 depends: use ar rather than libtool for miniupnpc/libnatpmp (Cory Fields)

Pull request description:

  An alternative to #29232

  Rather than switching to the CMake builds which [proved problematic](#29232 (comment)), do the quick and dirty thing of just patching out libtool. Doesn't seem to introduce any new issues.

  This should buy us time to upstream the necessary CMake fixes.

ACKs for top commit:
  TheCharlatan:
    ACK 5b9d5bf
  fanquake:
    ACK 5b9d5bf

Tree-SHA512: c75c4bcc9332d8c1fc3395e2b5fc7265849186afc7005700f662ab291e6ea1f111025fad733d0b0b39d35029d1b757d3f1937d63aad3c0c3b88d0f8ac902ee18
@fanquake
Copy link
Member

However its CMake build does not, meaning recv is used instead. i.e:

Sent a change upstream miniupnp/miniupnp#721

@theuni
Copy link
Member Author

theuni commented Mar 22, 2024

Nice, thanks!

fanquake added a commit that referenced this pull request Apr 25, 2024
3c1ae3e depends: switch libnatpmp to CMake (Cory Fields)
72ba7b5 depends: libnatpmp f2433bec24ca3d3f22a8a7840728a3ac177f94ba (fanquake)

Pull request description:

  This picks up one of the changes from #29232, which is a switch to building libnatpmp with CMake. It includes an update to the most recent version of libnatpmp (miniupnp/libnatpmp@f2433be), which includes (miniupnp/libnatpmp#43).

  From an initial look I couldn't find any significant difference between the Autotools and CMake produced libs.

ACKs for top commit:
  m3dwards:
    ACK 3c1ae3e
  hebasto:
    ACK 3c1ae3e.
  TheCharlatan:
    ACK 3c1ae3e

Tree-SHA512: 1dd9d9933a5fceb9f8c4e1d68cd5cb4456a10a6dd27a6f6316f14493f9d2efad981ef8be9570c09ca82d45163aebd7f4cb2b2449989ec6084268ddba9a564c83
fanquake added a commit that referenced this pull request May 2, 2024
5195baa depends: fix miniupnpc snprintf usage on Windows (fanquake)
3c2d440 depends: switch miniupnpc to CMake (Cory Fields)
f5618c7 depends: add upstream CMake patch to miniupnpc (fanquake)
6866b57 depends: miniupnpc 2.2.7 (fanquake)

Pull request description:

  This picks up one of the changes from #29232, which is a switch to building miniupnpc with CMake. It includes an update to the most recent version of miniupnpc (2.2.7), which means we can drop one patch from that commit, and includes a new patch for a change I've upstreamed miniupnp/miniupnp#721, as well as some suggestions from the previous PR.

ACKs for top commit:
  theuni:
    ACK 5195baa.
  TheCharlatan:
    utACK 5195baa

Tree-SHA512: 5b27e132cd5eed285e9be34c8b96893417d92a1ae55c99345c9a89e1c1c5e40e4bc840bc061b879758b2b11fcb520cd98c3da985c1e153f2e5380cf63efe2d69
@bitcoin bitcoin locked and limited conversation to collaborators Mar 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants