From 6e6c6d07b78273abf473fb2e06ac5bde1795dede Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 17 May 2022 13:10:42 +0200 Subject: [PATCH 1/6] ci, refactor: Add `MACOS_NATIVE_TASK_TEMPLATE` A native macOS task does not aware of Linux container settings, and it does not use the `depends_built_cache`. Github-Pull: #25444 Rebased-From: 8e017f32889e9536a436f40c91f34f24bfd10525 --- .cirrus.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6037f8b1ea..5caf27b87c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -35,22 +35,30 @@ base_template: &BASE_TEMPLATE main_template: &MAIN_TEMPLATE timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out + ccache_cache: + folder: "/tmp/ccache_dir" + ci_script: + - ./ci/test_run_all.sh + +global_task_template: &GLOBAL_TASK_TEMPLATE + << : *BASE_TEMPLATE container: # https://cirrus-ci.org/faq/#are-there-any-limits # Each project has 16 CPU in total, assign 2 to each container, so that 8 tasks run in parallel cpu: 2 greedy: true memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers - ccache_cache: - folder: "/tmp/ccache_dir" depends_built_cache: folder: "depends/built" fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-list -1 HEAD ./depends) - ci_script: - - ./ci/test_run_all.sh + << : *MAIN_TEMPLATE -global_task_template: &GLOBAL_TASK_TEMPLATE +macos_native_task_template: &MACOS_NATIVE_TASK_TEMPLATE << : *BASE_TEMPLATE + check_clang_script: + - clang --version + brew_install_script: + - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt << : *MAIN_TEMPLATE compute_credits_template: &CREDITS_TEMPLATE @@ -288,12 +296,10 @@ task: task: name: 'macOS 12 native [gui, system sqlite only] [no depends]' - brew_install_script: - - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt - << : *GLOBAL_TASK_TEMPLATE macos_instance: # Use latest image, but hardcode version to avoid silent upgrades (and breaks) - image: monterey-xcode-13.2 # https://cirrus-ci.org/guide/macOS + image: monterey-xcode-13.3 # https://cirrus-ci.org/guide/macOS + << : *MACOS_NATIVE_TASK_TEMPLATE env: << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV CI_USE_APT_INSTALL: "no" From d789538aab71c310235692934983426e1326cb85 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 17 May 2022 20:57:55 +0200 Subject: [PATCH 2/6] ci: Improve naming related to "macOS 12 native x86_64" task Github-Pull: #25444 Rebased-From: 0bb7a1f71db1d986ab824d114534fb7671024990 --- .cirrus.yml | 4 ++-- ...etup_env_mac_host.sh => 00_setup_env_mac_native_x86_64.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ci/test/{00_setup_env_mac_host.sh => 00_setup_env_mac_native_x86_64.sh} (100%) diff --git a/.cirrus.yml b/.cirrus.yml index 5caf27b87c..fabcc60f13 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -295,7 +295,7 @@ task: FILE_ENV: "./ci/test/00_setup_env_mac.sh" task: - name: 'macOS 12 native [gui, system sqlite only] [no depends]' + name: 'macOS 12 native x86_64 [gui, system sqlite] [no depends]' macos_instance: # Use latest image, but hardcode version to avoid silent upgrades (and breaks) image: monterey-xcode-13.3 # https://cirrus-ci.org/guide/macOS @@ -304,7 +304,7 @@ task: << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV CI_USE_APT_INSTALL: "no" PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do - FILE_ENV: "./ci/test/00_setup_env_mac_host.sh" + FILE_ENV: "./ci/test/00_setup_env_mac_native_x86_64.sh" task: name: 'ARM64 Android APK [focal]' diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_native_x86_64.sh similarity index 100% rename from ci/test/00_setup_env_mac_host.sh rename to ci/test/00_setup_env_mac_native_x86_64.sh From 93218750de7c36125e7245918aeded4d53458077 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 25 Oct 2022 09:48:35 +0100 Subject: [PATCH 3/6] ci: Make `getopt` path architecture agnostic Github-Pull: #26388 Rebased-From: 702836530ffa351e863b1b1300fd2e559a14ef23 --- ci/test/04_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 99cf68576c..1e8ec18840 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -13,7 +13,7 @@ fi if [ "$CI_OS_NAME" == "macos" ]; then sudo -H pip3 install --upgrade pip # shellcheck disable=SC2086 - IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES + IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES fi # Create folders that are mounted into the docker From cde308e66756f502088e0cf8eaa568a8181bba85 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 25 Oct 2022 09:49:16 +0100 Subject: [PATCH 4/6] ci: Use `macos-ventura-xcode:14.1` image for "macOS native" task Github-Pull: #26388 Rebased-From: da168934741b776bce07d5503ca2344d300723b3 --- .cirrus.yml | 6 +++--- ...c_native_x86_64.sh => 00_setup_env_mac_native_arm64.sh} | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) rename ci/test/{00_setup_env_mac_native_x86_64.sh => 00_setup_env_mac_native_arm64.sh} (69%) diff --git a/.cirrus.yml b/.cirrus.yml index fabcc60f13..68de872185 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -295,16 +295,16 @@ task: FILE_ENV: "./ci/test/00_setup_env_mac.sh" task: - name: 'macOS 12 native x86_64 [gui, system sqlite] [no depends]' + name: 'macOS 13 native arm64 [gui, sqlite only] [no depends]' macos_instance: # Use latest image, but hardcode version to avoid silent upgrades (and breaks) - image: monterey-xcode-13.3 # https://cirrus-ci.org/guide/macOS + image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1 # https://cirrus-ci.org/guide/macOS << : *MACOS_NATIVE_TASK_TEMPLATE env: << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV CI_USE_APT_INSTALL: "no" PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do - FILE_ENV: "./ci/test/00_setup_env_mac_native_x86_64.sh" + FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh" task: name: 'ARM64 Android APK [focal]' diff --git a/ci/test/00_setup_env_mac_native_x86_64.sh b/ci/test/00_setup_env_mac_native_arm64.sh similarity index 69% rename from ci/test/00_setup_env_mac_native_x86_64.sh rename to ci/test/00_setup_env_mac_native_arm64.sh index 012ab011a6..1a7be56d5b 100755 --- a/ci/test/00_setup_env_mac_native_x86_64.sh +++ b/ci/test/00_setup_env_mac_native_arm64.sh @@ -6,13 +6,12 @@ export LC_ALL=C.UTF-8 -export HOST=x86_64-apple-darwin -export PIP_PACKAGES="zmq lief" +export HOST=arm64-apple-darwin +export PIP_PACKAGES="zmq" export GOAL="install" # ELEMENTS: add -fno-stack-check to work around clang bug on macos -export BITCOIN_CONFIG="--with-gui --enable-reduce-exports CXXFLAGS=-fno-stack-check" +export BITCOIN_CONFIG="--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports CXXFLAGS=-fno-stack-check" export CI_OS_NAME="macos" export NO_DEPENDS=1 export OSX_SDK="" export CCACHE_SIZE=300M -export RUN_SECURITY_TESTS="true" From a121cf0e637eb88d6da29d50b9ef1b92d8e24e26 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Mon, 27 Jan 2025 11:54:40 -0800 Subject: [PATCH 5/6] Manually pick acc06bc91f80ddf4e015dcdf0b984bbdbfcb5ca3 from bitcoin --- ci/test/00_setup_env_mac_native_arm64.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_mac_native_arm64.sh b/ci/test/00_setup_env_mac_native_arm64.sh index 1a7be56d5b..ade2d2787c 100755 --- a/ci/test/00_setup_env_mac_native_arm64.sh +++ b/ci/test/00_setup_env_mac_native_arm64.sh @@ -7,7 +7,9 @@ export LC_ALL=C.UTF-8 export HOST=arm64-apple-darwin -export PIP_PACKAGES="zmq" +# Homebrew's python@3.12 is marked as externally managed (PEP 668). +# Therefore, `--break-system-packages` is needed. +export PIP_PACKAGES="--break-system-packages zmq" export GOAL="install" # ELEMENTS: add -fno-stack-check to work around clang bug on macos export BITCOIN_CONFIG="--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports CXXFLAGS=-fno-stack-check" From 49f151f0133790fcd2bd2261e881d43b7b30fb35 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Sat, 8 Feb 2025 07:05:42 -0800 Subject: [PATCH 6/6] Apply acc06bc91f80ddf4e015dcdf0b984bbdbfcb5ca3 fix also to pip upgrade --- ci/test/04_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 1e8ec18840..a555d94c18 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -11,7 +11,7 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then fi if [ "$CI_OS_NAME" == "macos" ]; then - sudo -H pip3 install --upgrade pip + sudo -H pip3 install --upgrade --break-system-packages pip # shellcheck disable=SC2086 IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES fi