Skip to content

Bug: PythonUvBuilder does not target Lambda manylinux compatibility #955

Closed

Description

@vinsymoyya

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

Activity

  1. vinsymoyya commented on Nov 6, 2026

    @vinsymoyya
    ContributorAuthor

    #956 fixes the runtime-dependent wheel selection by passing explicit manylinux targets for each Lambda runtime and architecture. AL2 uses the existing pip workflow's conservative manylinux2014 target; AL2023 uses manylinux 2.34.

    The eight offline wheel-selection cases fail on unchanged upstream and pass with the fix on Linux and Windows. Fork validation passed all four OS/UV-version combinations: 1,025 unit/functional tests and 28 UV integration tests per job, plus lint, formatting, and coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions