Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ RUN bash /build_scripts/install-entrypoint.sh && rm -rf build_scripts
COPY manylinux-entrypoint /usr/local/bin/manylinux-entrypoint
ENTRYPOINT ["manylinux-entrypoint"]


COPY build_scripts/install-runtime-packages.sh /build_scripts/
COPY build_scripts/build_utils.sh /build_scripts/
COPY build_scripts/build_env_runtime.sh /build_scripts/
RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh && rm -rf /build_scripts
RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh

COPY build_scripts/install-libxcrypt.sh /build_scripts/
RUN export LIBXCRYPT_VERSION=4.4.17 && \
export LIBXCRYPT_HASH=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07 && \
export LIBXCRYPT_DOWNLOAD_URL=https://github.com/besser82/libxcrypt/archive && \
manylinux-entrypoint /build_scripts/install-libxcrypt.sh


FROM runtime_base AS build_base
COPY build_scripts/*pubkey*.txt /build_scripts/
Expand Down
4 changes: 0 additions & 4 deletions docker/build_scripts/build_env_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake
LIBTOOL_ROOT=libtool-2.4.6
LIBTOOL_HASH=e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3
LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool

LIBXCRYPT_VERSION=4.4.17
LIBXCRYPT_HASH=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07
LIBXCRYPT_DOWNLOAD_URL=https://github.com/besser82/libxcrypt/archive
30 changes: 0 additions & 30 deletions docker/build_scripts/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,36 +160,6 @@ function build_libtool {
rm -rf ${libtool_fname} ${libtool_fname}.tar.gz
}

function build_libxcrypt {
check_var ${LIBXCRYPT_VERSION}
check_var ${LIBXCRYPT_HASH}
check_var ${LIBXCRYPT_DOWNLOAD_URL}
fetch_source v${LIBXCRYPT_VERSION}.tar.gz ${LIBXCRYPT_DOWNLOAD_URL}
check_sha256sum "v${LIBXCRYPT_VERSION}.tar.gz" "$LIBXCRYPT_HASH"
tar xfz "v${LIBXCRYPT_VERSION}.tar.gz"
pushd "libxcrypt-$LIBXCRYPT_VERSION"
./autogen.sh > /dev/null
do_standard_install \
--disable-obsolete-api \
--enable-hashes=all \
--disable-werror
# we also need libcrypt.so.1 with glibc compatibility for system libraries
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
make clean > /dev/null
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
DESTDIR=$(pwd)/so.1 do_standard_install \
--disable-xcrypt-compat-files \
--enable-obsolete-api=glibc \
--enable-hashes=all \
--disable-werror
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
popd
rm -rf "v${LIBXCRYPT_VERSION}.tar.gz" "libxcrypt-$LIBXCRYPT_VERSION"

# Delete GLIBC version headers and libraries
rm -rf /usr/include/crypt.h
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
}

function build_patchelf {
local patchelf_version=$1
Expand Down
41 changes: 41 additions & 0 deletions docker/build_scripts/install-libxcrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Top-level build script called from Dockerfile

# Stop at any error, show all commands
set -exuo pipefail

# Get script directory
MY_DIR=$(dirname "${BASH_SOURCE[0]}")

# Get build utilities
source $MY_DIR/build_utils.sh

# Install libcrypt.so.1 and libcrypt.so.2
check_var ${LIBXCRYPT_VERSION}
check_var ${LIBXCRYPT_HASH}
check_var ${LIBXCRYPT_DOWNLOAD_URL}
fetch_source v${LIBXCRYPT_VERSION}.tar.gz ${LIBXCRYPT_DOWNLOAD_URL}
check_sha256sum "v${LIBXCRYPT_VERSION}.tar.gz" "${LIBXCRYPT_HASH}"
tar xfz "v${LIBXCRYPT_VERSION}.tar.gz"
pushd "libxcrypt-${LIBXCRYPT_VERSION}"
./autogen.sh > /dev/null
do_standard_install \
--disable-obsolete-api \
--enable-hashes=all \
--disable-werror
# we also need libcrypt.so.1 with glibc compatibility for system libraries
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
make clean > /dev/null
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
DESTDIR=$(pwd)/so.1 do_standard_install \
--disable-xcrypt-compat-files \
--enable-obsolete-api=glibc \
--enable-hashes=all \
--disable-werror
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
popd
rm -rf "v${LIBXCRYPT_VERSION}.tar.gz" "libxcrypt-${LIBXCRYPT_VERSION}"

# Delete GLIBC version headers and libraries
rm -rf /usr/include/crypt.h
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
3 changes: 0 additions & 3 deletions docker/build_scripts/install-runtime-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ libtool --version
# Install patchelf (latest with unreleased bug fixes) and apply our patches
build_patchelf $PATCHELF_VERSION $PATCHELF_HASH

# Install libcrypt.so.1 and libcrypt.so.2
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"

# Strip what we can -- and ignore errors, because this just attempts to strip
# *everything*, including non-ELF files:
find /usr/local -type f -print0 | xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true