-
Notifications
You must be signed in to change notification settings - Fork 221
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
Keep libpython static libraries in compressed form #1250
Conversation
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 am positive
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.
This looks good.
There are no docs or helper scripts but I'm not sure we want those (yet?).
Thanks so much! If you want docs I can add them but I assumed we wanted to keep this as a somewhat obscure feature to reduce the chance of people shooting themselves in the foot with it. |
No need to add docs for the reasons you mention. If we see more requests maybe we'll add those with a prominent warning but I think the use-case is quite rare and if that's good for you as it is, then that's good for me ! |
Hi, What am I doing wrong? |
|
@AlmogBaku the default manylinux Python installation isn't "broken". This sounds like an XY problem, you should ask for help regarding the original problem that made you think you needed to extract these libs. If you link extension modules against these libs, your modules will be broken. Only do it if you know exactly what you're doing. |
Hi, I'm sure Manylinux is not "broken", it's probably me ;-) I'm trying to compile go project to use it with python using See this for issue about my use-case: |
@AlmogBaku with your use case it is certainly a mistake to link with libpython. The only correct fix is to change the gopy build system not to require linking with libpython (search around for the linker flags you will need, I don't have them handy). You cannot link these libs into a library due to the lack of -fPIC, but even if you could, the libraries would have problems being loaded into another Python interpreter. I would also suggest removing the extraction commands from your comments so that nobody else is tempted to make the same mistake. There is a good reason the libraries are hidden away. |
At present, libpythonX.Y.a files are being deleted from the image after the build. This is a large inconvenience for applications that need it in order to embed the Python interpreter or create a frozen application. See #91, #793, #255, #30 for use cases.
There are good reasons against including these libraries:
This PR mitigates all these concerns by compressing all of them into an XZ-compressed tarball:
find | grep libpython
At the same time, it allows developers who know what they are doing to get access to them using a single
tar
command.The total increase in image size, measured for manylinux2014_x86_64, is 3.1 MiB. This represents an increase of 0.28 %, lower than the 0.5 % threshold for acceptance established by @mayeut in #91. I also measured it for manylinux2010_x86_64, the increase there is 0.31 %.
Thank you so much for your consideration!
Fixes #91