Skip to content

Commit 7ab4b55

Browse files
authored
chore: Release 3.16.1 (#3328)
* fix(lambda-layer): point pip at pre-built pyarrow wheel via --find-links * fix(lambda-layer): pin pyarrow to local wheel version in pip install * fix(lambda-layer): upgrade lxml past redshift-connector cap for CVE-2026-41066 * chore(lambda-layer): bump pyarrow to 22.0.0 * fix(lambda-layer): install libatomic for pyarrow 22 linker * fix(lambda-layer): bundle libatomic.so.1 for pyarrow 22+ runtime * fix(lambda-layer): install libatomic on AL2023 and broaden lib search * fix(lambda-layer): remove stale lxml 6.0.2 dist-info before upgrade * fix(lambda-layer): bundle libicu for AL2023 runtime compatibility * chore: Update layers.rst
1 parent cadaf66 commit 7ab4b55

4 files changed

Lines changed: 339 additions & 298 deletions

File tree

building/lambda/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN yum install -y \
88
jemalloc-devel \
99
libxml2-devel \
1010
libxslt-devel \
11+
libatomic \
1112
bison \
1213
make \
1314
gcc10 \

building/lambda/Dockerfile.al2023

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ RUN dnf install -y \
88
jemalloc-devel \
99
libxml2-devel \
1010
libxslt-devel \
11+
libicu \
12+
libatomic \
1113
bison \
1214
make \
1315
gcc \

building/lambda/build-lambda-layer.sh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ popd
1111
rm -rf dist arrow
1212

1313
export ARROW_HOME=$(pwd)/dist
14-
export ARROW_VERSION=20.0.0
14+
export ARROW_VERSION=22.0.0
1515
export LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH
1616
export CMAKE_PREFIX_PATH=$ARROW_HOME:$CMAKE_PREFIX_PATH
1717
export SETUPTOOLS_SCM_PRETEND_VERSION=$ARROW_VERSION
@@ -79,11 +79,20 @@ python3 setup.py build_ext \
7979

8080
pip3 install dist/pyarrow-*.whl -t /aws-sdk-pandas/dist/pyarrow_files
8181

82+
PYARROW_WHEEL_DIR=$(pwd)/dist
83+
8284
popd
8385

8486
pushd /aws-sdk-pandas
8587

86-
pip3 install . --no-binary numpy,pandas -t ./python ".[redshift,mysql,postgres,gremlin,opensearch,openpyxl]"
88+
pip3 install . --no-binary numpy,pandas --find-links="${PYARROW_WHEEL_DIR}" -t ./python ".[redshift,mysql,postgres,gremlin,opensearch,openpyxl]" "pyarrow==${ARROW_VERSION}"
89+
90+
# CVE-2026-41066: upgrade lxml past redshift-connector's <=6.0.2 cap.
91+
# pyproject.toml's [tool.uv] override-dependencies only applies to uv, not pip,
92+
# so the Lambda layer needs this force-upgrade. Remove the capped install
93+
# first — pip -t doesn't clean old dist-info, so scanners would see both versions.
94+
rm -rf python/lxml python/lxml-*.dist-info
95+
pip3 install --no-deps -t ./python "lxml>=6.1.0"
8796

8897
rm -rf python/pyarrow*
8998
rm -rf python/boto*
@@ -97,12 +106,21 @@ find python -name '*.so' -type f -exec strip "{}" \;
97106
find python -wholename "*/tests/*" -type f -delete
98107
find python -regex '^.*\(__pycache__\|\.py[co]\)$' -delete
99108

100-
# Bundle system shared libraries needed at runtime (e.g. libxslt for lxml)
101-
# Lambda extracts layers to /opt/ and /opt/lib is in LD_LIBRARY_PATH
109+
# Bundle system shared libraries needed at runtime (e.g. libxslt for lxml,
110+
# libatomic for pyarrow 22+). Lambda extracts layers to /opt/ and /opt/lib
111+
# is on LD_LIBRARY_PATH. Search ldconfig cache first, then fall back to a
112+
# filesystem search (libatomic under gcc10 lives in /usr/lib/gcc/*).
102113
mkdir -p lib
103-
for libfile in libxslt.so.1 libexslt.so.0; do
104-
if [ -f "/usr/lib64/${libfile}" ]; then
105-
cp "/usr/lib64/${libfile}" lib/
114+
for libfile in libxslt.so.1 libexslt.so.0 libatomic.so.1 libicudata.so.67 libicui18n.so.67 libicuuc.so.67; do
115+
src=$(ldconfig -p 2>/dev/null | awk -v lib="${libfile}" '$1 == lib { print $NF; exit }')
116+
if [ -z "${src}" ] || [ ! -e "${src}" ]; then
117+
src=$(find /usr/lib /usr/lib64 -name "${libfile}" -print -quit 2>/dev/null)
118+
fi
119+
if [ -n "${src}" ] && [ -e "${src}" ]; then
120+
cp -L "${src}" "lib/${libfile}"
121+
echo "bundled ${libfile} from ${src}"
122+
else
123+
echo "WARNING: ${libfile} not found on this image"
106124
fi
107125
done
108126

0 commit comments

Comments
 (0)