Skip to content

Commit 609db3c

Browse files
authored
chore: Release 3.17.1 (#3436)
* fix(lambda): exclude auditwheel-vendored libs from strip to preserve ELF alignment GNU strip on auditwheel's vendored libraries (numpy.libs/libscipy_openblas64_.so and friends) rewrites their LOAD-segment file offsets without preserving the ELF invariant p_offset == p_vaddr (mod p_align). mmap-based loaders tolerate the violation, but Lambda's loader rejects it at import time with: ELF load command address/offset not page-aligned This broke 'import numpy' on Lambda for py3.12-3.14 (both x86_64 and arm64) once the layer switched to PyPI manylinux wheels. Exclude *.libs/ from the strip find; our own extension modules are still stripped. * docs: update Lambda layer ARNs for 3.17.1
1 parent c2d0286 commit 609db3c

2 files changed

Lines changed: 309 additions & 302 deletions

File tree

building/lambda/build-lambda-layer.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ rm -rf python/s3transfer*
117117
cp -r /aws-sdk-pandas/dist/pyarrow_files/pyarrow* python/
118118

119119
# Removing nonessential files
120-
find python -name '*.so' -type f -exec strip "{}" \;
120+
# Skip auditwheel-vendored libraries (numpy.libs/, scipy.libs/, ...): these are
121+
# pre-built shared objects (e.g. libscipy_openblas64_.so) whose LOAD segments use
122+
# large-page alignment. GNU strip rewrites their file offsets without preserving
123+
# the ELF invariant p_offset ≡ p_vaddr (mod p_align), which mmap-based loaders
124+
# tolerate but Lambda's loader rejects with "ELF load command address/offset not
125+
# page-aligned" (issue: numpy C-extension import fails on Lambda). Our own
126+
# extension modules (awswrangler/pandas/pyarrow) are safe to strip.
127+
find python -name '*.so' -type f -not -path '*.libs/*' -exec strip "{}" \;
121128
find python -wholename "*/tests/*" -type f -delete
122129
find python -regex '^.*\(__pycache__\|\.py[co]\)$' -delete
123130

0 commit comments

Comments
 (0)