Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions crates/uv-python/python/get_interpreter_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,30 +462,28 @@ def get_operating_system_and_architecture():
from .packaging._musllinux import _get_musl_version

musl_version = _get_musl_version(sys.executable)
glibc_version = _get_glibc_version()

if musl_version:
operating_system = {
"name": "musllinux",
"major": musl_version[0],
"minor": musl_version[1],
}
elif glibc_version != (-1, -1):
operating_system = {
"name": "manylinux",
"major": glibc_version[0],
"minor": glibc_version[1],
}
elif hasattr(sys, "getandroidapilevel"):
operating_system = {
"name": "android",
"api_level": sys.getandroidapilevel(),
}
else:
glibc_version = _get_glibc_version()

if glibc_version != (0, 0):
operating_system = {
"name": "manylinux",
"major": glibc_version[0],
"minor": glibc_version[1],
}
elif hasattr(sys, "getandroidapilevel"):
operating_system = {
"name": "android",
"api_level": sys.getandroidapilevel(),
}
else:
print(json.dumps({"result": "error", "kind": "libc_not_found"}))
sys.exit(0)
print(json.dumps({"result": "error", "kind": "libc_not_found"}))
sys.exit(0)
elif operating_system == "win":
operating_system = {
"name": "windows",
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-python/python/packaging/_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _parse_glibc_version(version_str: str) -> tuple[int, int]:
def _get_glibc_version() -> tuple[int, int]:
version_str = _glibc_version_string()
if version_str is None:
return (0, 0)
return (-1, -1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I don't think this should have changed. \cc @konstin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(In part because this is vendored.)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I implied that on my comment in the PR but I wasn't clear enough.

return _parse_glibc_version(version_str)


Expand Down