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

Handling shared libraries #2

Open
jakirkham opened this issue Apr 24, 2019 · 4 comments
Open

Handling shared libraries #2

jakirkham opened this issue Apr 24, 2019 · 4 comments

Comments

@jakirkham
Copy link
Member

Am still learning how this tool works. So am not sure what it is already done to address this issue. Namely how do shared libraries (outside of the Python package) get handled? Alternatively if these are open questions, how should they be handled?

  1. What shared libraries are included within the wheel? How are these named to avoid clashing?
  2. What libraries are expected to come from the system? How are these managed?
  3. How are shared libraries specific to the Python package/wheel handled w.r.t. 1 & 2?
@scopatz
Copy link
Contributor

scopatz commented Apr 25, 2019

OK so the basic strategy is that shared libraries go into site-packages/lib. This is because the wheel format dictates that all files, by default, go into site-packages. We don't really want to move these around to avoid issues of breaking the links.

What shared libraries are included within the wheel? How are these named to avoid clashing?

All of them. Name clashes are avoided because very few things go into site-package/lib

What libraries are expected to come from the system? How are these managed?

The same as with conda, so very few + all of the CDTs

How are shared libraries specific to the Python package/wheel handled w.r.t. 1 & 2?

Yeah, this is a fun one. So I believe that the easiest thing to do is to have a separate copy of Python (obtained via the Python wheel) within site-packages. This works because we provide a wrapper script that points the python command to the proper location within site-packages. Maybe this wrapper script needs some extra environment variables set to point it to the proper site-packages? And maybe the pip package would need to be a dummy. Some of the details here haven't been worked out yet, but that's the basic strategy.

@thewtex
Copy link

thewtex commented Jul 22, 2019

OK so the basic strategy is that shared libraries go into site-packages/lib.

Really interesting idea! 💡

This works because we provide a wrapper script that points the python command to the proper location within site-packages.

If this experiment proves successful, it would be interesting if CPython could add support at startup for loading libraries, by default, from site-packages/lib to prevent the need for a wrapper script...

@scopatz
Copy link
Contributor

scopatz commented Jul 22, 2019

Ultimately, That'd be great!

@SylvainCorlay
Copy link

OK so the basic strategy is that shared libraries go into site-packages/lib. This is because the wheel format dictates that all files, by default, go into site-packages. We don't really want to move these around to avoid issues of breaking the links.

It does not seem to be a correct approach to the issue, especially for packages that link with libpython because the relative path of libpython with respect to PREFIX/site-packages/lib is not the same as with respect to PREFIX/lib. Besides, depending on the distutils scheme that is used, site-packages may be in a number of places in the filesystem...

How about making use of data_files for most of the wheel content instead, and only special case the content of Python-specific directories?

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

No branches or pull requests

4 participants