From fae7ba9abae8c5bec72b1c79bdd2480bade89399 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 4 Aug 2026 14:02:25 +0200 Subject: [PATCH] ci: Fix $BASE_ROOT_DIR installation --- ci/test/00_setup_env.sh | 4 +++- ci/test/01_base_install.sh | 4 ++-- ci/test_imagefile | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 4ca660a5d69..fc8f2d98046 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -14,7 +14,9 @@ BASE_READ_ONLY_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2> export BASE_READ_ONLY_DIR # The destination root dir inside the container. # This folder will also hold any SDKs. -# This folder only exists on the ci guest and will be a copy of BASE_READ_ONLY_DIR +# This folder only exists on the ci guest and will be a copy of BASE_READ_ONLY_DIR. +# This value is embedded in the CI image at build time; changing it requires +# rebuilding the image. export BASE_ROOT_DIR="${BASE_ROOT_DIR:-/ci_container_base}" # The depends dir. # This folder exists only on the ci guest, and on the ci host as a volume. diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh index 0c3dfc42447..29121476c37 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -106,8 +106,8 @@ fi if [[ "${RUN_IWYU}" == true ]]; then ${CI_RETRY_EXE} git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_"${IWYU_LLVM_V}" /include-what-you-use pushd /include-what-you-use - patch -p1 < /ci_container_base/ci/test/01_iwyu.patch - patch -p1 < /ci_container_base/ci/test/02_iwyu_hash.patch + patch -p1 < "${BASE_ROOT_DIR}/ci/test/01_iwyu.patch" + patch -p1 < "${BASE_ROOT_DIR}/ci/test/02_iwyu_hash.patch" popd cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${IWYU_LLVM_V}" -S /include-what-you-use make -C /iwyu-build/ install "$MAKEJOBS" diff --git a/ci/test_imagefile b/ci/test_imagefile index dac6b553156..c696f075922 100644 --- a/ci/test_imagefile +++ b/ci/test_imagefile @@ -16,10 +16,10 @@ ENV BASE_ROOT_DIR=${BASE_ROOT_DIR} # Make retry available in PATH, needed for CI_RETRY_EXE COPY ./ci/retry/retry /usr/bin/retry -COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/ -COPY ./ci/test/*.patch /ci_container_base/ci/test/ +COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh ${BASE_ROOT_DIR}/ci/test/ +COPY ./ci/test/*.patch ${BASE_ROOT_DIR}/ci/test/ # Bash is required, so install it when missing RUN sh -c "bash -c 'true' || ( apk update && apk add --no-cache bash )" -RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && DANGER_RUN_CI_ON_HOST=1 ./ci/test/01_base_install.sh"] +RUN ["bash", "-c", "cd ${BASE_ROOT_DIR}/ && set -o errexit && source ./ci/test/00_setup_env.sh && DANGER_RUN_CI_ON_HOST=1 ./ci/test/01_base_install.sh"]