cpython: add separateDebugInfo, allow use of gdb libpython#93083
cpython: add separateDebugInfo, allow use of gdb libpython#93083FRidh merged 2 commits intoNixOS:stagingfrom
Conversation
used together with cpython's debugging symbols, this allows inspection of the python stack of cpython programs in gdb. this file is a little different from the rest of the python output by this package, in that it's not intended to be run by the current python being built, instead by the python being used by the gdb in question, which could be very different. therefore placed in its own, but hopefully logical & predictable location.
cd6abe7 to
ede2e00
Compare
|
@GrahamcOfBorg build python35 python36 python37 python38 python39 |
|
Python size increased after this change by ~30 MB. https://hydra.nixos.org/build/125194527#tabs-details $ nix build /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5 /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5
$ nix path-info -sh /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5 /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5
/nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5 62.2M
/nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5 90.0M
$ du -hs /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/* | sort -h
4,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/config.c
4,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/config.c.in
4,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/python-config.py
4,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/python.o
4,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Setup.local
8,0K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/makesetup
16K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/install-sh
16K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/__pycache__
16K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Setup
80K /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile
6,9M /nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a
$ du -hs /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/* | sort -h
4,0K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/config.c
4,0K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/config.c.in
4,0K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/python-config.py
4,0K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Setup.local
8,0K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/makesetup
16K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/install-sh
16K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/__pycache__
16K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Setup
36K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/python.o
80K /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile
35M /nix/store/wbilyi119q8my0kz2pl4chgs35xhlnhm-python3-3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.aIs |
|
Oh dear. Looks like I had too much faith in the magic of |
|
I'm putting something on my TODO list to write some tests for cpython/gdb debugging so we can safely experiment with slimming it down. |
|
I'm going to revert this change, because its too big this way. |
This increase the closure size by 30 MB. #93083 (comment) This reverts commit 4b340cb, reversing changes made to 47e499f.
Motivation for this change
The first thing this does is enable
separateDebugInfofor cpython. Bit surprised we didn't already have this.It also exposes
Tools/gdb/libpython.pyin the package output. Used together with cpython's debugging symbols, this allows inspection of the python stack of cpython programs ingdb. This file is a little different from the rest of the python output by this package, in that it's not intended to be run by the current python being built, instead by whatever python being used by thegdbin question, which could be very different. Therefore I placed it placed in its own, but hopefully logical & predictable location:/usr/share/gdb//share/gdb/. Also skipped building bytecode for it for similar reasons.This, of course, results in a massive rebuild and I'm not sure how I'd ever make a dent in it myself. I've tested
python27throughpython39. However I'm fairly sure we've got some custom python builds floating around, though I'm not sure how I'd find them.Tested on linux x86_64 & macos 10.14, though on macos
separateDebugInfodoes nothing leaving this slightly pointless there.Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)