Repository navigation
Conversation
Generated sources (e.g. capnp proxies) live in the build tree, outside
${DISTSRC}/src, so their debug paths kept the absolute /distsrc-base
prefix. Map ${DISTSRC} instead so every source path is relative.
Fixes bitcoin#34414.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
|
Guix build of 00867d7 (x86_64 build machine): |
|
Hmm, I was thinking this is a nice change, but I am not so sure now. Maybe this and the issue should just be closed? Recall that there is still plenty of stuff not mapped, like So I think this can still be done, but I think it would mostly be a "style cleanup". |
Fair point. I checked the line tables of bitcoin-node.dbg from my build, and after this change about a third of the source directories are still absolute (/bitcoin/depends/..., /usr/include/..., plus the toolchain's /tmp/guix-build-...). So the capnp mapping alone does not give fully relative debug info, and it is mostly cosmetic. Feel free to close this one. do you think mapping of all paths, including depends, be worth it, or is it not worth the review? I'm ok to do update this one if you think so. #36709 is separate: it fixes a real build failure with --system, which I hit while trying to test this PR. |
|
See also #36270, but that just re-writes the path and the user would still have to fetch the sources themselves (and likely rewrite the debug paths themselves again) |
|
I think I'll close this for now. The changes are fine, but as a pure style cleanup, it may be not worth it. Let's wait until the motivation is stronger and then re-open. |

Fixes #34414.
Why
The 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 fromsrc/were relative. With two kinds of paths, it is hard to set up source path mapping in a debugger.This maps
${DISTSRC}instead, inbuild_linux.sh,build_linux_gui.sh,build_win.shandbuild_win_gui.sh. The macOS scripts do not set-fdebug-prefix-map, so this PR does not change them.What changes in the debug paths
All source paths are now relative to the repository root:
src/./netaddress.cpp./src/netaddress.cpp/distsrc-base/distsrc-<commit>-<host>/build/src/ipc/capnp/init.capnp.proxy-client.c++./build/src/ipc/capnp/init.capnp.proxy-client.c++To find the sources in gdb, use the repository root as the source directory (
directory /path/to/bitcoin) instead ofsrc/.How I checked
readelf --debug-dump=info,--debug-dump=rawlineand--debug-dump=stroflibexec/bitcoin-node.dbg(x86_64-linux-gnu): nodistsrcstring. Sources show as./src/..., generated capnp files as./build/src/....bitcoind.exe.dbgfrom the Windows debug zip: nodistsrcstring.I 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.