Skip to content
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

strip setup hook: Strip using --strip-unneeded instead of --strip-debug. #64540

Merged
merged 1 commit into from Jul 17, 2019

Conversation

ambrop72
Copy link
Contributor

@ambrop72 ambrop72 commented Jul 9, 2019

Motivation for this change

Reduce binary sizes. See the discussion in #64427.

According to these, --strip-unneeded is the right way to strip and shouldn't break programs:
https://www.technovelty.org/linux/stripping-shared-libraries.html
https://www.debian.org/doc/debian-policy/ch-files.html#binaries

The strip man page describes --strip-unneeded as "Remove all symbols that are not needed for relocation processing", which I think means that it strip everything that can be stripped which is not needed to run stuff.

Things done

Tested with my system (nixos-unstable, x86-64) including KDE, Chromium, Firefox and VirtualBox. Build succeeded, closure size went from 8.24 GB to 7.91 GB, no runtime problems observed.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member

FRidh commented Jul 22, 2019

Reverted in 835f6b6 because this broke the bootstrapping of Darwin. Feel free to open a PR again but make sure the issue is solved or that its mentioned that it broke the bootstrapping.

@ambrop72
Copy link
Contributor Author

The most I can do about that is keep using --strip-debug on Darwin (I don't own a Mac). Does that seems sensible for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants