Skip to content

Commit 55402ca

Browse files
committed
build patchelf from source so valhalla_service is patched properly when building the bindings package
1 parent 4292041 commit 55402ca

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

docker/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,21 @@ FROM build_cpython AS build_cpython314_nogil
156156
RUN manylinux-entrypoint /build_scripts/build-cpython.sh [email protected] https://github.com/login/oauth 3.14.0b1 nogil
157157

158158
# Build and install more packages from source
159-
# Have to build from git source, bcs of submodules..
159+
# Have to build prime_server from git source, bcs of submodules..
160160
FROM build_git AS build_prime_server
161161
COPY build_scripts/build-prime_server.sh /build_scripts/
162162
RUN export PRIME_ROOT=prime_server-0.7.0 && \
163163
export PRIME_GIT_URL=https://github.com/kevinkreiser/prime_server && \
164164
manylinux-entrypoint /build_scripts/build-prime_server.sh
165165

166+
# patchelf in AlmaLinux has a bug which corrupts "valhalla_service"
167+
# installing 523f401 from 15.02.2025, which works nicely
168+
FROM build_git AS build_patchelf
169+
COPY build_scripts/build-patchelf.sh /build_scripts/
170+
RUN export PATCHELF_ROOT=patchelf-523f401 && \
171+
export PATCHELF_GIT_URL=https://github.com/NixOS/patchelf && \
172+
manylinux-entrypoint /build_scripts/build-patchelf.sh
173+
166174
# AlmaLinux 8 has protobuf 3.5.0; IIRC that was too old for Valhalla
167175
FROM build_base AS build_protobuf
168176
COPY build_scripts/build-protobuf.sh /build_scripts/
@@ -191,6 +199,7 @@ COPY --from=build_mpdecimal /manylinux-rootfs /
191199
COPY --from=build_sqlite3 /manylinux-rootfs /
192200
COPY --from=build_git /manylinux-rootfs /
193201
COPY --from=build_prime_server /manylinux-rootfs /
202+
COPY --from=build_patchelf /manylinux-rootfs /
194203
COPY --from=build_protobuf /manylinux-rootfs /
195204
COPY --from=build_boost /manylinux-rootfs /
196205
COPY --from=build_geos /manylinux-rootfs /
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Top-level build script called from Dockerfile
3+
4+
# Stop at any error, show all commands
5+
set -exuo pipefail
6+
7+
# Get script directory
8+
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
9+
10+
# Get build utilities
11+
# shellcheck source-path=SCRIPTDIR
12+
source "${MY_DIR}/build_utils.sh"
13+
14+
check_var "${PATCHELF_ROOT}"
15+
check_var "${PATCHELF_GIT_URL}"
16+
17+
# remove system patchelf first
18+
manylinux_pkg_remove patchelf
19+
20+
# fetch the sources and install
21+
PATCHELF_COMMIT=${PATCHELF_ROOT#*-}
22+
git clone --recurse-submodules -j$(nproc) ${PATCHELF_GIT_URL} ${PATCHELF_ROOT}
23+
pushd "${PATCHELF_ROOT}"
24+
git checkout ${PATCHELF_COMMIT}
25+
./bootstrap.sh
26+
DESTDIR=/manylinux-rootfs do_standard_install
27+
popd
28+
rm -rf "${PATCHELF_ROOT}"
29+
30+
# Strip what we can
31+
strip_ /manylinux-rootfs
32+
33+
# Install
34+
cp -rlf /manylinux-rootfs/* /
35+
36+
hash -r

0 commit comments

Comments
 (0)