Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix macos native build #1412

Merged
merged 6 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -287,18 +295,16 @@ task:
FILE_ENV: "./ci/test/00_setup_env_mac.sh"

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
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.2 # 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_host.sh"
FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh"

task:
name: 'ARM64 Android APK [focal]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

export LC_ALL=C.UTF-8

export HOST=x86_64-apple-darwin
export PIP_PACKAGES="zmq lief"
export HOST=arm64-apple-darwin
# Homebrew's [email protected] 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 --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"
4 changes: 2 additions & 2 deletions ci/test/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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="/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
Expand Down