Skip to content

Commit de4d3ba

Browse files
committed
Merge #21541: ci: Build depends only once for Android build
fa52d7d cirrus: Add missing depends_sources_cache to Android task (MarcoFalke) ffff4e7 cirrus: Only cache releases when needed (MarcoFalke) fa97a17 ci: Bump Android cross-build to Ubuntu Focal (MarcoFalke) fac577d ci: Build depends only once for Android build (MarcoFalke) fa908a4 ci: Set DEPENDS_DIR when setting BASE_ROOT_DIR (MarcoFalke) Pull request description: Currently the Android task has several issues: * It is missing a cache instruction, thus failing the build on Cirrus CI * It is running the depends build twice Fix those issues ACKs for top commit: ryanofsky: Code review ACK fa52d7d. Only change since last review is adding descriptions and changing new RUN_UNIT_TESTS line from true to false. (I assume that change doesn't do anything because even though prior default was true, it's a cross compiled build and enabling unit tests would have no effect.) hebasto: ACK fa52d7d, I have reviewed the code and it looks OK, I agree it can be merged after passing CI. Tree-SHA512: ae7c68e357068176a0e58285b83521353321c65862cee4ff56f413c51b00398062f0ee6775bfbbf28fda420cf5a24000a2286fbcf6cc7f3729b7805bc8419726
2 parents c008526 + fa52d7d commit de4d3ba

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

.cirrus.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
3535
folder: "/tmp/cirrus-ci-build/depends/built"
3636
depends_sdk_cache:
3737
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
38-
depends_releases_cache:
39-
folder: "/tmp/cirrus-ci-build/releases"
4038
ci_script:
4139
- ./ci/test_run_all.sh
4240

@@ -103,6 +101,8 @@ task:
103101
# For faster CI feedback, immediately schedule a task that compiles most modules
104102
<< : *CREDITS_TEMPLATE
105103
<< : *GLOBAL_TASK_TEMPLATE
104+
depends_releases_cache:
105+
folder: "/tmp/cirrus-ci-build/releases"
106106
container:
107107
image: ubuntu:bionic
108108
env:
@@ -182,9 +182,11 @@ task:
182182
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
183183

184184
task:
185-
name: 'ARM64 Android APK [bionic]'
185+
name: 'ARM64 Android APK [focal]'
186+
depends_sources_cache:
187+
folder: "/tmp/cirrus-ci-build/depends/sources"
186188
<< : *GLOBAL_TASK_TEMPLATE
187189
container:
188-
image: ubuntu:bionic
190+
image: ubuntu:focal
189191
env:
190192
FILE_ENV: "./ci/test/00_setup_env_android.sh"

ci/test/00_setup_env.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export LC_ALL=C.UTF-8
1111
# This is where the depends build is done.
1212
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
1313
export BASE_ROOT_DIR
14+
# The depends dir.
15+
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
16+
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
1417

1518
echo "Setting specific values in env"
1619
if [ -n "${FILE_ENV}" ]; then
@@ -56,9 +59,6 @@ export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
5659
# The cache dir.
5760
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
5861
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
59-
# The depends dir.
60-
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
61-
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
6262
# Folder where the build result is put (bin and lib).
6363
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
6464
# Folder where the build is done (dist and out-of-tree build).

ci/test/00_setup_env_android.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66

77
export LC_ALL=C.UTF-8
88

9-
export CONTAINER_NAME=ci_android
9+
export HOST=aarch64-linux-android
1010
export PACKAGES="clang llvm unzip openjdk-8-jdk gradle"
11+
export CONTAINER_NAME=ci_android
12+
export DOCKER_NAME_TAG="ubuntu:focal"
13+
14+
export RUN_UNIT_TESTS=false
15+
export RUN_FUNCTIONAL_TESTS=false
1116

1217
export ANDROID_API_LEVEL=28
1318
export ANDROID_BUILD_TOOLS_VERSION=28.0.3
1419
export ANDROID_NDK_VERSION=21.1.6352462
1520
export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
21+
export ANDROID_HOME="${DEPENDS_DIR}/SDKs/android"
22+
export ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}"
23+
export DEP_OPTS="ANDROID_SDK=${ANDROID_HOME} ANDROID_NDK=${ANDROID_NDK_HOME} ANDROID_API_LEVEL=${ANDROID_API_LEVEL} ANDROID_TOOLCHAIN_BIN=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/"
1624

17-
export BITCOIN_CONFIG="--disable-ccache"
25+
export BITCOIN_CONFIG="--disable-ccache"

ci/test/05_before_script.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ fi
2424

2525
if [ -n "$ANDROID_TOOLS_URL" ]; then
2626
ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip
27-
ANDROID_HOME="$DEPENDS_DIR"/SDKs/android
28-
ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}
2927

3028
DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
3129
DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools"
3230
DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools"
3331
DOCKER_EXEC "yes | ${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager --install \"build-tools;${ANDROID_BUILD_TOOLS_VERSION}\" \"platform-tools\" \"platforms;android-${ANDROID_API_LEVEL}\" \"ndk;${ANDROID_NDK_VERSION}\""
34-
35-
MAKE_COMMAND="ANDROID_SDK=${ANDROID_HOME} ANDROID_NDK=${ANDROID_NDK_HOME} make $MAKEJOBS -C depends HOST=aarch64-linux-android ANDROID_API_LEVEL=${ANDROID_API_LEVEL} ANDROID_TOOLCHAIN_BIN=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin/ $DEP_OPTS"
36-
DOCKER_EXEC "$MAKE_COMMAND" HOST=aarch64-linux-android
3732
fi
3833

3934
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then

0 commit comments

Comments
 (0)