mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 18:41:02 +02:00
Merge #21541: ci: Build depends only once for Android build
fa52d7d3ad
cirrus: Add missing depends_sources_cache to Android task (MarcoFalke)ffff4e7373
cirrus: Only cache releases when needed (MarcoFalke)fa97a17ac3
ci: Bump Android cross-build to Ubuntu Focal (MarcoFalke)fac577d423
ci: Build depends only once for Android build (MarcoFalke)fa908a41f3
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 ACKfa52d7d3ad
. 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: ACKfa52d7d3ad
, I have reviewed the code and it looks OK, I agree it can be merged after passing CI. Tree-SHA512: ae7c68e357068176a0e58285b83521353321c65862cee4ff56f413c51b00398062f0ee6775bfbbf28fda420cf5a24000a2286fbcf6cc7f3729b7805bc8419726
This commit is contained in:
10
.cirrus.yml
10
.cirrus.yml
@@ -35,8 +35,6 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
|
|||||||
folder: "/tmp/cirrus-ci-build/depends/built"
|
folder: "/tmp/cirrus-ci-build/depends/built"
|
||||||
depends_sdk_cache:
|
depends_sdk_cache:
|
||||||
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
|
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
|
||||||
depends_releases_cache:
|
|
||||||
folder: "/tmp/cirrus-ci-build/releases"
|
|
||||||
ci_script:
|
ci_script:
|
||||||
- ./ci/test_run_all.sh
|
- ./ci/test_run_all.sh
|
||||||
|
|
||||||
@@ -103,6 +101,8 @@ task:
|
|||||||
# For faster CI feedback, immediately schedule a task that compiles most modules
|
# For faster CI feedback, immediately schedule a task that compiles most modules
|
||||||
<< : *CREDITS_TEMPLATE
|
<< : *CREDITS_TEMPLATE
|
||||||
<< : *GLOBAL_TASK_TEMPLATE
|
<< : *GLOBAL_TASK_TEMPLATE
|
||||||
|
depends_releases_cache:
|
||||||
|
folder: "/tmp/cirrus-ci-build/releases"
|
||||||
container:
|
container:
|
||||||
image: ubuntu:bionic
|
image: ubuntu:bionic
|
||||||
env:
|
env:
|
||||||
@@ -182,9 +182,11 @@ task:
|
|||||||
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
|
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
|
||||||
|
|
||||||
task:
|
task:
|
||||||
name: 'ARM64 Android APK [bionic]'
|
name: 'ARM64 Android APK [focal]'
|
||||||
|
depends_sources_cache:
|
||||||
|
folder: "/tmp/cirrus-ci-build/depends/sources"
|
||||||
<< : *GLOBAL_TASK_TEMPLATE
|
<< : *GLOBAL_TASK_TEMPLATE
|
||||||
container:
|
container:
|
||||||
image: ubuntu:bionic
|
image: ubuntu:focal
|
||||||
env:
|
env:
|
||||||
FILE_ENV: "./ci/test/00_setup_env_android.sh"
|
FILE_ENV: "./ci/test/00_setup_env_android.sh"
|
||||||
|
@@ -11,6 +11,9 @@ export LC_ALL=C.UTF-8
|
|||||||
# This is where the depends build is done.
|
# This is where the depends build is done.
|
||||||
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
|
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
|
||||||
export BASE_ROOT_DIR
|
export BASE_ROOT_DIR
|
||||||
|
# The depends dir.
|
||||||
|
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
||||||
|
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
|
||||||
|
|
||||||
echo "Setting specific values in env"
|
echo "Setting specific values in env"
|
||||||
if [ -n "${FILE_ENV}" ]; then
|
if [ -n "${FILE_ENV}" ]; then
|
||||||
@@ -56,9 +59,6 @@ export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
|
|||||||
# The cache dir.
|
# The cache dir.
|
||||||
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
||||||
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
|
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
|
||||||
# The depends dir.
|
|
||||||
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
|
||||||
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
|
|
||||||
# Folder where the build result is put (bin and lib).
|
# Folder where the build result is put (bin and lib).
|
||||||
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
|
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
|
||||||
# Folder where the build is done (dist and out-of-tree build).
|
# Folder where the build is done (dist and out-of-tree build).
|
||||||
|
@@ -6,12 +6,20 @@
|
|||||||
|
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
export CONTAINER_NAME=ci_android
|
export HOST=aarch64-linux-android
|
||||||
export PACKAGES="clang llvm unzip openjdk-8-jdk gradle"
|
export PACKAGES="clang llvm unzip openjdk-8-jdk gradle"
|
||||||
|
export CONTAINER_NAME=ci_android
|
||||||
|
export DOCKER_NAME_TAG="ubuntu:focal"
|
||||||
|
|
||||||
|
export RUN_UNIT_TESTS=false
|
||||||
|
export RUN_FUNCTIONAL_TESTS=false
|
||||||
|
|
||||||
export ANDROID_API_LEVEL=28
|
export ANDROID_API_LEVEL=28
|
||||||
export ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
export ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||||
export ANDROID_NDK_VERSION=21.1.6352462
|
export ANDROID_NDK_VERSION=21.1.6352462
|
||||||
export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
|
export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
|
||||||
|
export ANDROID_HOME="${DEPENDS_DIR}/SDKs/android"
|
||||||
|
export ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}"
|
||||||
|
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/"
|
||||||
|
|
||||||
export BITCOIN_CONFIG="--disable-ccache"
|
export BITCOIN_CONFIG="--disable-ccache"
|
||||||
|
@@ -24,16 +24,11 @@ fi
|
|||||||
|
|
||||||
if [ -n "$ANDROID_TOOLS_URL" ]; then
|
if [ -n "$ANDROID_TOOLS_URL" ]; then
|
||||||
ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip
|
ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip
|
||||||
ANDROID_HOME="$DEPENDS_DIR"/SDKs/android
|
|
||||||
ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}
|
|
||||||
|
|
||||||
DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
|
DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
|
||||||
DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools"
|
DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools"
|
||||||
DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools"
|
DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools"
|
||||||
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}\""
|
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}\""
|
||||||
|
|
||||||
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"
|
|
||||||
DOCKER_EXEC "$MAKE_COMMAND" HOST=aarch64-linux-android
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
||||||
|
Reference in New Issue
Block a user