Skip to content

Commit 473ca7a

Browse files
committed
Try using mold linker instead of ld shipped with musllinux
1 parent d15a603 commit 473ca7a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎ci/docker/python-wheel-musllinux.dockerfile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ RUN apk add --no-cache \
4141
# We will be able to use the main repo once we move to alpine 3.22 or later.
4242
RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community mono
4343

44+
# The GNU ld 2.44 shipped in the Alpine 3.22 base image miscompiles the
45+
# statically linked Protobuf descriptor tables on x86_64, which makes
46+
# "import pyarrow" abort at startup with:
47+
# Invalid file descriptor data passed to EncodedDescriptorDatabase::Add()
48+
# Link with mold to work around it. mold is only installed (and therefore
49+
# only used) on x86_64; arm64 is unaffected and falls back to the default
50+
# linker when ARROW_USE_MOLD is set but mold isn't found.
51+
ENV ARROW_USE_MOLD=ON
52+
RUN if [ "${arch}" = "amd64" ]; then apk add --no-cache mold; fi
53+
4454
# A system Python is required for ninja and vcpkg in this Dockerfile.
4555
# On musllinux_1_2 a system python is installed (3.12) but pip is not
4656
# We therefore override the PATH with Python 3.10 in /opt/python

‎ci/scripts/python_wheel_xlinux_build.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ==="
6868
: ${ARROW_SUBSTRAIT:=ON}
6969
: ${ARROW_S3:=ON}
7070
: ${ARROW_TENSORFLOW:=ON}
71+
: ${ARROW_USE_MOLD:=OFF}
7172
: ${ARROW_WITH_BROTLI:=ON}
7273
: ${ARROW_WITH_BZ2:=ON}
7374
: ${ARROW_WITH_LZ4:=ON}
@@ -128,6 +129,7 @@ cmake \
128129
-DARROW_SUBSTRAIT=${ARROW_SUBSTRAIT} \
129130
-DARROW_TENSORFLOW=${ARROW_TENSORFLOW} \
130131
-DARROW_USE_CCACHE=ON \
132+
-DARROW_USE_MOLD=${ARROW_USE_MOLD} \
131133
-DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI} \
132134
-DARROW_WITH_BZ2=${ARROW_WITH_BZ2} \
133135
-DARROW_WITH_LZ4=${ARROW_WITH_LZ4} \

0 commit comments

Comments
 (0)