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

Consider musl builds #47

Open
mitsuhiko opened this issue Apr 26, 2023 · 4 comments
Open

Consider musl builds #47

mitsuhiko opened this issue Apr 26, 2023 · 4 comments
Milestone

Comments

@mitsuhiko
Copy link
Collaborator

It might be worthwhile to consider picking musl builds instead of glibc builds for platforms without glibc to address #30. The builds themselves are available but currently not considered by rye.

@mitsuhiko mitsuhiko added this to the Can Be Used milestone May 22, 2023
@mitsuhiko
Copy link
Collaborator Author

mitsuhiko commented May 22, 2023

Relates to #163

@rdbo
Copy link

rdbo commented Feb 8, 2024

Possible solution for musl libc:

  • Add new OS string for musl Linux on the downloads.inc, e.g linux_musl. It will detect whether the OS is musl libc or GNU libc, and use the appropriate URLs for each
  • Prioritize musl downloads over glibc. This method will download musl builds when available; if they are not available, use GNU libc. This has the downside that while using a musl Linux, you might believe that the other Linux downloads work here as well, but they don't (e.g PyPy's binary Linux builds only support glibc, as of now)

I'm taking a look at this issue further, hoping to help out with it

@rdbo
Copy link

rdbo commented Feb 8, 2024

There's also the option for adding a toolchain string in the Python versions. E.g:

  • linux-gnu-x86_64
  • linux-musl-x86_64
  • win32-msvc-aarch64
    I don't think it's worth it though, since AFAIK there's only one edge case for now, which is musl

@jelacious
Copy link

Ran into this yesterday while trying to set-up an Alpine Linux Docker image for CI purposes. Even despite using the locally installed toolchain rye will still complain about incompatible versions. I'll provide the Dockerfile I am playing with for reference:

FROM "alpine:latest"
ENV HOME="/root"
WORKDIR $HOME

RUN apk add -U --no-cache \
        git \
        libffi \
        libffi-dev \
        python3 \
        py3-virtualenv \
        openssl \
        openssl-dev \
        build-base \
        perl \
        pkgconfig \
        curl \
        cmake

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --component clippy -y
ENV PATH="$HOME/.cargo/bin:${PATH}"
RUN cargo install --git https://github.com/astral-sh/rye rye --locked
RUN rye toolchain register "/usr/bin/python"
RUN rye tools install pytest

And the result of running docker build . is:

 => ERROR [7/7] RUN rye tools install pytest                                                                                                                                             1.5s
------                                                                                                                                                                                        
 > [7/7] RUN rye tools install pytest:                                                                                                                                                        
0.283 Bootstrapping rye internals
1.502 Found a compatible Python version: [email protected]
1.527 error: unable to create self venv using /usr/bin/python3.11. It might be that the used Python build is incompatible with this machine. For more information see https://rye-up.com/guide/installation/
1.527 
1.527 Caused by:
1.527     No such file or directory (os error 2)
------
Dockerfile:23
--------------------
  21 |     RUN cargo install --git https://github.com/astral-sh/rye rye --locked
  22 |     RUN rye toolchain register "/usr/bin/python"
  23 | >>> RUN rye tools install pytest
  24 |     
  25 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c rye tools install pytest" did not complete successfully: exit code: 1

Same happens if I try doing rye self install -y.

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