From fa80928469010ecd96d4b7386a0da1a02a8859bc Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Tue, 7 Jul 2026 02:47:12 -0500 Subject: [PATCH] [CK] Check git validity instead of dir existence On Alola some periodic /tmp wipes leave the source directories in an unusable state. Thus, check the git validity instead of pure directory existence. --- bin/run_composable-kernels.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/run_composable-kernels.sh b/bin/run_composable-kernels.sh index 0184330f2..574d17077 100755 --- a/bin/run_composable-kernels.sh +++ b/bin/run_composable-kernels.sh @@ -282,7 +282,14 @@ if [ ! -d "${CK_TOP}" ]; then mkdir -p "${CK_TOP}" || exit 1 fi -if [ ! -d "${CK_REPO}" ]; then +# Validate that CK_REPO is an actual git checkout, not just an existing +# directory. Alola periodically wipes the *contents* of old node-local dirs +# while leaving the directory shells behind, which yields a CK_REPO that +# exists but has no .git (and no CMakeLists.txt), breaking the build. A plain +# "-d" test would skip the clone and then fail. Re-clone when the tree is +# missing or not a valid repo; only pull when it is a healthy checkout. +if ! git -C "${CK_REPO}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then + rm -rf "${CK_REPO}" git clone --single-branch --depth 1 ${CKRepoURL} "${CK_REPO}" elif [ "${ShouldUpdateCKRepo}" == 'yes' ]; then pushd "${CK_REPO}" || exit 1