New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpython: add separateDebugInfo v2 #110893
Conversation
94a8b51
to
4145595
Compare
4145595
to
923297b
Compare
# debug info can't be separated from a static library and would otherwise be | ||
# left in place by a separateDebugInfo build. force its removal here to save | ||
# space in output. | ||
$STRIP -S $out/lib/${libPrefix}/config-*/libpython*.a || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we deal with debug info in case of static builds? Do we always just remove it?
Aside from this question this PR looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various sources suggest that the thing to do is just put the whole debug static lib into the debug output. But doing this gets into the sticky situation of whether a debug
output actually exists for platforms not supporting separateDebugInfo
. And rather than doing something awkward that might break obscure platform x and get the whole PR reverted (again) I thought I'd keep this PR as straightforward as possible.
nixpkgs-review is failing to review staging PRs :( |
923297b
to
b9e64e8
Compare
Rebased on latest staging. |
debug info can't be separated from a static library and would otherwise be left in place by a separateDebugInfo build. force its removal here to save space in output.
b9e64e8
to
f8831c1
Compare
Rebased. Again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested this but it looks good.
Motivation for this change
This is my second attempt at #93083 which had to be reverted due to the increased size of
libpython*.a
. This was because separating debug info doesn't work with static libraries and so it just gets left in place. My fairly simple solution here is to just explicitly unconditionally strip it inpostInstall
.Also I note that this is only for py3, because cpython2 has been split out to a separate derivation. It's similar enough though and I could add this there too if things go well with py3.
Tested on
master
(before I rebased tostaging
) on non-nixos linux, nixos & macos 10.14 (all x86_64). Obviously, I have not performed a full rebuild.Seeing as this is such a core dependency, are there any of the weirder ports that should be tested? I tried to make the
$STRIP -S
command as universal as possible but I guess it could break some more exotic systems.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)