aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-08-16 12:57:03 +0100
committerfanquake <fanquake@gmail.com>2023-08-16 13:10:58 +0100
commit60d3e4b0cd8716a6fe1be6b4d1b8237da8e56126 (patch)
treee86964ebb686fb5738541461fd9e0a7d4b58ec6f
parent72304ccf1e1583fd419222c9d9f0d44938a75352 (diff)
parentfa6e5d3eeffebf81b5d7ca99bf7b5e70356516ab (diff)
downloadbitcoin-60d3e4b0cd8716a6fe1be6b4d1b8237da8e56126.tar.xz
Merge bitcoin/bitcoin#28273: ci: Fix macOS-cross SDK rsync
fa6e5d3eeffebf81b5d7ca99bf7b5e70356516ab ci: Avoid error on macOS native (MarcoFalke) fa193f5dfc937a7ff8e12b9ffd21861046a46489 ci: Fix macOS-cross SDK rsync (MarcoFalke) Pull request description: This should fix the macOS-cross build on Cirrus CI containers. Locally this was already working, because the SDK was cached in `/ci_container_base/` in the image, which is also the folder used for a later CI run. However, on Cirrus CI, when using an image *and* a custom `BASE_ROOT_DIR`, the SDK will not be found in `/ci_base_install/`, nor in `BASE_ROOT_DIR`. Fix this by normalizing *all* folders to `/ci_container_base/`. ACKs for top commit: hebasto: ACK fa6e5d3eeffebf81b5d7ca99bf7b5e70356516ab Tree-SHA512: 8312f7e72c3638caa6804e39206d3563ba1703204d53ce63de22e0a16a71e1e143ec00fac6b43ebfc0653c7b74160472c04e95e2d694c8c0965e7dc39e627d39
-rw-r--r--.cirrus.yml4
-rw-r--r--.github/workflows/ci.yml1
-rwxr-xr-xci/test/00_setup_env.sh10
-rwxr-xr-xci/test/04_install.sh3
-rw-r--r--ci/test_imagefile4
5 files changed, 10 insertions, 12 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 29116c9940..84bf27eb25 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -64,8 +64,8 @@ container_depends_template: &CONTAINER_DEPENDS_TEMPLATE
cpu: 2
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
dockerfile: ci/test_imagefile # https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment
- depends_built_cache:
- folder: "depends/built"
+ base_depends_built_cache:
+ folder: "/ci_container_base/depends/built"
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends)
global_task_template: &GLOBAL_TASK_TEMPLATE
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f6d22f033f..44ee0b5c59 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,6 +34,7 @@ jobs:
CI_USE_APT_INSTALL: 'no'
PACKAGE_MANAGER_INSTALL: 'echo' # Nothing to do
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
+ BASE_ROOT_DIR: ${{ github.workspace }}
steps:
- name: Checkout
diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh
index 3014714a44..c479a8a3fe 100755
--- a/ci/test/00_setup_env.sh
+++ b/ci/test/00_setup_env.sh
@@ -13,13 +13,9 @@ set -ex
BASE_READ_ONLY_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
export BASE_READ_ONLY_DIR
# The destination root dir inside the container.
-if [ -z "${DANGER_RUN_CI_ON_HOST}" ] ; then
- # This folder only exists on the ci guest and will be a copy of BASE_READ_ONLY_DIR
- export BASE_ROOT_DIR="/ci_container_base"
-else
- # This folder is equal to BASE_READ_ONLY_DIR and is read-write
- export BASE_ROOT_DIR="${BASE_READ_ONLY_DIR}"
-fi
+# 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
+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.
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index 99e16bcb98..a2ea2b7093 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -58,7 +58,8 @@ CI_EXEC () {
}
export -f CI_EXEC
-CI_EXEC rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" || echo "/ci_base_install/ missing"
+# Normalize all folders to BASE_ROOT_DIR
+CI_EXEC rsync --archive --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/"
CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base"
# Fixes permission issues when there is a container UID/GID mismatch with the owner
diff --git a/ci/test_imagefile b/ci/test_imagefile
index 8dfb5916b1..f8b5eea1c8 100644
--- a/ci/test_imagefile
+++ b/ci/test_imagefile
@@ -11,6 +11,6 @@ ARG FILE_ENV
ENV FILE_ENV=${FILE_ENV}
COPY ./ci/retry/retry /usr/bin/retry
-COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_base_install/ci/test/
+COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/
-RUN ["bash", "-c", "cd /ci_base_install/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]
+RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]