{
 "number": 36708,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36708",
 "title": "guix: map the whole DISTSRC in -fdebug-prefix-map",
 "author": "jespada",
 "author_association": "FIRST_TIME_CONTRIBUTOR",
 "created_at": "2026-10-30T14:52:18Z",
 "updated_at": "2026-10-30T14:58:18Z",
 "description_hash": "0777d8bb1d135182",
 "age_days": 2,
 "draft": false,
 "labels": [
  "Build system",
  "DrahtBot Guix build requested"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "00867d70c01bda444ef1ba5e798a4d1401c5edd7",
 "head_ref": "guix-debug-prefix-map",
 "head_repo": "jespada/bitcoin",
 "head_history": [],
 "additions": 4,
 "deletions": 4,
 "changed_files": 4,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "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": []
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-30T14:55:10Z",
  "last_reviewer_activity": null,
  "last_reviewer": null,
  "author_silent_days": 2,
  "waiting_on_author_days": 0,
  "days_since_update": 2
 },
 "refs": {
  "mentioned": [
   34414
  ],
  "depends_on": [],
  "fixes": [
   34414
  ],
  "linked_issues": [
   {
    "number": 34414,
    "type": "issue",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "guix: Re-evaluate fdebug-prefix-map"
   }
  ],
  "references": [
   {
    "number": 34414,
    "type": "issue",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "guix: Re-evaluate fdebug-prefix-map"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Fixes #34414.\n\n### Why\n\nThe Guix build scripts set `-fdebug-prefix-map=${DISTSRC}/src=.`. Generated sources (for example the capnp proxies) are in the build tree, outside `${DISTSRC}/src`, so their debug info kept the absolute `/distsrc-base/distsrc-<commit>-<host>/build/...` path. Sources from `src/` were relative. With two kinds of paths, it is hard to set up source path mapping in a debugger.\n\nThis maps `${DISTSRC}` instead, in `build_linux.sh`, `build_linux_gui.sh`, `build_win.sh` and `build_win_gui.sh`. The macOS scripts do not set `-fdebug-prefix-map`, so this PR does not change them.\n\n### What changes in the debug paths\n\nAll source paths are now relative to the repository root:\n\n| | Before | After |\n|---|---|---|\n| Source in `src/` | `./netaddress.cpp` | `./src/netaddress.cpp` |\n| Generated source | `/distsrc-base/distsrc-<commit>-<host>/build/src/ipc/capnp/init.capnp.proxy-client.c++` | `./build/src/ipc/capnp/init.capnp.proxy-client.c++` |\n\nTo find the sources in gdb, use the repository root as the source directory (`directory /path/to/bitcoin`) instead of `src/`.\n\n### How I checked\n\n- Guix build of this change on an x86_64 build machine, for the six Linux and Windows hosts.\n- `readelf --debug-dump=info`, `--debug-dump=rawline` and `--debug-dump=str` of `libexec/bitcoin-node.dbg` (x86_64-linux-gnu): no `distsrc` string. Sources show as `./src/...`, generated capnp files as `./build/src/...`.\n- `bitcoind.exe.dbg` from the Windows debug zip: no `distsrc` string.\n- The only absolute paths left come from the Guix toolchain (glibc, libgcc). This change does not affect them.\n\nI will post the Guix hashes for this commit in a comment. I do not have an aarch64 build machine at the moment, so a build from someone with one is welcome.",
 "commits": [
  {
   "sha": "00867d70c01bda444ef1ba5e798a4d1401c5edd7",
   "date": "2026-10-30T11:56:46Z",
   "message": "guix: map the whole DISTSRC in -fdebug-prefix-map\n\nGenerated sources (e.g. capnp proxies) live in the build tree, outside\n${DISTSRC}/src, so their debug paths kept the absolute /distsrc-base\nprefix. Map ${DISTSRC} instead so every source path is relative.\n\nFixes #34414."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-30T14:55:10Z",
   "kind": "comment",
   "who": "jespada",
   "assoc": "NONE",
   "text": "Guix build of 00867d70c01b (x86_64 build machine):\n\n```\nx86_64\nc1d8031f2cd1d06378eb804baf9a52fe37d119ca8005da4080543c6be4ed4596  guix-build-00867d70c01b/output/aarch64-linux-gnu/SHA256SUMS.part\n7370e22fdefad1459b20ee01304b1a94fbf85a9eca0bc645aa8ff995503d6cb2  guix-build-00867d70c01b/output/aarch64-linux-gnu/bitcoin-00867d70c01b-aarch64-linux-gnu-debug.tar.gz\n5426e4f03c118ab9f7b8eb264e2fae3adced11aef5b664c07d7402efa1607568  guix-build-00867d70c01b/output/aarch64-linux-gnu/bitcoin-00867d70c01b-aarch64-linux-gnu.tar.gz\na2704be6259457791b736bd342efe6da9ce71cb08832a6212593f51421722ec4  guix-build-00867d70c01b/output/arm-linux-gnueabihf/SHA256SUMS.part\n0f8d323cafd3ce138cbb9032ee433e5c9587965a1d0035172a31dffa9fd23506  guix-build-00867d70c01b/output/arm-linux-gnueabihf/bitcoin-00867d70c01b-arm-linux-gnueabihf-debug.tar.gz\n7c3744d66a7aba550fb1916b89f553dcc46ae5909a78fa0dcb4370acbb29236d  guix-build-00867d70c01b/output/arm-linux-gnueabihf/bitcoin-00867d70c01b-arm-linux-gnueabihf.tar.gz\ncdce96985aee73f5b4b43dd5bf08725fe5d22e8229fea9b33a05a10d865e026a  guix-build-00867d70c01b/output/dist-archive/bitcoin-00867d70c01b.tar.gz\nd12abf6b1cfc7b4629c808af9e8eff49b8065f370048d9faf3d33e427688fc00  guix-build-00867d70c01b/output/powerpc64-linux-gnu/SHA256SUMS.part\nfc2a07395af1e5786523e566b4c79176445c92c9e091493df2b527163a66b4dc  guix-build-00867d70c01b/output/powerpc64-linux-gnu/bitcoin-00867d70c01b-powerpc64-linux-gnu-debug.tar.gz\nb989b880962028a71e4992bf1faa5e37848c02acb9c0be2533c8fc899515562c  guix-build-00867d70c01b/output/powerpc64-linux-gnu/bitcoin-00867d70c01b-powerpc64-linux-gnu.tar.gz\nedcad0104e9855f72aaae58d42dadab5706f432774a5c4d9d6439bd0792ee365  guix-build-00867d70c01b/output/riscv64-linux-gnu/SHA256SUMS.part\nf7fa245e77a1143485626c765d8332d17775033a6c546973e68f9a1d8a25ba7b  guix-build-00867d70c01b/output/riscv64-linux-gnu/bitcoin-00867d70c01b-riscv64-linux-gnu-debug.tar.gz\nd85c898a9b4fd4b20f4b725a690e85fb5e608687cd20566e2af140ccfbcda86b  guix-build-00867d70c01b/output/riscv64-linux-gnu/bitcoin-00867d70c01b-riscv64-linux-gnu.tar.gz\n8affcb7a784e9ad32128eb71e01ef0e85dad4884ae6e130ef914001aae0c367f  guix-build-00867d70c01b/output/x86_64-linux-gnu/SHA256SUMS.part\n61cadcebac7788d3358bc24ed85a3ab024ed384efd099cda78b8a3fa8ee8c9ff  guix-build-00867d70c01b/output/x86_64-linux-gnu/bitcoin-00867d70c01b-x86_64-linux-gnu-debug.tar.gz\n90c71bcd91abf2529e59ea38cf27d50936c28a63a0e28086a2b488bff79765d6  guix-build-00867d70c01b/output/x86_64-linux-gnu/bitcoin-00867d70c01b-x86_64-linux-gnu.tar.gz\n260ae56d80bb1377ff997d3e8066868fe108d0f3f90d30cb9df22d1bfb7f1ab3  guix-build-00867d70c01b/output/x86_64-w64-mingw32/SHA256SUMS.part\n465e992f723dffdf8b949e8e326264da91b623949b313d99f93a0f5f03c05c0c  guix-build-00867d70c01b/output/x86_64-w64-mingw32/bitcoin-00867d70c01b-win64-codesigning.tar.gz\n9b1ba3ef3e7993f3d34034679862a7939627d4193db653c247fc05925677b6bd  guix-build-00867d70c01b/output/x86_64-w64-mingw32/bitcoin-00867d70c01b-win64-debug.zip\na8f0290fb247f8e06bcbc815b49a12e7bd5754573dcb807aaadef3ed6354729c  guix-build-00867d70c01b/output/x86_64-w64-mingw32/bitcoin-00867d70c01b-win64-setup-unsigned.exe\n6554b85fce0b173821c57e1fb30e2ee5316783833a68efb9c914ad8212a7dc86  guix-build-00867d70c01b/output/x86_64-w64-mingw32/bitcoin-00867d70c01b-win64-unsigned.zip\n```",
   "id": "c:6525770495",
   "url": "https://github.com/bitcoin/bitcoin/pull/36708#issuecomment-6525770495",
   "hash": "0338d45247bf1d31",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-30T14:52:23Z",
   "action": "labeled",
   "label": "Build system",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-30T14:58:18Z",
   "action": "labeled",
   "label": "DrahtBot Guix build requested",
   "who": "maflcko"
  }
 ],
 "state_log": [
  {
   "t": "2026-10-30T14:56:57Z",
   "kind": "ready_for_review",
   "who": "jespada"
  }
 ],
 "text_chars": 5361,
 "text_tokens_estimate": 1340,
 "changed_paths": [
  "contrib/guix/libexec/build_linux.sh",
  "contrib/guix/libexec/build_linux_gui.sh",
  "contrib/guix/libexec/build_win.sh",
  "contrib/guix/libexec/build_win_gui.sh"
 ],
 "files": [
  {
   "path": "contrib/guix/libexec/build_linux.sh",
   "add": 1,
   "del": 1
  },
  {
   "path": "contrib/guix/libexec/build_linux_gui.sh",
   "add": 1,
   "del": 1
  },
  {
   "path": "contrib/guix/libexec/build_win.sh",
   "add": 1,
   "del": 1
  },
  {
   "path": "contrib/guix/libexec/build_win_gui.sh",
   "add": 1,
   "del": 1
  }
 ],
 "test_lines": 8,
 "git": {
  "head": "00867d70c01bda444ef1ba5e798a4d1401c5edd7",
  "head_matches_backup": true,
  "base": "363d9e9d38154b7dced1767e996f8f18f391fcff",
  "patch_id": "e6b284bf804d2f9e",
  "commits": [
   {
    "sha": "00867d70c0",
    "subject": "guix: map the whole DISTSRC in -fdebug-prefix-map",
    "files": 4,
    "add": 4,
    "del": 4
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "e6b284bf804d2f9e",
 "input_hash": "71f36d4c05226016",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}