Skip to content

Commit b062873

Browse files
committed
Split patchelf build in runtime_base image
1 parent 83be2f2 commit b062873

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed

docker/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ COPY build_scripts/build_utils.sh /build_scripts/
3232
COPY build_scripts/build_env_runtime.sh /build_scripts/
3333
RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh
3434

35+
COPY build_scripts/install-patchelf.sh /build_scripts/
36+
RUN export PATCHELF_VERSION=0.12 && \
37+
export PATCHELF_HASH=3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56 && \
38+
export PATCHELF_DOWNLOAD_URL=https://github.com/NixOS/patchelf/archive && \
39+
manylinux-entrypoint /build_scripts/install-patchelf.sh
40+
3541
COPY build_scripts/install-libxcrypt.sh /build_scripts/
3642
RUN export LIBXCRYPT_VERSION=4.4.17 && \
3743
export LIBXCRYPT_HASH=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07 && \

docker/build_scripts/build_env_runtime.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# source me
22

3-
PATCHELF_VERSION=0.12
4-
PATCHELF_HASH=3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56
5-
PATCHELF_DOWNLOAD_URL=https://github.com/NixOS/patchelf/archive
6-
73
AUTOMAKE_ROOT=automake-1.16.2
84
AUTOMAKE_HASH=b2f361094b410b4acbf4efba7337bdb786335ca09eb2518635a09fb7319ca5c1
95
AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake

docker/build_scripts/build_utils.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,3 @@ function build_libtool {
159159
(cd ${libtool_fname} && do_standard_install)
160160
rm -rf ${libtool_fname} ${libtool_fname}.tar.gz
161161
}
162-
163-
164-
function build_patchelf {
165-
local patchelf_version=$1
166-
local patchelf_hash=$2
167-
check_var ${patchelf_version}
168-
check_var ${patchelf_hash}
169-
check_var ${PATCHELF_DOWNLOAD_URL}
170-
fetch_source ${patchelf_version}.tar.gz ${PATCHELF_DOWNLOAD_URL}
171-
check_sha256sum ${patchelf_version}.tar.gz $patchelf_hash
172-
tar -xzf ${patchelf_version}.tar.gz
173-
(cd patchelf-$patchelf_version && ./bootstrap.sh && do_standard_install)
174-
rm -rf ${patchelf_version}.tar.gz patchelf-$patchelf_version
175-
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
source $MY_DIR/build_utils.sh
12+
13+
# Install patchelf (latest with unreleased bug fixes) and apply our patches
14+
check_var ${PATCHELF_VERSION}
15+
check_var ${PATCHELF_HASH}
16+
check_var ${PATCHELF_DOWNLOAD_URL}
17+
fetch_source ${PATCHELF_VERSION}.tar.gz ${PATCHELF_DOWNLOAD_URL}
18+
check_sha256sum ${PATCHELF_VERSION}.tar.gz ${PATCHELF_HASH}
19+
tar -xzf ${PATCHELF_VERSION}.tar.gz
20+
pushd patchelf-${PATCHELF_VERSION}
21+
./bootstrap.sh
22+
do_standard_install
23+
popd
24+
rm -rf ${PATCHELF_VERSION}.tar.gz patchelf-${PATCHELF_VERSION}
25+
26+
27+
patchelf --version

docker/build_scripts/install-runtime-packages.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ automake --version
130130
build_libtool $LIBTOOL_ROOT $LIBTOOL_HASH
131131
libtool --version
132132

133-
# Install patchelf (latest with unreleased bug fixes) and apply our patches
134-
build_patchelf $PATCHELF_VERSION $PATCHELF_HASH
135-
136133
# Strip what we can -- and ignore errors, because this just attempts to strip
137134
# *everything*, including non-ELF files:
138135
find /usr/local -type f -print0 | xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true

0 commit comments

Comments
 (0)