fix(lambda): use PyPI wheels for numpy/pandas on AL2023 layer builds … - #3398
Merged
kukushking merged 1 commit intoJul 15, 2026
Merged
Conversation
…3393) Building numpy/pandas from source without pinning the build-time numpy to the runtime numpy produces a pandas binary linked against a numpy ABI that doesn't match the numpy 2.5.x shipped alongside it, causing SIGSEGV on datetime64 construction paths (e.g. df["t"] = datetime.now(), pd.to_datetime(...)). AL2023 has glibc 2.34, which satisfies the manylinux_2_28 tag PyPI ships numpy/pandas wheels under, so drop the source-build override on that Dockerfile and gate the flag in build-lambda-layer.sh on /etc/os-release. AL2 (glibc 2.26) can't load manylinux_2_28 and its older numpy 2.4.x source build is unaffected, so keep source builds there. Verified in a public.ecr.aws/lambda/python:3.12 container that the segfault reproduces without the fix and disappears with it; AL2 py3.11 source-built numpy 2.4.6 + pandas 3.0.3 continue to work.
psahunl
approved these changes
Jul 10, 2026
psahunl
approved these changes
Jul 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature or Bugfix
Detail
AWSSDKPandas-Python312:29(and Python 3.13/3.14 equivalents) SIGSEGVs on any pandasdatetime64construction —df["t"] = datetime.datetime.now(),pd.to_datetime(...), or any awswrangler internal timestamp casting. Crash originates inpandas/core/construction.py:503 ensure_wrapped_if_datetimelike, on Lambda it surfaces asRuntime.ExitError: signal: segmentation faulton every invocation that touches a datetime value.pip install --no-binary numpy,pandasunder default build isolation on AL2023 produces a pandas binary linked against a numpy ABI that doesn't match the numpy 2.5.x wheel resolved separately in the same layer. Confirmed by reproducing the exact stack trace inpublic.ecr.aws/lambda/python:3.12with--no-binary numpy,pandas, and confirming the same versions from PyPI wheels work cleanly.--no-binaryflag was originally required on AL2 (glibc 2.26) because PyPI'smanylinux_2_28wheels wouldn't load. AL2023 (glibc 2.34) satisfiesmanylinux_2_28, so the flag is no longer needed for Python 3.12/3.13/3.14 builds and is actively causing the ABI mismatch.PIP_NO_BINARYenv and--no-binary-package numpy/pandasfromuv syncinDockerfile.al2023; gate the--no-binary numpy,pandasflag onbuild-lambda-layer.shvia/etc/os-releaseso only AL2 (VERSION_ID="2") keeps source builds. AL2 py3.10/3.11 verified unaffected — its older numpy 2.4.x source build works correctly.Relates
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.