From 0f803072655d562dd3744397b59e4ff103fe7aeb Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Tue, 12 Nov 2024 08:28:29 +0100 Subject: [PATCH] =?UTF-8?q?Bump=20git=202.45.2=20=E2=86=92=202.47.0=20(#17?= =?UTF-8?q?08)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 9 +++-- docker/build_scripts/build-curl.sh | 55 +++++++++++++++++++++++++++++ docker/build_scripts/build-git.sh | 8 +++++ tools/update_native_dependencies.py | 4 +-- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100755 docker/build_scripts/build-curl.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 9488badec..cec52600f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -72,9 +72,14 @@ RUN manylinux-entrypoint /build_scripts/install-build-packages.sh FROM build_base AS build_git +COPY build_scripts/build-curl.sh /build_scripts/ +RUN export CURL_ROOT=curl-8.11.0 && \ + export CURL_HASH=264537d90e58d2b09dddc50944baf3c38e7089151c8986715e2aaeaaf2b8118f && \ + export CURL_DOWNLOAD_URL=https://curl.haxx.se/download && \ + manylinux-entrypoint /build_scripts/build-curl.sh COPY build_scripts/build-git.sh /build_scripts/ -RUN export GIT_ROOT=git-2.45.2 && \ - export GIT_HASH=98b26090ed667099a3691b93698d1e213e1ded73d36a2fde7e9125fce28ba234 && \ +RUN export GIT_ROOT=git-2.47.0 && \ + export GIT_HASH=a84a7917e0ab608312834413f01fc01edc7844f9f9002ba69f3b4f4bcb8d937a && \ export GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git && \ manylinux-entrypoint /build_scripts/build-git.sh diff --git a/docker/build_scripts/build-curl.sh b/docker/build_scripts/build-curl.sh new file mode 100755 index 000000000..7de7e631c --- /dev/null +++ b/docker/build_scripts/build-curl.sh @@ -0,0 +1,55 @@ +#!/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 a more recent curl +check_var ${CURL_ROOT} +check_var ${CURL_HASH} +check_var ${CURL_DOWNLOAD_URL} + +# Only needed on manylinux2014 +if [ "${AUDITWHEEL_POLICY}" != "manylinux2014" ]; then + echo "skipping installation of ${CURL_ROOT}" + exit 0 +fi + +if which yum; then + yum erase -y curl-devel +else + apk del curl-dev +fi + +SO_COMPAT=4 +PREFIX=/opt/_internal/curl-${SO_COMPAT} + +fetch_source ${CURL_ROOT}.tar.gz ${CURL_DOWNLOAD_URL} +check_sha256sum ${CURL_ROOT}.tar.gz ${CURL_HASH} +tar -xzf ${CURL_ROOT}.tar.gz +pushd ${CURL_ROOT} +./configure --prefix=${PREFIX} --disable-static --without-libpsl --with-openssl CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" CXXFLAGS="${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS} -Wl,-rpath=\$(LIBRPATH)" > /dev/null +make > /dev/null +make install > /dev/null +popd +rm -rf ${CURL_ROOT} ${CURL_ROOT}.tar.gz ${PREFIX}/share/man + +if [ ! -f ${PREFIX}/lib/libcurl.so.${SO_COMPAT} ]; then + echo "please update SO_COMPAT" + ls -al ${PREFIX}/lib + exit 1 +fi + +strip_ ${PREFIX} + +${PREFIX}/bin/curl --version +${PREFIX}/bin/curl-config --features + +mkdir -p /manylinux-rootfs/${PREFIX}/lib +cp -f ${PREFIX}/lib/libcurl.so.${SO_COMPAT} /manylinux-rootfs/${PREFIX}/lib/ diff --git a/docker/build_scripts/build-git.sh b/docker/build_scripts/build-git.sh index cf0df1162..7dbbc24df 100755 --- a/docker/build_scripts/build-git.sh +++ b/docker/build_scripts/build-git.sh @@ -18,6 +18,14 @@ if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then export NO_UNCOMPRESS2=1 fi +if [ -d /opt/_internal ]; then + CURL_PREFIX=$(find /opt/_internal -maxdepth 1 -name 'curl-*') + if [ "${CURL_PREFIX}" != "" ]; then + export CURLDIR=${CURL_PREFIX} + export CURL_LDFLAGS="-Wl,-rpath=${CURL_PREFIX}/lib $(${CURL_PREFIX}/bin/curl-config --libs)" + fi +fi + # Install newest git check_var ${GIT_ROOT} check_var ${GIT_HASH} diff --git a/tools/update_native_dependencies.py b/tools/update_native_dependencies.py index bf6d5e236..e193c26c6 100644 --- a/tools/update_native_dependencies.py +++ b/tools/update_native_dependencies.py @@ -70,10 +70,10 @@ def _update_with_root(tool, dry_run): "libtool": "autotools-mirror/libtool", "git": "git/git", "openssl": "openssl/openssl", + "curl": "curl/curl", } major = { "openssl": "3.0", - "git": "2.45", # 2.46+ can't build on CentOS 7 } only = { "autoconf": r"~v?[0-9]+\.[0-9]+(\.[0-9]+)?$", @@ -196,7 +196,7 @@ def main(): _update_cpython(args.dry_run) _update_sqlite(args.dry_run) _update_tcltk(args.dry_run) - for tool in ["autoconf", "automake", "libtool", "git", "openssl"]: + for tool in ["autoconf", "automake", "libtool", "git", "openssl", "curl"]: _update_with_root(tool, args.dry_run) for tool in ["libxcrypt"]: _update_with_gh(tool, args.dry_run)