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

Failed to detect operating system version on Alpine Linux #1427

Closed
CoolCat467 opened this issue Feb 16, 2024 · 3 comments · Fixed by #1545
Closed

Failed to detect operating system version on Alpine Linux #1427

CoolCat467 opened this issue Feb 16, 2024 · 3 comments · Fixed by #1545
Assignees
Labels
bug Something isn't working

Comments

@CoolCat467
Copy link

Semi-duplicate of #1392 but that one seems to be specifically for apple silicon.

Currently working on attempting to replace pip with uv in python-trio/trio#2957 but apparently alpine linux is not supported currently.

  + uv --version
  uv 0.1.1
  + uv venv .venv --seed
    × Failed to detect the operating system version: Couldn't detect either
    │ glibc version nor musl libc version, at least one of which is required

Source: https://github.com/python-trio/trio/actions/runs/7926057000/job/21640239761?pr=2957#step:6:115

@zanieb
Copy link
Member

zanieb commented Feb 16, 2024

Thanks for the report! I'm not sure what's going on here yet, we'll need to get a development environment setup on Alpine so we can debug.

@BurntSushi
Copy link
Member

I'm able to reproduce this via the alpine:latest docker image:

$ cross b --manifest-path ~/astral/uv/Cargo.toml --profile profiling -p uv --target x86_64-unknown-linux-musl
    Finished profiling [optimized + debuginfo] target(s) in 0.13s
$ cp ~/astral/uv/target/x86_64-unknown-linux-musl/profiling/uv ./
$ docker run --rm -it --mount type=bind,src=$PWD,dst=/host alpine:latest /bin/sh
/ # /host/uv venv
  x Failed to detect the operating system version: Couldn't detect either glibc version nor musl libc version, at least one of which is required

BurntSushi added a commit that referenced this issue Feb 16, 2024
We make the names and return types a little more consistent. We also add
a lot more tracing calls to make issues with OS version detection easier
to diagnose.

It is not intended for any behavior changes to be in this commit.

Ref #1427
BurntSushi added a commit that referenced this issue Feb 16, 2024
I'm not quite sure how this was every working before. It's possible
it has never worked, but that our other methods of OS detection were
working.

In any case, empirically, it seems that the version number components
for musl can be a single digit.

Fixes #1427
BurntSushi added a commit that referenced this issue Feb 16, 2024
We make the names and return types a little more consistent. We also add
a lot more tracing calls to make issues with OS version detection easier
to diagnose.

It is not intended for any behavior changes to be in this commit.

Ref #1427
BurntSushi added a commit that referenced this issue Feb 16, 2024
I'm not quite sure how this was every working before. It's possible
it has never worked, but that our other methods of OS detection were
working.

In any case, empirically, it seems that the version number components
for musl can be a single digit.

Fixes #1427
BurntSushi added a commit that referenced this issue Feb 16, 2024
This PR fixes the OS detection for Alpine Linux such that the version
of musl available is correctly determined. The issue boiled down to
a regex that required 2 digits for each version component. But a
valid musl version is 1.2.4, which only has a single digit for each
component.

It's unclear how this was working for musl before this change. My
theory is that our other methods of OS detection were somehow working.

The first commit in this PR cleans up our Linux detection logic and adds
lots of tracing calls to make debugging issues like this easier in the
future. To do so, one can run:

    $ RUST_LOG=trace uv pip install -v whatever

The second commit has the actual fix.

Fixes #1427
@BurntSushi BurntSushi self-assigned this Feb 16, 2024
@mgasner
Copy link

mgasner commented Feb 16, 2024

you guys are amazing, tysm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants