Skip to content

[manylinux2014] Strip tools installed in runtime_base image #975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2021
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: 9 additions & 1 deletion docker/build_scripts/install-automake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ fetch_source ${AUTOMAKE_ROOT}.tar.gz ${AUTOMAKE_DOWNLOAD_URL}
check_sha256sum ${AUTOMAKE_ROOT}.tar.gz ${AUTOMAKE_HASH}
tar -zxf ${AUTOMAKE_ROOT}.tar.gz
pushd ${AUTOMAKE_ROOT}
do_standard_install
DESTDIR=/manylinux-rootfs do_standard_install
popd
rm -rf ${AUTOMAKE_ROOT} ${AUTOMAKE_ROOT}.tar.gz

# Strip what we can
strip_ /manylinux-rootfs

# Install
cp -rf /manylinux-rootfs/* /

# Remove temporary rootfs
rm -rf /manylinux-rootfs

hash -r
automake --version
10 changes: 9 additions & 1 deletion docker/build_scripts/install-libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ fetch_source ${LIBTOOL_ROOT}.tar.gz ${LIBTOOL_DOWNLOAD_URL}
check_sha256sum ${LIBTOOL_ROOT}.tar.gz ${LIBTOOL_HASH}
tar -zxf ${LIBTOOL_ROOT}.tar.gz
pushd ${LIBTOOL_ROOT}
do_standard_install
DESTDIR=/manylinux-rootfs do_standard_install
popd
rm -rf ${LIBTOOL_ROOT} ${LIBTOOL_ROOT}.tar.gz

# Strip what we can
strip_ /manylinux-rootfs

# Install
cp -rf /manylinux-rootfs/* /

# Remove temporary rootfs
rm -rf /manylinux-rootfs

hash -r
libtoolize --version
16 changes: 13 additions & 3 deletions docker/build_scripts/install-libxcrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,33 @@ 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 \
DESTDIR=/manylinux-rootfs 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 \
DESTDIR=/manylinux-rootfs/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/
cp -P /manylinux-rootfs/so.1/usr/local/lib/libcrypt.so.1* /manylinux-rootfs/usr/local/lib/
rm -rf /manylinux-rootfs/so.1
popd
rm -rf "v${LIBXCRYPT_VERSION}.tar.gz" "libxcrypt-${LIBXCRYPT_VERSION}"

# Strip what we can
strip_ /manylinux-rootfs

# Install
cp -rf /manylinux-rootfs/* /

# Remove temporary rootfs
rm -rf /manylinux-rootfs

# 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
10 changes: 9 additions & 1 deletion docker/build_scripts/install-patchelf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ check_sha256sum ${PATCHELF_VERSION}.tar.gz ${PATCHELF_HASH}
tar -xzf ${PATCHELF_VERSION}.tar.gz
pushd patchelf-${PATCHELF_VERSION}
./bootstrap.sh
do_standard_install
DESTDIR=/manylinux-rootfs do_standard_install
popd
rm -rf ${PATCHELF_VERSION}.tar.gz patchelf-${PATCHELF_VERSION}

# Strip what we can
strip_ /manylinux-rootfs

# Install
cp -rf /manylinux-rootfs/* /

# Remove temporary rootfs
rm -rf /manylinux-rootfs

patchelf --version