aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
334 stars 139 forks source link

Support PEP 600 platform tags for arm64 #536

Closed jack-davies closed 1 year ago

jack-davies commented 1 year ago

*Issue #, if available:

https://github.com/aws/aws-sam-cli/issues/3747

Description of changes:

Hey team,

We encountered an issue building cross-platform for arm64 outside of a container with sam build:

Build Failed
Error: PythonPipBuilder:ResolveDependencies - {grpcio==1.57.0(wheel)}

grpcio does indeed have a wheel available in PyPI at ..._manylinux_2_17_aarch64.whl, but aws-sam-cli is currently only able to resolve the manylinux_2_17 tags for x86_64 wheels.

This PR adds the alias in PEP 600 for manylinux2014_aarch64 -> manylinux_2_17_aarch64.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mikegrima commented 10 months ago

I'm currently tracking down an issue with ruamel.yaml.clib. This causes an issue with building on ARM (in the container - didn't try on host).

The ARM version does in fact exist at: ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl.

I'm happy to make a PR to fix, but not quite sure I understand what needs to be done to make things work.

jack-davies commented 9 months ago

I'm currently tracking down an issue with ruamel.yaml.clib. This causes an issue with building on ARM (in the container - didn't try on host).

The ARM version does in fact exist at: ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl.

I'm happy to make a PR to fix, but not quite sure I understand what needs to be done to make things work.

At a glance, it looks like the _RUNTIME_GLIBC map is incomplete, missing cp310 and above with a fallback to (2, 17):

https://github.com/aws/aws-lambda-builders/blob/5aab97467be510e155e6c2a278a01f7a20e673a3/aws_lambda_builders/workflows/python_pip/packager.py#L203-L212

ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl therefore fails the glibc compatibility check, as (2, 24) is greater than the assumed runtime glibc (2, 17).