cpython: add separateDebugInfo, allow use of gdb libpython#93083
Merged
FRidh merged 2 commits intoNixOS:stagingfrom Aug 15, 2020
Merged
cpython: add separateDebugInfo, allow use of gdb libpython#93083FRidh merged 2 commits intoNixOS:stagingfrom
FRidh merged 2 commits intoNixOS:stagingfrom
Conversation
doronbehar
reviewed
Jul 15, 2020
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
Member
|
@GrahamcOfBorg build python35 python36 python37 python38 python39 |
Contributor
|
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 |
Contributor
Author
|
Oh dear. Looks like I had too much faith in the magic of |
Contributor
Author
|
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. |
Member
|
I'm going to revert this change, because its too big this way. |
FRidh
added a commit
that referenced
this pull request
Nov 3, 2020
This increase the closure size by 30 MB. #93083 (comment) This reverts commit 4b340cb, reversing changes made to 47e499f.
This was referenced Jan 20, 2021
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)