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

MUSL distributions lacking proper interpreter information #260

Open
ofek opened this issue May 9, 2024 · 6 comments
Open

MUSL distributions lacking proper interpreter information #260

ofek opened this issue May 9, 2024 · 6 comments

Comments

@ofek
Copy link
Sponsor

ofek commented May 9, 2024

The following illustrates that for some reason the standalone distribution's pip does not consider MUSL wheels and will download the source distribution:

docker run --rm -d --name builder python:alpine sleep infinity
docker exec builder ash -c "apk update && apk add curl"
docker exec builder curl -LO https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64_v3-unknown-linux-musl-install_only.tar.gz
docker exec builder tar xzf cpython-3.12.3+20240415-x86_64_v3-unknown-linux-musl-install_only.tar.gz
docker exec builder /python/bin/python -m pip install uv

I then got the idea to try installing with UV itself but that also doesn't work (but of course itself installs properly with the system Python): astral-sh/uv#3486

@charliermarsh
Copy link
Collaborator

I am interested in what packaging._get_musl_version is returning for the executable, and where it's failing.

@ofek
Copy link
Sponsor Author

ofek commented May 9, 2024

$ docker exec builder /python/bin/python -m pip install -q packaging
$ docker exec builder /python/bin/python -c "from packaging._musllinux import _get_musl_version;print(_get_musl_version('/python/bin/python'))"
None

Based on its description, could it be because the distribution is statically compiled i.e. #86?

#218 (comment):

If PEP 656 had been around when I created this project, I may have just made musl libc dynamic by default.

@konstin
Copy link

konstin commented May 9, 2024

I think this effectively a duplicate of #86, we need dynamically linked musl builds for python-build-standalone to be usable on alpine.

@ofek
Copy link
Sponsor Author

ofek commented May 9, 2024

I know it was from before your time but do you know why the original decision opted for static? I don't quite understand the benefit.

@charliermarsh
Copy link
Collaborator

I believe it was a requirement for PyOxidizer which was the motivating force behind the project in the first place (I may be wrong) -- it's similar to #221.

@konstin
Copy link

konstin commented May 13, 2024

See astral-sh/uv#2382 for a (currently failing) test on the uv side

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

3 participants