Closed yurivict closed 6 years ago
Please explain what stripping means, what are the benefits, and how I can go about doing it within the context of setuptools
.
In the link below, Donald Stufft (the lead maintainer of PyPA and pip
) states that they chose not to strip binaries installed with pip
because it is not universally safe.
https://github.com/pypa/pip/issues/3938#issuecomment-290487531
For the sake of argument, let us ignore that for a moment. Let us suppose that I decide to put in the work to a) figure out all the compiler flags for all the various supported compilers and all versions of those compilers to strip at build time, and then b) get it to work in CI (and hope that correlates to working on people's machines as well), will you be willing to field all issues created due to stripping the extra symbols, including when people try to run the code through a debugger and finding they cannot because debugging symbols were stripped from the binary?
Stripping means removing ELF sections that aren't needed for it to run.
It is accomplished by running the 'strip' command: https://linux.die.net/man/1/strip
The benefits are - reduced size of installed packages on disk. Marginally faster runtimes, because file sizes are smaller, no need to go through or skip unneeded sections.
Many python projects don't strip. Maybe this is just not easy in python, I'm not sure. But most GNU make-based projects, and cmake-based projects do strip.
Closing this, because this doesn't appear to be easy to fix for individual projects.
The FreeBSD port always strips it with a separate instruction. It would be better if it would be stripped during build.
Thank you.