Skip to content

Commit fa193f5

Browse files
author
MarcoFalke
committed
ci: Fix macOS-cross SDK rsync
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/.
1 parent b8ee2fa commit fa193f5

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

.cirrus.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ container_depends_template: &CONTAINER_DEPENDS_TEMPLATE
6464
cpu: 2
6565
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
6666
dockerfile: ci/test_imagefile # https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment
67-
depends_built_cache:
68-
folder: "depends/built"
67+
base_depends_built_cache:
68+
folder: "/ci_container_base/depends/built"
6969
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends)
7070

7171
global_task_template: &GLOBAL_TASK_TEMPLATE

ci/test/00_setup_env.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ set -ex
1313
BASE_READ_ONLY_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
1414
export BASE_READ_ONLY_DIR
1515
# The destination root dir inside the container.
16-
if [ -z "${DANGER_RUN_CI_ON_HOST}" ] ; then
17-
# This folder only exists on the ci guest and will be a copy of BASE_READ_ONLY_DIR
18-
export BASE_ROOT_DIR="/ci_container_base"
19-
else
20-
# This folder is equal to BASE_READ_ONLY_DIR and is read-write
21-
export BASE_ROOT_DIR="${BASE_READ_ONLY_DIR}"
22-
fi
16+
# This folder will also hold any SDKs.
17+
# This folder only exists on the ci guest and will be a copy of BASE_READ_ONLY_DIR
18+
export BASE_ROOT_DIR="/ci_container_base"
2319
# The depends dir.
2420
# This folder exists only on the ci guest, and on the ci host as a volume.
2521
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}

ci/test/04_install.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ CI_EXEC () {
5858
}
5959
export -f CI_EXEC
6060

61-
CI_EXEC rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" || echo "/ci_base_install/ missing"
61+
# Normalize all folders to BASE_ROOT_DIR
62+
CI_EXEC rsync --archive --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/"
6263
CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
6364
CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base"
6465
# Fixes permission issues when there is a container UID/GID mismatch with the owner

ci/test_imagefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ ARG FILE_ENV
1111
ENV FILE_ENV=${FILE_ENV}
1212

1313
COPY ./ci/retry/retry /usr/bin/retry
14-
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_base_install/ci/test/
14+
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/
1515

16-
RUN ["bash", "-c", "cd /ci_base_install/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]
16+
RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]

0 commit comments

Comments
 (0)