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

Add macOS arm64 wheels build and tests to .cirrus.yml #7292

Merged
merged 14 commits into from
Feb 11, 2023
73 changes: 73 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,76 @@ task:
cd test
b2 -l250 warnings-as-errors=on warnings=all crypto=openssl stage_enum_if stage_dependencies include=/usr/local/include library-path=/usr/local/lib
LD_LIBRARY_PATH=./dependencies ./enum_if

build_and_store_wheels: &BUILD_AND_STORE_WHEELS
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
delocate-listdeps {wheel} &&
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}

install_cibuildwheel_script:
- $PYTHON -m pip install cibuildwheel==2.12.0

run_cibuildwheel_script:
- cibuildwheel

wheels_artifacts:
path: "wheelhouse/*"

build_macos_arm64_task:
name: Build macOS arm64 wheels.
trigger_type: manual
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is why these workflows don't run. did you mean to make these manual/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it manual based on this comment:
#7131 (comment)

The trigger_type seems to only support manual. There are also options to restrict it to monitor certain organizations, repositories, branches, etc. I haven't found an option that runs a task specifically on pull requests.

I want to be sure the setting doesn't end up triggering too many runs per day... wouldn't want to be the one that ruins the free M1 runner pool.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you just remove the trigger type field, and have it behave like the other cirrus jobs, I believe it would only run on pushes.
if it doesn't run on every PR, it's likely to break at some point without anyone noticing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode

env:
CIRRUS_CLONE_SUBMODULES: true
CIBW_SKIP: pp* cp38-* # cp38-* has problem with x86_64 / arm64 confusion
CIBW_BUILD: cp39-* cp310-* # cp311-* can be added after boost-python version >= 1.81
CIBW_ARCH: arm64
PATH: /opt/homebrew/bin:$PATH
PYTHON: python3.9

install_pre_requirements_script:
- brew install python@3.9

debug_script:
- echo $PATH
- ls -l /opt/homebrew/bin
- find /opt/homebrew -name '*openssl*' -ls

<<: *BUILD_AND_STORE_WHEELS

test_macos_arm64_task:
name: Test macOS arm64.
trigger_type: manual

macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode

env:
CIRRUS_CLONE_SUBMODULES: true
PATH: /opt/homebrew/bin:$PATH
PYTHON: python3.9

install_pre_requirements_script:
- brew install python@3.9
- brew install boost-build boost openssl@1.1
- echo "using darwin ;" >>~/user-config.jam

debug_script:
- echo $PATH
- ls -l /opt/homebrew/bin
- find /opt/homebrew -name '*openssl*' -ls

test_script:
- cd test
- b2 crypto=built-in -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests
moodyjon marked this conversation as resolved.
Show resolved Hide resolved
- b2 deprecated-functions=off -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests

test_flaky_script:
- cd test
- b2 crypto=built-in -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on
- b2 deprecated-functions=off -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on
4 changes: 2 additions & 2 deletions Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ rule openssl-lib-path ( properties * )
# on macOS, default to pick up openssl from the homebrew installation
# brew install openssl
# homebrew on M1 Macs install to /opt/homebrew
OPENSSL_LIB = /opt/homebrew/opt/openssl/lib /usr/local/opt/openssl/lib ;
OPENSSL_LIB = /opt/homebrew/opt/openssl@1.1/lib /opt/homebrew/opt/openssl/lib /usr/local/opt/openssl/lib ;
moodyjon marked this conversation as resolved.
Show resolved Hide resolved
}
else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = ""
{
Expand All @@ -423,7 +423,7 @@ rule openssl-include-path ( properties * )
# on macOS, default to pick up openssl from the homebrew installation
# brew install openssl
# homebrew on M1 Macs install to /opt/homebrew
OPENSSL_INCLUDE = /opt/homebrew/opt/openssl/include /usr/local/opt/openssl/include ;
OPENSSL_INCLUDE = /opt/homebrew/opt/openssl@1.1/include /opt/homebrew/opt/openssl/include /usr/local/opt/openssl/include ;
moodyjon marked this conversation as resolved.
Show resolved Hide resolved
}
else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = ""
{
Expand Down