From 14607090a980d9adeb2662730eda56b8b6c6d34e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 9 Apr 2025 10:36:00 +0100 Subject: [PATCH 1/4] CI: Use the git commit hash to determine the revision of APR/APR-util from the github repos, rather than relying on SVN (so it won't matter if apr/apr-util move to read/write git in the future). --- test/travis_before_linux.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index 4630e5088c5..94c5f10c4d8 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -24,7 +24,6 @@ fi function install_apx() { local name=$1 local version=$2 - local root=https://svn.apache.org/repos/asf/apr/${name} local prefix=${HOME}/root/${name}-${version} local build=${HOME}/build/${name}-${version} local giturl=https://github.com/apache/${name}.git @@ -32,16 +31,20 @@ function install_apx() { local buildconf=$4 case $version in - trunk) url=${root}/trunk ;; - *.x) url=${root}/branches/${version} ;; - *) url=${root}/tags/${version} ;; + trunk|*.x) ref=refs/heads/${version} ;; + *) ref=refs/tags/${version} ;; esac - local revision=`svn info --show-item last-changed-revision ${url}` + # Fetch the object ID (hash) of latest commit + local commit=`git ls-remote ${giturl} ${ref} | cut -f1` + if test -z "$commit"; then + : Could not determine latest commit hash for ${ref} in ${giturl} - check branch is valid? + exit 1 + fi # Blow away the cached install root if the cached install is stale # or doesn't match the expected configuration. - grep -q "${version} ${revision} ${config} CC=$CC" ${HOME}/root/.key-${name} || rm -rf ${prefix} + grep -q "${version} ${commit} ${config} CC=$CC" ${HOME}/root/.key-${name} || rm -rf ${prefix} if test -d ${prefix}; then return 0 @@ -55,7 +58,7 @@ function install_apx() { make install popd - echo ${version} ${revision} "${config}" "CC=${CC}" > ${HOME}/root/.key-${name} + echo ${version} ${commit} "${config}" "CC=${CC}" > ${HOME}/root/.key-${name} } # Allow to load $HOME/build/apache/httpd/.gdbinit From ee8749cd6a7b92cd973e94bb9405034e31fd6308 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 9 Apr 2025 11:02:48 +0100 Subject: [PATCH 2/4] CI: Checkout the specific apx revision determined by git ls-remote to avoid a race condition. --- test/travis_before_linux.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index 94c5f10c4d8..a3349c01b7a 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -50,8 +50,12 @@ function install_apx() { return 0 fi - git clone -q --depth=1 --branch=$version ${giturl} ${build} + git init -q ${build} pushd $build + # Clone and checkout the commit identified above. + git remote add origin ${giturl} + git fetch -q --depth=1 ${commit} + git checkout ${commit} ./buildconf ${buildconf} ./configure --prefix=${prefix} ${config} make -j2 From 281da9e9d7f0cf441d511b75c07494a7b5b0fc11 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 9 Apr 2025 11:03:47 +0100 Subject: [PATCH 3/4] Force cache refresh. --- test/travis_before_linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index a3349c01b7a..95ec9f75cfa 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -44,7 +44,7 @@ function install_apx() { # Blow away the cached install root if the cached install is stale # or doesn't match the expected configuration. - grep -q "${version} ${commit} ${config} CC=$CC" ${HOME}/root/.key-${name} || rm -rf ${prefix} + grep -q "${version} xxx ${commit} ${config} CC=$CC" ${HOME}/root/.key-${name} || rm -rf ${prefix} if test -d ${prefix}; then return 0 From f7784136ddfb93d96b3e581d6fd2507b8ce87870 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 9 Apr 2025 11:05:23 +0100 Subject: [PATCH 4/4] Fix git fetch command. --- test/travis_before_linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index 95ec9f75cfa..e746814d455 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -54,7 +54,7 @@ function install_apx() { pushd $build # Clone and checkout the commit identified above. git remote add origin ${giturl} - git fetch -q --depth=1 ${commit} + git fetch -q --depth=1 origin ${commit} git checkout ${commit} ./buildconf ${buildconf} ./configure --prefix=${prefix} ${config}