Skip to content

Commit 0822432

Browse files
committed
chore(lambda-layer): install rustup in AL2 image for libcst source build
libcst >=1.8 only ships aarch64 wheels for manylinux_2_28+. On Amazon Linux 2 (glibc 2.26) pip falls back to building from source, which now needs cargo (libcst is partly Rust). Install rustup with the minimal profile so the source build can proceed. AL2023 (used for py3.12+) ships glibc 2.34 and uses the prebuilt wheel, so Dockerfile.al2023 is unaffected.
1 parent 0dcb4da commit 0822432

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

building/lambda/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ RUN pip3 install --upgrade urllib3==1.26.16 # temporary to avoid https://github
4141
# In new CMake 4, compatibility with CMake < 3.5 has been removed.
4242
# Unpin CMake when arrow version shipped with lambda layers is updated.
4343
RUN pip3 install --upgrade cmake==3.31.6
44+
# libcst (a pyarrow 24+ build dep, used for build-time stub docstring extraction)
45+
# only ships manylinux_2_28 aarch64 wheels and falls back to a Rust build on AL2's
46+
# glibc 2.26. Install rustup so cargo is on PATH for that source build.
47+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
48+
sh -s -- -y --profile minimal --default-toolchain stable
49+
ENV PATH="/root/.cargo/bin:${PATH}"
50+
4451
# pyarrow 24+ build deps: scikit-build-core replaces setuptools; cython>=3.1 and
4552
# libcst (used for build-time stub docstring extraction) are required.
4653
RUN pip3 install --upgrade six "cython>=3.1" hypothesis uv build scikit-build-core "libcst>=1.8.6"

0 commit comments

Comments
 (0)