-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
virtualenv should also copy shared libraries? #1015
Comments
I've just installed pyenv and reverted pyenv/pyenv@afbd54d, but there's still no rpath set. How to install python with rpath? |
It'll set rpath if PYTHON_CONFIGURE_OPTS includes --enable-shared. https://github.com/yyuu/pyenv/blob/master/plugins/python-build/bin/python-build#L1914 |
OK reproduced. By the way, if you have no need on Python < 3.3, I suggest the standard venv library, which is much better in handling such cases. |
I do need Python < 3.3. |
I bet it would be better to have things auto-detected. |
this is a bit tricky
I am wondering in what case this readelf will be not available |
IMO always copying libpython.so is the file is there sounds fine. But I'm not core virtualenv developer, and I don't have merge permissions. My opinions are definitely unreliable. |
Hi, I'm in the need of this feature as well, any idea when it might be applied / available ? Thx. |
@woosley :
what about :
? |
It's possible to change rpath via utilities like |
@yan12125 : |
Sorry if I wasn't clear. What I wanted to say is that it's possible to use chrpath instead of LDFLAGS when building CPython, so detecting rpath from LDFLAGS is not reliable. |
Ah, I see. |
Yep I believe almost all packagers use LDFLAGS. I'm not sure whether virtualenv should handle edge cases or not. I'm not a maintainer but just another random person who uses virtualenv often. Those are just my two cents :) |
Unfortunately the maintainers have been silence for a while :( |
Personally, I don't have the Unix skills to comment here, sorry. But on the subject of edge cases, I will say that one person's edge case is another person's core usage, so I'd be reluctant to make a fix for one issue that could break other users. After all, the original issue here is just as much a non-standard build of Python as anything else. From what I can understand of the original issue here, you're building a Python installation that is relocatable (i.e., you can copy it somewhere else). If that's the case, I'm not entirely sure why you even need virtualenv - instead of using virtualenv, just take another copy of your Python installation. Virtualenv is essentially a tool that creates a partial copy of "just enough" of the Python installation, and it's pretty fragile because core Python (prior to the introduction of the |
giving my 2 cents: in any case : I think that copying that .so lib to the target virtualenv (under the usual lib directory) would not break anything which would otherwise correctly behaves actually. ofcourse that would have to be somehow validated (by some test case I guess). @pfmoore for your remark : effectively copying a truly relocatable python installation could be all good here (though we would have to wipe out site-packages to be sure to start from a fresh/clean state). I agree. |
I agree with what @gst said.
|
For any info : |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
see this patch for pyenv
pyenv/pyenv@2657f10
When compile python with '--enable-shared -Wl,-rpath='$$ORIGIN/../lib', the created python can be dropped to any folder.
But after virtualenv copy the python binary to a different folder, the relative path "bin/../lib" to libpython.so will be broken, the python binary will die with
In this case, virtualenv should also consider copy the shared object file to the new folder.
The text was updated successfully, but these errors were encountered: