uv/crates/uv-python/src
konsti ae57d85dfb
Detect musl and error for musl pbs builds (#6643)
As described in #4242, we're currently incorrectly downloading glibc
python-build-standalone on musl target, but we also can't fix this by
using musl python-build-standalone on musl targets since the musl builds
are effectively broken.

We reintroduce the libc detection previously removed in #2381, using it
to detect which libc is the current one before we have a python
interpreter. I changed the strategy a big to support an empty `PATH`
which we use in the tests.

For simplicity, i've decided to just filter out the musl
python-build-standalone archives from the list of available archive,
given this is temporary. This means we show the same error message as if
we don't have a build for the platform. We could also add a dedicated
error message for musl.

Fixes #4242

## Test Plan

Tested manually.

On my ubuntu host, python downloads continue to pass:
```
target/x86_64-unknown-linux-musl/debug/uv python install
```

On alpine, we fail:
```
$ docker run -it --rm -v .:/io alpine /io/target/x86_64-unknown-linux-musl/debug/uv python install
  Searching for Python installations
  error: No download found for request: cpython-any-linux-x86_64-musl
```
2024-08-27 00:06:53 +00:00
..
discovery.rs Add support for configuring `python-downloads` with `UV_PYTHON_DOWNLOADS` (#6436) 2024-08-22 23:19:03 +00:00
downloads.inc Update Pythons to include Python 3.12.5 (#6087) 2024-08-14 15:18:01 +00:00
downloads.inc.mustache Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
downloads.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
environment.rs feat(venv): add relocatable flag (#5515) 2024-07-29 00:10:11 +00:00
implementation.rs Use max rather than min to sort managed Pythons (#5205) 2024-07-19 12:35:17 +00:00
installation.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
interpreter.rs Use separate types to represent raw vs. resolver markers (#6646) 2024-08-26 18:00:21 +00:00
lib.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
libc.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
managed.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
platform.rs Detect musl and error for musl pbs builds (#6643) 2024-08-27 00:06:53 +00:00
pointer_size.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
prefix.rs Initialize all `--prefix` subdirectories (#4895) 2024-07-08 14:15:25 +00:00
py_launcher.rs Upgrade to Rust 1.80.0 (#5472) 2024-07-27 01:49:47 +00:00
python_version.rs Use separate types to represent raw vs. resolver markers (#6646) 2024-08-26 18:00:21 +00:00
target.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
version_files.rs Fix priority for `.python-versions` files in `uv python install` (#6382) 2024-08-21 22:17:14 +00:00
virtualenv.rs feat(venv): add relocatable flag (#5515) 2024-07-29 00:10:11 +00:00
which.rs Search for all `python3.x` in PATH (#5148) 2024-07-18 17:00:01 +02:00