bench: fix InputType ODR violation #36966

Manually merged
fanquake merged 2 commits from bench_odr_anon_namespace into master 2026-11-25 10:56:26 +00:00 AGit
fanquake commented 2026-11-24 15:01:05 +00:00 (Migrated from github.com)

Introduced in #36475:

/ci_container_base/src/bench/bip352.cpp:22:12: error: type ‘InputType’ violates the C++ One Definition Rule [-Werror=odr]
   22 | enum class InputType {
      |            ^
/ci_container_base/src/bench/sign_transaction.cpp:24:12: note: an enum with different value name is defined in another translation unit
   24 | enum class InputType {
      |            ^
/ci_container_base/src/bench/bip352.cpp:23:5: note: name ‘P2PKH’ differs from name ‘P2WPKH’ defined in another translation unit
   23 |     P2PKH,           // legacy pubkey-hash
      |     ^
/ci_container_base/src/bench/sign_transaction.cpp:25:5: note: mismatching definition
   25 |     P2WPKH, // segwitv0, witness-pubkey-hash (ECDSA signature)
      |     ^

There's a commit here that adds a CI config, using GCC and LTO, which uses -Wodr. The existing LTO config uses Clang, and I'm not sure about adding LTO to any existing job. However I do think we should be catching ODR violations in CI.

Introduced in #36475: ```bash /ci_container_base/src/bench/bip352.cpp:22:12: error: type ‘InputType’ violates the C++ One Definition Rule [-Werror=odr] 22 | enum class InputType { | ^ /ci_container_base/src/bench/sign_transaction.cpp:24:12: note: an enum with different value name is defined in another translation unit 24 | enum class InputType { | ^ /ci_container_base/src/bench/bip352.cpp:23:5: note: name ‘P2PKH’ differs from name ‘P2WPKH’ defined in another translation unit 23 | P2PKH, // legacy pubkey-hash | ^ /ci_container_base/src/bench/sign_transaction.cpp:25:5: note: mismatching definition 25 | P2WPKH, // segwitv0, witness-pubkey-hash (ECDSA signature) | ^ ``` There's a commit here that adds a CI config, using GCC and LTO, which uses `-Wodr`. The existing LTO config uses Clang, and I'm not sure about adding LTO to any existing job. However I do think we should be catching ODR violations in CI.
DrahtBot commented 2026-11-24 15:01:20 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK maflcko, hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36966 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36966.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36966#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [maflcko](https://github.com/bitcoin/bitcoin/pull/36966#issuecomment-7155462933), [hebasto](https://github.com/bitcoin/bitcoin/pull/36966#pullrequestreview-6056221781) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No findings were published from this review.

Review coverage was incomplete.


Reviewed: 66654bc5ce9b · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:301f8fac66b8cbe87114981d6600f15187695a2edf245458a232c3958e920add:3329223fb40bbbe44124b0523f0fa08f23650d06836368f60e45a38d2db02971 --> <!-- ralph-base:bb84842234f70446459edd1a0d63422ee29d5111 --> <!-- ralph-head:66654bc5ce9b1cf9613346107b9520ad003a68c4 --> <!-- ralph-case:25be2135a7917665fdc87add081eff0c1ef024826a3601d6d9f9fbf97e8a1af6 --> No findings were published from this review. Review coverage was incomplete. <!-- Review tier: standard --> --- Reviewed: [`66654bc5ce9b`](<https://git.fish.foo/bitcoin/bitcoin/commit/66654bc5ce9b1cf9613346107b9520ad003a68c4>) · [Review report](<https://review.fish.foo/report/36966-66654bc5ce9b1cf9613346107b9520ad003a68c4-3054-3.html>) · [Previous reports](<https://review.fish.foo/traces/36966/>) [permalink](<https://review.fish.foo/report/36966-66654bc5ce9b1cf9613346107b9520ad003a68c4-3054-3.html>)
maflcko (Migrated from github.com) reviewed 2026-11-24 16:05:30 +00:00
maflcko (Migrated from github.com) commented 2026-11-24 16:05:30 +00:00

Could add to the ci/test/00_setup_env_native_alpine_musl.sh, which already uses gcc and more likely will be using a more recent gcc than some Ubuntu LTS?

Could add to the `ci/test/00_setup_env_native_alpine_musl.sh`, which already uses gcc and more likely will be using a more recent gcc than some Ubuntu LTS?
fanquake (Migrated from github.com) reviewed 2026-11-24 16:46:54 +00:00
fanquake (Migrated from github.com) commented 2026-11-24 16:46:54 +00:00

Looks like they are currently using the same version (15.2.0). I can push that up to compare runtime to master.

Looks like they are currently using the same version (`15.2.0`). I can push that up to compare runtime to master.
fanquake (Migrated from github.com) reviewed 2026-11-24 17:36:25 +00:00
fanquake (Migrated from github.com) commented 2026-11-24 17:36:25 +00:00

20 minutes uncached seems reasonable. Have dropped the other config, if we're happy adding this to Alpine.

20 minutes uncached seems reasonable. Have dropped the other config, if we're happy adding this to Alpine.
maflcko (Migrated from github.com) approved these changes 2026-11-25 07:01:47 +00:00
maflcko (Migrated from github.com) left a comment

lgtm. Tested:

[ 64%] Linking CXX executable ../../bin/bench_bitcoin
cd "/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl/src/bench" && /usr/bin/cmake -E cmake_link_script CMakeFiles/bench_bitcoin.dir/link.txt --verbose=1
/usr/bin/g++ -O0 -ftrapv -O1 -g3 -g3 -flto=auto -fno-fat-lto-objects -fstack-reuse=none -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -Wl,--exclude-libs,ALL -fPIE -pie -Werror -Wl,--fatal-warnings -Wl,--dependency-file=CMakeFiles/bench_bitcoin.dir/link.d CMakeFiles/bench_bitcoin.dir/bench_bitcoin.cpp.o CMakeFiles/bench_bitcoin.dir/bench.cpp.o CMakeFiles/bench_bitcoin.dir/nanobench.cpp.o CMakeFiles/bench_bitcoin.dir/addrman.cpp.o CMakeFiles/bench_bitcoin.dir/base58.cpp.o CMakeFiles/bench_bitcoin.dir/bech32.cpp.o CMakeFiles/bench_bitcoin.dir/bip324_ecdh.cpp.o CMakeFiles/bench_bitcoin.dir/bip352.cpp.o CMakeFiles/bench_bitcoin.dir/block_assemble.cpp.o CMakeFiles/bench_bitcoin.dir/blockencodings.cpp.o CMakeFiles/bench_bitcoin.dir/ccoins_caching.cpp.o CMakeFiles/bench_bitcoin.dir/chacha20.cpp.o CMakeFiles/bench_bitcoin.dir/checkblock.cpp.o CMakeFiles/bench_bitcoin.dir/checkblockindex.cpp.o CMakeFiles/bench_bitcoin.dir/checkqueue.cpp.o CMakeFiles/bench_bitcoin.dir/cluster_linearize.cpp.o CMakeFiles/bench_bitcoin.dir/connectblock.cpp.o CMakeFiles/bench_bitcoin.dir/crypto_hash.cpp.o CMakeFiles/bench_bitcoin.dir/descriptors.cpp.o CMakeFiles/bench_bitcoin.dir/disconnected_transactions.cpp.o CMakeFiles/bench_bitcoin.dir/duplicate_inputs.cpp.o CMakeFiles/bench_bitcoin.dir/ellswift.cpp.o CMakeFiles/bench_bitcoin.dir/examples.cpp.o CMakeFiles/bench_bitcoin.dir/gcs_filter.cpp.o CMakeFiles/bench_bitcoin.dir/hashpadding.cpp.o CMakeFiles/bench_bitcoin.dir/index_blockfilter.cpp.o CMakeFiles/bench_bitcoin.dir/load_external.cpp.o CMakeFiles/bench_bitcoin.dir/lockedpool.cpp.o CMakeFiles/bench_bitcoin.dir/logging.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_ephemeral_spends.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_eviction.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_stress.cpp.o CMakeFiles/bench_bitcoin.dir/merkle_root.cpp.o CMakeFiles/bench_bitcoin.dir/obfuscation.cpp.o CMakeFiles/bench_bitcoin.dir/parse_hex.cpp.o CMakeFiles/bench_bitcoin.dir/peer_eviction.cpp.o CMakeFiles/bench_bitcoin.dir/poly1305.cpp.o CMakeFiles/bench_bitcoin.dir/pool.cpp.o CMakeFiles/bench_bitcoin.dir/prevector.cpp.o CMakeFiles/bench_bitcoin.dir/random.cpp.o CMakeFiles/bench_bitcoin.dir/readwriteblock.cpp.o CMakeFiles/bench_bitcoin.dir/rollingbloom.cpp.o CMakeFiles/bench_bitcoin.dir/rpc_blockchain.cpp.o CMakeFiles/bench_bitcoin.dir/rpc_mempool.cpp.o CMakeFiles/bench_bitcoin.dir/sign_transaction.cpp.o CMakeFiles/bench_bitcoin.dir/streams_findbyte.cpp.o CMakeFiles/bench_bitcoin.dir/strencodings.cpp.o CMakeFiles/bench_bitcoin.dir/txgraph.cpp.o CMakeFiles/bench_bitcoin.dir/txorphanage.cpp.o CMakeFiles/bench_bitcoin.dir/uint256_blob.cpp.o CMakeFiles/bench_bitcoin.dir/util_time.cpp.o CMakeFiles/bench_bitcoin.dir/verify_script.cpp.o CMakeFiles/bench_bitcoin.dir/asmap.cpp.o CMakeFiles/bench_bitcoin.dir/coin_selection.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_balance.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_create.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_create_tx.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_encrypt.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_loading.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_ismine.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_migration.cpp.o -o ../../bin/bench_bitcoin  ../../lib/libtest_util.a ../../lib/libbitcoin_node.a ../../lib/libbitcoin_wallet.a ../../lib/libbitcoin_zmq.a /ci_container_base/depends/x86_64-pc-linux-musl/lib/libzmq.a ../libleveldb.a ../libcrc32c.a ../libminisketch.a /ci_container_base/depends/x86_64-pc-linux-musl/lib/libsqlite3.a ../../lib/libbitcoin_common.a ../univalue/libunivalue.a ../../lib/libbitcoin_util.a ../../lib/libbitcoin_clientversion.a ../../lib/libbitcoin_consensus.a ../../lib/libbitcoin_crypto.a ../secp256k1/lib/libsecp256k1.a /ci_container_base/src/bench/bip352.cpp:22:12: error: type 'InputType' violates the C++ One Definition Rule [-Werror=odr]
   22 | enum class InputType {
      |            ^
/ci_container_base/src/bench/sign_transaction.cpp:24:12: note: an enum with different value name is defined in another translation unit
   24 | enum class InputType {
      |            ^
/ci_container_base/src/bench/bip352.cpp:23:5: note: name 'P2PKH' differs from name 'P2WPKH' defined in another translation unit
   23 |     P2PKH,           // legacy pubkey-hash
      |     ^
/ci_container_base/src/bench/sign_transaction.cpp:25:5: note: mismatching definition
   25 |     P2WPKH, // segwitv0, witness-pubkey-hash (ECDSA signature)
      |     ^
lto1: all warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-alpine-linux-musl/15.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

gmake[2]: *** [src/bench/CMakeFiles/bench_bitcoin.dir/build.make:1088: bin/bench_bitcoin] Error 1
gmake[2]: Leaving directory '/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl'
gmake[1]: *** [CMakeFiles/Makefile2:3291: src/bench/CMakeFiles/bench_bitcoin.dir/all] Error 2
gmake[1]: Leaving directory '/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl'
gmake: *** [Makefile:146: all] Error 2

lgtm. Tested: ``` [ 64%] Linking CXX executable ../../bin/bench_bitcoin cd "/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl/src/bench" && /usr/bin/cmake -E cmake_link_script CMakeFiles/bench_bitcoin.dir/link.txt --verbose=1 /usr/bin/g++ -O0 -ftrapv -O1 -g3 -g3 -flto=auto -fno-fat-lto-objects -fstack-reuse=none -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -Wl,--exclude-libs,ALL -fPIE -pie -Werror -Wl,--fatal-warnings -Wl,--dependency-file=CMakeFiles/bench_bitcoin.dir/link.d CMakeFiles/bench_bitcoin.dir/bench_bitcoin.cpp.o CMakeFiles/bench_bitcoin.dir/bench.cpp.o CMakeFiles/bench_bitcoin.dir/nanobench.cpp.o CMakeFiles/bench_bitcoin.dir/addrman.cpp.o CMakeFiles/bench_bitcoin.dir/base58.cpp.o CMakeFiles/bench_bitcoin.dir/bech32.cpp.o CMakeFiles/bench_bitcoin.dir/bip324_ecdh.cpp.o CMakeFiles/bench_bitcoin.dir/bip352.cpp.o CMakeFiles/bench_bitcoin.dir/block_assemble.cpp.o CMakeFiles/bench_bitcoin.dir/blockencodings.cpp.o CMakeFiles/bench_bitcoin.dir/ccoins_caching.cpp.o CMakeFiles/bench_bitcoin.dir/chacha20.cpp.o CMakeFiles/bench_bitcoin.dir/checkblock.cpp.o CMakeFiles/bench_bitcoin.dir/checkblockindex.cpp.o CMakeFiles/bench_bitcoin.dir/checkqueue.cpp.o CMakeFiles/bench_bitcoin.dir/cluster_linearize.cpp.o CMakeFiles/bench_bitcoin.dir/connectblock.cpp.o CMakeFiles/bench_bitcoin.dir/crypto_hash.cpp.o CMakeFiles/bench_bitcoin.dir/descriptors.cpp.o CMakeFiles/bench_bitcoin.dir/disconnected_transactions.cpp.o CMakeFiles/bench_bitcoin.dir/duplicate_inputs.cpp.o CMakeFiles/bench_bitcoin.dir/ellswift.cpp.o CMakeFiles/bench_bitcoin.dir/examples.cpp.o CMakeFiles/bench_bitcoin.dir/gcs_filter.cpp.o CMakeFiles/bench_bitcoin.dir/hashpadding.cpp.o CMakeFiles/bench_bitcoin.dir/index_blockfilter.cpp.o CMakeFiles/bench_bitcoin.dir/load_external.cpp.o CMakeFiles/bench_bitcoin.dir/lockedpool.cpp.o CMakeFiles/bench_bitcoin.dir/logging.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_ephemeral_spends.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_eviction.cpp.o CMakeFiles/bench_bitcoin.dir/mempool_stress.cpp.o CMakeFiles/bench_bitcoin.dir/merkle_root.cpp.o CMakeFiles/bench_bitcoin.dir/obfuscation.cpp.o CMakeFiles/bench_bitcoin.dir/parse_hex.cpp.o CMakeFiles/bench_bitcoin.dir/peer_eviction.cpp.o CMakeFiles/bench_bitcoin.dir/poly1305.cpp.o CMakeFiles/bench_bitcoin.dir/pool.cpp.o CMakeFiles/bench_bitcoin.dir/prevector.cpp.o CMakeFiles/bench_bitcoin.dir/random.cpp.o CMakeFiles/bench_bitcoin.dir/readwriteblock.cpp.o CMakeFiles/bench_bitcoin.dir/rollingbloom.cpp.o CMakeFiles/bench_bitcoin.dir/rpc_blockchain.cpp.o CMakeFiles/bench_bitcoin.dir/rpc_mempool.cpp.o CMakeFiles/bench_bitcoin.dir/sign_transaction.cpp.o CMakeFiles/bench_bitcoin.dir/streams_findbyte.cpp.o CMakeFiles/bench_bitcoin.dir/strencodings.cpp.o CMakeFiles/bench_bitcoin.dir/txgraph.cpp.o CMakeFiles/bench_bitcoin.dir/txorphanage.cpp.o CMakeFiles/bench_bitcoin.dir/uint256_blob.cpp.o CMakeFiles/bench_bitcoin.dir/util_time.cpp.o CMakeFiles/bench_bitcoin.dir/verify_script.cpp.o CMakeFiles/bench_bitcoin.dir/asmap.cpp.o CMakeFiles/bench_bitcoin.dir/coin_selection.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_balance.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_create.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_create_tx.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_encrypt.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_loading.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_ismine.cpp.o CMakeFiles/bench_bitcoin.dir/wallet_migration.cpp.o -o ../../bin/bench_bitcoin ../../lib/libtest_util.a ../../lib/libbitcoin_node.a ../../lib/libbitcoin_wallet.a ../../lib/libbitcoin_zmq.a /ci_container_base/depends/x86_64-pc-linux-musl/lib/libzmq.a ../libleveldb.a ../libcrc32c.a ../libminisketch.a /ci_container_base/depends/x86_64-pc-linux-musl/lib/libsqlite3.a ../../lib/libbitcoin_common.a ../univalue/libunivalue.a ../../lib/libbitcoin_util.a ../../lib/libbitcoin_clientversion.a ../../lib/libbitcoin_consensus.a ../../lib/libbitcoin_crypto.a ../secp256k1/lib/libsecp256k1.a /ci_container_base/src/bench/bip352.cpp:22:12: error: type 'InputType' violates the C++ One Definition Rule [-Werror=odr] 22 | enum class InputType { | ^ /ci_container_base/src/bench/sign_transaction.cpp:24:12: note: an enum with different value name is defined in another translation unit 24 | enum class InputType { | ^ /ci_container_base/src/bench/bip352.cpp:23:5: note: name 'P2PKH' differs from name 'P2WPKH' defined in another translation unit 23 | P2PKH, // legacy pubkey-hash | ^ /ci_container_base/src/bench/sign_transaction.cpp:25:5: note: mismatching definition 25 | P2WPKH, // segwitv0, witness-pubkey-hash (ECDSA signature) | ^ lto1: all warnings being treated as errors lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-alpine-linux-musl/15.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status gmake[2]: *** [src/bench/CMakeFiles/bench_bitcoin.dir/build.make:1088: bin/bench_bitcoin] Error 1 gmake[2]: Leaving directory '/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl' gmake[1]: *** [CMakeFiles/Makefile2:3291: src/bench/CMakeFiles/bench_bitcoin.dir/all] Error 2 gmake[1]: Leaving directory '/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-musl' gmake: *** [Makefile:146: all] Error 2
maflcko (Migrated from github.com) commented 2026-11-25 06:14:53 +00:00

maybe in a new commit: Should this be enabled globally in CI like:

ci/test/03_test_script.sh:98:BITCOIN_CONFIG_ALL=(-DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_INSTALL_PREFIX="$BASE_OUTDIR" -Werror=dev)
.github/ci-test-each-commit-exec.py:41:        "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
.github/ci-windows.py:32:        "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
.github/ci-windows.py:38:        "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
maybe in a new commit: Should this be enabled globally in CI like: ``` ci/test/03_test_script.sh:98:BITCOIN_CONFIG_ALL=(-DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_INSTALL_PREFIX="$BASE_OUTDIR" -Werror=dev) .github/ci-test-each-commit-exec.py:41: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON", .github/ci-windows.py:32: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON", .github/ci-windows.py:38: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
maflcko commented 2026-11-25 07:04:42 +00:00 (Migrated from github.com)

review ACK 66654bc5ce 🐨

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4 🐨
rqivzpu250VjPa54pZci92+ktdflJMSjPmbQIYdIj2oNmd1//vmWGbnv+pVMFeIRvlcTJudppEVHviEc7ulzBg==
review ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4 🐨 <details><summary>Show signature</summary> Signature: ``` untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4 🐨 rqivzpu250VjPa54pZci92+ktdflJMSjPmbQIYdIj2oNmd1//vmWGbnv+pVMFeIRvlcTJudppEVHviEc7ulzBg== ``` </details>
fanquake (Migrated from github.com) reviewed 2026-11-25 09:06:31 +00:00
fanquake (Migrated from github.com) commented 2026-11-25 09:06:31 +00:00

Yea. We could add -DCMAKE_LINK_WARNING_AS_ERROR=ON to jobs with CMake 4.0+, just need to avoid the macOS cross jobs due to upstream bugs: https://github.com/bitcoin/bitcoin/pull/35756#issuecomment-7104061664.

Yea. We could add `-DCMAKE_LINK_WARNING_AS_ERROR=ON` to jobs with CMake 4.0+, just need to avoid the macOS cross jobs due to upstream bugs: https://github.com/bitcoin/bitcoin/pull/35756#issuecomment-7104061664.
maflcko (Migrated from github.com) reviewed 2026-11-25 09:33:46 +00:00
maflcko (Migrated from github.com) commented 2026-11-25 09:33:46 +00:00

Ok, I see. Let's wait for the upstream bug to be fixed first and then just add -DCMAKE_LINK_WARNING_AS_ERROR=ON globally? IIUC older cmake will just ignore it, which should be fine to avoid the verbosity here of having to place it in every ci task one-by-one?

Ok, I see. Let's wait for the upstream bug to be fixed first and then just add `-DCMAKE_LINK_WARNING_AS_ERROR=ON` globally? IIUC older cmake will just ignore it, which should be fine to avoid the verbosity here of having to place it in every ci task one-by-one?
hebasto (Migrated from github.com) approved these changes 2026-11-25 10:52:43 +00:00
hebasto (Migrated from github.com) left a comment

ACK 66654bc5ce, tested on Fedora 45.

nit: The INTERPROCEDURAL_OPTIMIZATION target property, which CMAKE_INTERPROCEDURAL_OPTIMIZATION initializes, is a CMake abstraction that is designed to be used along with the CheckIPOSupported module. Now that we are about to start using CMAKE_INTERPROCEDURAL_OPTIMIZATION in the regular CI builds, I believe we should add that check to the build system.

Note: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON is already used in ci/test/00_setup_env_native_chimera_lto.sh, but that config is not part of the regular CI builds.

ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4, tested on Fedora 45. nit: The `INTERPROCEDURAL_OPTIMIZATION` target property, which `CMAKE_INTERPROCEDURAL_OPTIMIZATION` initializes, is a CMake abstraction that is designed to be used along with the [`CheckIPOSupported`](https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html) module. Now that we are about to start using `CMAKE_INTERPROCEDURAL_OPTIMIZATION` in the regular CI builds, I believe we should add that check to the build system. Note: `-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` is already used in `ci/test/00_setup_env_native_chimera_lto.sh`, but that config is not part of the regular CI builds.
fanquake commented 2026-11-25 10:57:38 +00:00 (Migrated from github.com)

I believe we should add that check to the build system.

Can you elaborate? Not sure I'm following in why we need to add more custom checks/machinery to our build system, to just use normal CMake config options? (also not sure why CI use makes a difference here, because the option can be used, and is already being used, by anyone, outside the CI?)

> I believe we should add that check to the build system. Can you elaborate? Not sure I'm following in why we need to add more custom checks/machinery to our build system, to just use normal CMake config options? (also not sure why CI use makes a difference here, because the option can be used, and is already being used, by anyone, outside the CI?)
hebasto commented 2026-11-25 11:07:12 +00:00 (Migrated from github.com)

I believe we should add that check to the build system.

Can you elaborate? Not sure I'm following in why we need to add more custom checks/machinery to our build system, to just use normal CMake config options?

From https://cmake.org/cmake/help/latest/policy/CMP0069.html:

Use the CheckIPOSupported module to detect whether IPO is supported by the current compiler, environment, and CMake version.

> > I believe we should add that check to the build system. > > Can you elaborate? Not sure I'm following in why we need to add more custom checks/machinery to our build system, to just use normal CMake config options? From https://cmake.org/cmake/help/latest/policy/CMP0069.html: > Use the [CheckIPOSupported](https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html#module:CheckIPOSupported) module to detect whether IPO is supported by the current compiler, environment, and CMake version.
fanquake commented 2026-11-25 11:15:44 +00:00 (Migrated from github.com)

From https://cmake.org/cmake/help/latest/policy/CMP0069.html:

Ok. Seems like the build will error in any case, if someone passes CMAKE_INTERPROCEDURAL_OPTIMIZATION and their compiler doesn't support it, but adding a call to CheckIPOSupported would also cause an error for anyone not using LTO, if their compiler didn't support it (which even if unlikely, I'm not sure we want). Can be discussed in a new PR if needed.

> From https://cmake.org/cmake/help/latest/policy/CMP0069.html: Ok. Seems like the build will error in any case, if someone passes `CMAKE_INTERPROCEDURAL_OPTIMIZATION` and their compiler doesn't support it, but adding a call to `CheckIPOSupported` would also cause an error for anyone not using LTO, if their compiler didn't support it (which even if unlikely, I'm not sure we want). Can be discussed in a new PR if needed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36966
No description provided.