Skip to content

Strip binaries on non-OSX builds #140

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

Merged
1 commit merged into from
Feb 6, 2018
Merged

Conversation

xhochy
Copy link
Contributor

@xhochy xhochy commented Feb 6, 2018

Directly strip the binaries on compilation. Additionally I will have a look into integrating stripping into auditwheel but this change will prevent persisting the symbols in the first place. The savings are quite large here, e.g. for Pandas the sizes change 27M wheel and 104M unpacked on disk to a 11M wheel and 44M unpacked on disk. These saving are significantly visible in e.g. docker images that contain the unpacked binaries.

Verified with several packages as we had seen problems with this in the past:

@matthew-brett
Copy link
Collaborator

Thanks for this. Can you think of a test? For example, a package that failed before but now works, with stripping?

@xhochy
Copy link
Contributor Author

xhochy commented Feb 6, 2018

This was definitely the case with scipy in the past, e.g. numpy/numpy#7570 With the latest revision, this works now and we can also see a clear reduction in the wheel size (I have changed the travis.yml in all mentioned builds to print the size of the produced wheel as the last log line)

@ghost ghost merged commit b2748e5 into multi-build:devel Feb 6, 2018
@matthew-brett
Copy link
Collaborator

@xhochy - about the test - what I meant was, it would be good to continue to reassure ourselves that this is working. Can you think of a check that we can do to confirm the binary is in fact stripped?

@xhochy
Copy link
Contributor Author

xhochy commented Feb 7, 2018

@matthew-brett My main check was that the size of the shared libraries in the wheels was drastically reduced (and thus the size of the wheel). This is often in the range of 10-40% of the total size thus clearly visible. Also file showed them as stripped afterwards. We could use that later on in the build scripts to confirm that we have successfully stripped everything (but I would only add that check after auditwheel is also capable of stripping).

@matthew-brett
Copy link
Collaborator

Sure - I do understand that you checked by hand before and after - I was thinking of a test to go in the test suite, but feel free to say "no I can't think of one".

@tkelman
Copy link

tkelman commented Feb 7, 2018

xref pypa/manylinux#119

Thanks for this @xhochy, this will make deployment of various pydata components inside AWS Lambda much easier. Do you intend to open PR's updating the multibuild submodule in each of these projects so this gets rolled out before each of their next releases?

I also wonder how hard it might be to do split debuginfo so anyone who wants to run gdb on a binary from a release wheel [edit: and get full symbol info] can do so, but people with space constraints can harmlessly delete separate files.

@xhochy
Copy link
Contributor Author

xhochy commented Feb 7, 2018

@tkelman I will open issues on the various pydata components that they should update their multibuild version on the next release and provide PRs if wanted. You still should be able to run gdb on these binaries and possibly even get readable stacktrace but won't see local symbols during debugging.

@rgommers
Copy link

The stripping seems to not always happen, see gh-162

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants