mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
cmake: De-duplicate libraries where possible #35756
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35756
Loading…
Reference in a new issue
No description provided.
Delete branch "260720-link-dedup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Set the CMP0156 and CMP0179 policies to NEW. CMP0156 de-duplicates libraries on link lines based on linker capabilities; CMP0179 makes this de-duplication keep the first occurrence of static libraries. This silences Apple linker "ignoring duplicate libraries" warnings.
Both policies are gated on CMP0179, which requires CMake >=3.31, to avoid the intermediate CMake 3.29/3.30 behaviour where only CMP0156 is available. This requirement is satisfied by the current Homebrew package and the Guix build environment. On older versions, the policy guard makes this a no-op.
The Guix scripts for macOS have been updated to turn linker warnings into errors, as is done for other targets.
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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Would be good to clarify what has changed since you last PR'd this: #31504.
CMake's de-duplication behaviour has stabilised.
There is now a concrete motivation beyond log noise: extending the Guix warnings-as-errors treatment to Darwin (
github.com/bitcoin/bitcoin@b12a70f330) is blocked on the "ignoring duplicate libraries" warnings this PR silences.From https://github.com/bitcoin/bitcoin/pull/31504#issuecomment-2609542602:
Reworked to avoid the intermediate behaviour of CMake 3.29 or 3.30.
Why not do that here, if that is the motivation?
Yes, it's possible to pass
-DCMAKE_POLICY_DEFAULT_CMP0156=NEW -DCMAKE_POLICY_DEFAULT_CMP0179=NEWto thecmakeinvocation in the Guix scripts. The drawback of such an approach is affecting subtrees as well.However, I doubt it would be beneficial for the Guix builds to diverge in behaviour from every other build using a compatible CMake version, including the CI and everyday developers' builds. For example, in https://my.cdash.org/index.php?project=bitcoin-core.
My Guix build:
Thanks! Done.
My partial Guix build:
Guix build:
ACK
e6c1483832No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
e6c1483832e0· Full review report · Previous reportspermalink
Guix Build:
ACK
e6c1483832- can drop the Guix additions forCMAKE_LINK_WARNING_AS_ERRORin #35855. Can add that to macOS CI in #36936.Looks like we can't actually do this yet, because of a CMake bug. If you pass
CMAKE_LINK_WARNING_AS_ERROR, it tries to use--fatal-warningswithlld, when cross-compiling for Darwin on Linux.Reported upstream: https://gitlab.kitware.com/cmake/cmake/-/work_items/28316.
The upstream issue has been resolved in https://gitlab.kitware.com/cmake/cmake/-/merge_requests/12877.
Here is a build log with the CMake snapshot and
-DCMAKE_LINK_WARNING_AS_ERROR=ON: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/45653935912/job/139345448458.Great, thanks for following up.