From 802bd5fe13cb8afa29440645f7ce982d7a8fb5cb Mon Sep 17 00:00:00 2001 From: mck Date: Tue, 17 Oct 2023 10:55:22 +0200 Subject: [PATCH] =?UTF-8?q?ninja-fix=20=E2=80=93=C2=A0reusing=20git=20clon?= =?UTF-8?q?e=20under=20build=20needs=20reset=20and=20permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref: https://the-asf.slack.com/archives/CK23JSY2K/p1697465832946299 patch by Mick Semb Wever; reviewed by Štefan Miklošovič, Maxim Muzafarov for CASSANDRA-18665 --- .build/run-tests.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.build/run-tests.sh b/.build/run-tests.sh index 9e1291cf74..cf5ddcc1b8 100755 --- a/.build/run-tests.sh +++ b/.build/run-tests.sh @@ -87,13 +87,16 @@ _build_all_dtest_jars() { fi if [ -d ${TMP_DIR}/cassandra-dtest-jars ] && [ "https://github.com/apache/cassandra.git" == "$(git -C ${TMP_DIR}/cassandra-dtest-jars remote get-url origin)" ] ; then + echo "Reusing ${TMP_DIR}/cassandra-dtest-jars for past branch dtest jars" if [ "x" == "x${OFFLINE}" ] ; then - until git -C ${TMP_DIR}/cassandra-dtest-jars fetch --quiet origin ; do echo "git fetch failed… trying again… " ; done + until git -C ${TMP_DIR}/cassandra-dtest-jars fetch --quiet origin ; do echo "git -C ${TMP_DIR}/cassandra-dtest-jars fetch failed… trying again… " ; done fi else + echo "Cloning cassandra to ${TMP_DIR}/cassandra-dtest-jars for past branch dtest jars" rm -fR ${TMP_DIR}/cassandra-dtest-jars pushd $TMP_DIR >/dev/null until git clone --quiet --depth 1 --no-single-branch https://github.com/apache/cassandra.git cassandra-dtest-jars ; do echo "git clone failed… trying again… " ; done + chmod -R ag+rwx cassandra-dtest-jars popd >/dev/null fi @@ -102,6 +105,7 @@ _build_all_dtest_jars() { pushd ${TMP_DIR}/cassandra-dtest-jars >/dev/null for branch in cassandra-4.0 cassandra-4.1 cassandra-5.0 ; do + git reset --hard HEAD && git clean -qxdff || echo "failed to reset/clean ${TMP_DIR}/cassandra-dtest-jars… continuing…" git checkout --quiet $branch dtest_jar_version=$(grep 'property\s*name=\"base.version\"' build.xml |sed -ne 's/.*value=\"\([^"]*\)\".*/\1/p') if [ -f "${DIST_DIR}/dtest-${dtest_jar_version}.jar" ] ; then