{
 "number": 35756,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35756",
 "title": "cmake: De-duplicate libraries where possible",
 "author": "hebasto",
 "author_association": "MEMBER",
 "created_at": "2026-07-20T15:47:26Z",
 "updated_at": "2026-08-12T19:48:09Z",
 "age_days": 59,
 "draft": false,
 "labels": [
  "Build system"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "e6c1483832e018ccafc04fdc4faf051d13fc09d4",
 "head_ref": "260720-link-dedup",
 "head_repo": "hebasto/bitcoin",
 "head_history": [
  {
   "t": "2026-08-12T11:12:27Z",
   "sha": "1714370aa60ce88941ae95b06f4eb6d7dae1650a"
  }
 ],
 "additions": 23,
 "deletions": 2,
 "changed_files": 3,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "fanquake"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-08-12T19:48:09Z",
  "last_reviewer_activity": "2026-08-12T12:35:13Z",
  "last_reviewer": "fanquake",
  "author_silent_days": 35,
  "waiting_on_author_days": 0,
  "days_since_update": 35
 },
 "refs": {
  "mentioned": [
   31504
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 31504,
    "type": "pull",
    "state": "closed",
    "merged": false,
    "merged_at": null,
    "title": "cmake: De-duplicate libraries on link lines opportunistically"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Set the [CMP0156](https://cmake.org/cmake/help/latest/policy/CMP0156.html) and [CMP0179](https://cmake.org/cmake/help/latest/policy/CMP0179.html) 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.\n\nBoth 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.\n\nThe Guix scripts for macOS have been updated to turn linker warnings into errors, as is [done](https://github.com/fanquake/bitcoin/commit/1714953eff0544d6085c4c1cc4270a891dd995c0) for other targets.",
 "commits": [
  {
   "sha": "1714370aa60ce88941ae95b06f4eb6d7dae1650a",
   "date": "2026-08-12T11:12:04Z",
   "message": "cmake: De-duplicate libraries where possible\n\nSet the CMP0156 and CMP0179 policies to NEW. CMP0156 de-duplicates\nlibraries on link lines based on linker capabilities; CMP0179 makes\nthis de-duplication keep the first occurrence of static libraries.\nThis silences Apple linker \"ignoring duplicate libraries\" warnings.\n\nBoth policies are gated on CMP0179, which requires CMake >=3.31, to\navoid the intermediate CMake 3.29/3.30 behaviour where only CMP0156\nis available. This requirement is satisfied by the current Homebrew\npackage and the Guix build environment. On older versions the policy\nguard makes this a no-op."
  },
  {
   "sha": "e6c1483832e018ccafc04fdc4faf051d13fc09d4",
   "date": "2026-08-12T19:17:26Z",
   "message": "guix: Turn macOS linker warnings into errors"
  }
 ],
 "timeline": [
  {
   "t": "2026-07-20T15:53:12Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "Would be good to clarify what has changed since you last PR'd this: #31504."
  },
  {
   "t": "2026-08-12T11:12:27Z",
   "kind": "force_push",
   "who": "hebasto",
   "commit": "1714370aa60ce88941ae95b06f4eb6d7dae1650a"
  },
  {
   "t": "2026-08-12T11:19:01Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\n1. CMake's de-duplication behaviour has stabilised.\n\n2. There is now a concrete motivation beyond log noise: extending the Guix warnings-as-errors treatment to Darwin (https://github.com/bitcoin/bitcoin/commit/b12a70f330d0ffcc3064ecf2643f8cfe765cf9c8) is blocked on the \"ignoring duplicate libraries\" warnings this PR silences.\n\nFrom https://github.com/bitcoin/bitcoin/pull/31504#issuecomment-2609542602:\n[quoted text omitted]\n\nReworked to avoid the intermediate behaviour of CMake 3.29 or 3.30."
  },
  {
   "t": "2026-08-12T12:35:13Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nWhy not do that here, if that is the motivation?"
  },
  {
   "t": "2026-08-12T18:52:04Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "My Guix build:\n```\naarch64\n51d2eb6a07ab8f8640f86c174c4ffd8ba3395240f319bc1b1f026a3f75112a0d  guix-build-1714370aa60c/output/aarch64-linux-gnu/SHA256SUMS.part\n62811ef20daa47fa21cf1b89219c8ba7474cc4744a0b90490719553b22cff67c  guix-build-1714370aa60c/output/aarch64-linux-gnu/bitcoin-1714370aa60c-aarch64-linux-gnu-debug.tar.gz\nea1f50d429f32cc2069b53733bee3219699ead546e4cd1e82a2a7fe13c4418a0  guix-build-1714370aa60c/output/aarch64-linux-gnu/bitcoin-1714370aa60c-aarch64-linux-gnu.tar.gz\nc09d36b16fc3963c3d2b5d5e818a95d9384b98b29c8aa57db157c0b73d038cf6  guix-build-1714370aa60c/output/arm-linux-gnueabihf/SHA256SUMS.part\n32a3d4d31fc61b97046fbd40c85855bdad3f3a40ba49d6c5cb616b393d610dd4  guix-build-1714370aa60c/output/arm-linux-gnueabihf/bitcoin-1714370aa60c-arm-linux-gnueabihf-debug.tar.gz\n949e6d6f50cd657d3820d38a43a03f4a399619900d83b2a144a6bfcfadf0621a  guix-build-1714370aa60c/output/arm-linux-gnueabihf/bitcoin-1714370aa60c-arm-linux-gnueabihf.tar.gz\nd41e55cbff1bd83a7a93befe90ae0992e22fabac4609eb9b212b04766ff3917b  guix-build-1714370aa60c/output/arm64-apple-darwin/SHA256SUMS.part\n8d7dfe0f999912ee9215c46ac64f79504f78747e03a9b9d7f50584827e995693  guix-build-1714370aa60c/output/arm64-apple-darwin/bitcoin-1714370aa60c-arm64-apple-darwin-codesigning.tar.gz\n65d3ebe8e770ef8f216b548d9763213c2cc62bc61464140c09679df2c71e327e  guix-build-1714370aa60c/output/arm64-apple-darwin/bitcoin-1714370aa60c-arm64-apple-darwin-unsigned.tar.gz\nba09b45dadd3615cba08c1ba224424c61c3a1cfaf0e092811dba6b0335f0730b  guix-build-1714370aa60c/output/arm64-apple-darwin/bitcoin-1714370aa60c-arm64-apple-darwin-unsigned.zip\nc827be0bbc3491af4ac6fb77698f9ce059df10bfb37e82bcd29d92ea0839574f  guix-build-1714370aa60c/output/dist-archive/bitcoin-1714370aa60c.tar.gz\na38ff7eb82d693964f78eacbf5b7737ceecbbcfe1b0ff9deda8c8c9776b43adc  guix-build-1714370aa60c/output/powerpc64-linux-gnu/SHA256SUMS.part\n7b072a4bc6cc294a1f4fb1e301c487843f4b14e11f2cca39214d74b195221747  guix-build-1714370aa60c/output/powerpc64-linux-gnu/bitcoin-1714370aa60c-powerpc64-linux-gnu-debug.tar.gz\n258c323f60979aa12918880123fb0055cfd6463a214aea1726b455fd24e8c2ee  guix-build-1714370aa60c/output/powerpc64-linux-gnu/bitcoin-1714370aa60c-powerpc64-linux-gnu.tar.gz\n8849236cff6396f5a6107c708025e217f9bd43e2afe5a96d2839511a89baafeb  guix-build-1714370aa60c/output/riscv64-linux-gnu/SHA256SUMS.part\n1d366aace9e73280b0316b85b346b44ba74e32a95d80e9caa21ba8e03d6c0fd0  guix-build-1714370aa60c/output/riscv64-linux-gnu/bitcoin-1714370aa60c-riscv64-linux-gnu-debug.tar.gz\nce50a214d555a3a6feca732c8e4bee32c73d218b7d1ef4364cb30e0e76c263db  guix-build-1714370aa60c/output/riscv64-linux-gnu/bitcoin-1714370aa60c-riscv64-linux-gnu.tar.gz\n9ff632f5e22762de053bf126cdcc2ec89b124bba071ab870a94539f660fa83e5  guix-build-1714370aa60c/output/x86_64-apple-darwin/SHA256SUMS.part\ndddbd7d31bc5953bfb80c079f265b1a5354fda24cda848cc4046b960d4dc0390  guix-build-1714370aa60c/output/x86_64-apple-darwin/bitcoin-1714370aa60c-x86_64-apple-darwin-codesigning.tar.gz\n0008eb18e8127afbcae85475cdeccddca454fccd92a5d858641844309e6360c9  guix-build-1714370aa60c/output/x86_64-apple-darwin/bitcoin-1714370aa60c-x86_64-apple-darwin-unsigned.tar.gz\n915d8855291bd858bc7889701e31ecedc6912c050ac0ad3af4d7bb8ecb42467e  guix-build-1714370aa60c/output/x86_64-apple-darwin/bitcoin-1714370aa60c-x86_64-apple-darwin-unsigned.zip\nc5ad5c89a579bdb91aad9dabd6027de3de74f75180bb5df5ef7aff79ff02c79f  guix-build-1714370aa60c/output/x86_64-linux-gnu/SHA256SUMS.part\nc0d21fb66f1a2c9ec6c7a74b46b1fc0e318186ceaeae36c53710300ed52941ae  guix-build-1714370aa60c/output/x86_64-linux-gnu/bitcoin-1714370aa60c-x86_64-linux-gnu-debug.tar.gz\nb02f8276c9b90b9756d4d85caa92030d5319f144eb6b058e4e374423be5b6298  guix-build-1714370aa60c/output/x86_64-linux-gnu/bitcoin-1714370aa60c-x86_64-linux-gnu.tar.gz\n33b17bb9931ec95b9120c05d058a133d2fafa7486c41f7872ef074d4a2964485  guix-build-1714370aa60c/output/x86_64-w64-mingw32/SHA256SUMS.part\na2d55a0c8bcdb63a452ed6516a8206baf13a8082538fd1ad8ff7194cff362830  guix-build-1714370aa60c/output/x86_64-w64-mingw32/bitcoin-1714370aa60c-win64-codesigning.tar.gz\ne4065ebe5f73c47dc0840a363ad9d82df08c2b29d9de289902b5ca88e275738b  guix-build-1714370aa60c/output/x86_64-w64-mingw32/bitcoin-1714370aa60c-win64-debug.zip\n9e43266ae7175a5e4ba03acbaf64d0821b5b5edf2c0736bd7539a537cc691de2  guix-build-1714370aa60c/output/x86_64-w64-mingw32/bitcoin-1714370aa60c-win64-setup-unsigned.exe\n5316405e88485fd377e85c12b6ac392cd91adc56bad4defde0fc2e2664afe1fa  guix-build-1714370aa60c/output/x86_64-w64-mingw32/bitcoin-1714370aa60c-win64-unsigned.zip\n```"
  },
  {
   "t": "2026-08-12T19:48:09Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nThanks! Done.\n\nMy partial Guix build:\n```\nx86_64\ne4328a1acc7be5065d20e4c5efa3668534d78b3c7e1b2a30d7774920bcb78d34  guix-build-e6c1483832e0/output/arm64-apple-darwin/SHA256SUMS.part\n47b69febdd21bcc726ac3d0218382b24f5d9ad3eb2f38843aeb7fa3e97875b42  guix-build-e6c1483832e0/output/arm64-apple-darwin/bitcoin-e6c1483832e0-arm64-apple-darwin-codesigning.tar.gz\nf3bcbddfc773f1237ec2cc580a04c74003517fa9bbe66117fe2d0bb654feefc0  guix-build-e6c1483832e0/output/arm64-apple-darwin/bitcoin-e6c1483832e0-arm64-apple-darwin-unsigned.tar.gz\n9dcc1cc32ba1b3f5dfe0ed111bf101e46fbe5f2016fd90db5f72f45b6ec40524  guix-build-e6c1483832e0/output/arm64-apple-darwin/bitcoin-e6c1483832e0-arm64-apple-darwin-unsigned.zip\n8b128364dcf1aafaa5c246196969680429dc6521a9372c382209363f041ba59d  guix-build-e6c1483832e0/output/dist-archive/bitcoin-e6c1483832e0.tar.gz\n8f283d72c3b2eaa2d50c25f1f0685a6f95eb29538b6666f19c1795adc165c4ec  guix-build-e6c1483832e0/output/x86_64-apple-darwin/SHA256SUMS.part\n9123fc164b57733c258a7ba5e4c299b9522b844315aee91211ced9b12a5fb8b0  guix-build-e6c1483832e0/output/x86_64-apple-darwin/bitcoin-e6c1483832e0-x86_64-apple-darwin-codesigning.tar.gz\n63dc85e4f4a19bb34554ab530aaab60b3beb116c528972818c4f815c3fcc98fd  guix-build-e6c1483832e0/output/x86_64-apple-darwin/bitcoin-e6c1483832e0-x86_64-apple-darwin-unsigned.tar.gz\nae1f46f2f0bc32ac7f2a8e203ee96965b8b1fe6000ed47b4e22ec45a007ac0ac  guix-build-e6c1483832e0/output/x86_64-apple-darwin/bitcoin-e6c1483832e0-x86_64-apple-darwin-unsigned.zip\n```"
  }
 ],
 "labels_log": [
  {
   "t": "2026-07-20T15:47:28Z",
   "action": "labeled",
   "label": "Build system",
   "who": "hebasto"
  }
 ],
 "state_log": [
  {
   "t": "2026-08-12T11:18:51Z",
   "kind": "ready_for_review",
   "who": "hebasto"
  }
 ],
 "text_chars": 8325,
 "text_tokens_estimate": 2081,
 "changed_paths": [
  "CMakeLists.txt",
  "contrib/guix/libexec/build_macos.sh",
  "contrib/guix/libexec/build_macos_gui.sh"
 ],
 "files": [
  {
   "path": "CMakeLists.txt",
   "add": 13,
   "del": 0
  },
  {
   "path": "contrib/guix/libexec/build_macos.sh",
   "add": 5,
   "del": 1
  },
  {
   "path": "contrib/guix/libexec/build_macos_gui.sh",
   "add": 5,
   "del": 1
  }
 ],
 "test_lines": 12,
 "git": {
  "head": "e6c1483832e018ccafc04fdc4faf051d13fc09d4",
  "head_matches_backup": true,
  "base": "4c045f1a0323af6621100a7e6479f04205d50c7a",
  "commits": [
   {
    "sha": "1714370aa6",
    "subject": "cmake: De-duplicate libraries where possible",
    "files": 1,
    "add": 13,
    "del": 0
   },
   {
    "sha": "e6c1483832",
    "subject": "guix: Turn macOS linker warnings into errors",
    "files": 2,
    "add": 10,
    "del": 2
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "8bd9ce9e43e0ada1",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}