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

Ability to build Python with --enable-shared #1050

Open
toiletsandpaper opened this issue Apr 25, 2024 · 1 comment
Open

Ability to build Python with --enable-shared #1050

toiletsandpaper opened this issue Apr 25, 2024 · 1 comment

Comments

@toiletsandpaper
Copy link

Problem

Rye has a one major disadvantage right now - rye is installing python versions without libpython.so which leads to many problems with using python from other languages.

For example, this #920 issue is mostly because of libpython is not available for rye's python.

How it should work

For apt or dnf/yum we have python3-dev and python3-devel to download shared object
For pyenv we have https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#building-with---enable-shared

IMO, this feature is very important and is a blocker for most of python developers

@bluss
Copy link
Contributor

bluss commented Apr 26, 2024

Rye's pythons are built with --enable-shared, and installs libpython and the library is there, but I think this is the same issue as #646 - the configuration paths to where those libraries are located are not correct and need to be set after installing the toolchain in its final location.

Trying to find it, we see it is there:

> find .rye/py -iname "*libpython*.so"
.rye/py/cpython@3.8.18/lib/libpython3.so
.rye/py/cpython@3.8.18/lib/libpython3.8.so
.rye/py/cpython@3.11.8/install/lib/libpython3.so
.rye/py/cpython@3.11.8/install/lib/libpython3.11.so
.rye/py/cpython@3.12.1/lib/libpython3.so
.rye/py/cpython@3.12.1/lib/libpython3.12.so
.rye/py/cpython@3.12.2/install/lib/libpython3.so
.rye/py/cpython@3.12.2/install/lib/libpython3.12.so

Unfortunately it doesn't tell the truth about where it is

> python +3.12 -m sysconfig | grep LIBDIR
	LIBDIR = "/install/lib"

This LIBDIR value is what it ships with and needs to be updated.

With the sysconfigpatcher script - which is WIP and only works on linux I think, then it does the right thing

> python +3.11 -m sysconfig | grep LIBDIR
	LIBDIR = "/home/user/.rye/py/cpython@3.11.8/install/lib"
	PLATLIBDIR = "lib"

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

2 participants