Bug: PythonUvBuilder does not target Lambda manylinux compatibility

Offen
#955 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 6 Tagen

@vinsymoyya arbeitet bereits daran.

Seit 06.11.2026.

  • #956 von @vinsymoyya — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
70/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Start by reading the PythonUvBuilder and UvRunner code that constructs the uv pip install platform target; the issue identifies the python_uv workflow and gives a local wheel reproduction. Check how Python runtime version and architecture map to Lambda's AL2 and AL2023 glibc compatibility, then run the reproduction for both architectures and runtime groups. Done means the Python 3.12+ case selects manylinux_2_34, the Python 3.8–3.11 case targets AL2 compatibility, and the incompatible wheel is rejected.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description

PythonUvBuilder passes x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu to uv pip install for every Python runtime. These generic targets do not encode Lambda's runtime-specific manylinux compatibility.

On Windows with uv 0.11.26, I reproduced both:

  • python3.11: given wheels tagged manylinux_2_17 and manylinux_2_28, the builder selects the latter. Lambda's AL2 runtime has glibc 2.26, so a wheel requiring 2.28 is incompatible.
  • python3.12: given wheels tagged manylinux_2_34 and manylinux_2_35, the builder fails to find a compatible wheel, even though Lambda's AL2023 runtime supports glibc 2.34. Using x86_64-manylinux_2_34 selects the correct wheel.

The same results reproduce for arm64. The fixtures below test wheel selection using valid wheel metadata; they do not require compiling or loading a native extension.

Steps to reproduce

Run with aws-lambda-builders 1.68.0 and uv installed. This example exercises the Python 3.12 failure using local wheels only:

import os
from pathlib import Path
from tempfile import TemporaryDirectory
from zipfile import ZipFile
from aws_lambda_builders.workflows.python_uv.packager import UvRunner

with TemporaryDirectory() as directory:
    root = Path(directory)
    wheels = root / "wheels"
    wheels.mkdir()
    for minor in (34, 35):
        tag = f"py3-none-manylinux_2_{minor}_x86_64"
        with ZipFile(wheels / f"platform_demo-1.0.0-{tag}.whl", "w") as wheel:
            wheel.writestr("platform_demo.py", f"GLIBC_MINOR = {minor}\n")
            wheel.writestr("platform_demo-1.0.0.dist-info/METADATA",
                          "Metadata-Version: 2.1\nName: platform-demo\nVersion: 1.0.0\n")
            wheel.writestr("platform_demo-1.0.0.dist-info/WHEEL",
                          f"Wheel-Version: 1.0\nRoot-Is-Purelib: false\nTag: {tag}\n")
            wheel.writestr("platform_demo-1.0.0.dist-info/RECORD", "")
    manifest = root / "requirements.txt"
    manifest.write_text("platform-demo==1.0.0\n", encoding="utf-8")
    os.environ.update(UV_NO_INDEX="1", UV_OFFLINE="1", UV_FIND_LINKS=wheels.as_uri())
    UvRunner().install_requirements(
        str(manifest), str(root / "artifacts"),
        python_version="3.12", platform="linux", architecture="x86_64",
    )
Observed result

UvInstallationError: ... platform-demo==1.0.0 has no wheels with a matching platform tag (e.g., manylinux_2_28_x86_64)

Expected result

Select the glibc 2.34 wheel for Python 3.12+, reject the 2.35 wheel, and use AL2-compatible targeting for Python 3.8-3.11. The selection should follow the Lambda runtime and architecture rather than generic GNU/Linux defaults.

AWS documents the glibc 2.26 / 2.34 runtime boundary. UV supports explicit manylinux targets.

Environment and related work
  • Windows, Python 3.13.3, uv 0.11.26
  • aws-lambda-builders 1.68.0, upstream commit e3e14536501e38b0d6d8db582ddec6d0e0bd6f8a
  • Reproduced through LambdaBuilder.build() for both architectures and both experimental-flag settings.
  • #700, #752, and #762 concern python_pip; this report concerns the separate python_uv command construction. I checked the open/closed issue and PR history for an existing UV fix.
Vorherrschende Sprache
Python
Sterne
381
Forks
161
Ø Merge
5 T. 14 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus aws/aws-lambda-builders

Alle Issues in aws/aws-lambda-builders

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.