Skip to content

Commit

Permalink
Fix mac arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Dec 9, 2024
1 parent 385c25e commit d3495bd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,25 @@ jobs:
# It is not documented in Github that openssl 3 is installed in their macos images
# so we install it here to be safe
- if: ${{ startsWith(inputs.platform-tag, 'macosx') }}
name: Ensure openssl 3 is installed on Github macOS runners.
run: brew install openssl@3
name: Ensure openssl is installed on Github macOS runners.
run: brew install openssl@${{ env.MACOS_OPENSSL_VERSION }}

- if: ${{ inputs.platform-tag == 'macosx_arm64' }}
name: Ensure that linker can find openssl
run: echo LIBRARY_PATH=$(brew --prefix openssl@${{ env.MACOS_OPENSSL_VERSION }}):$LIBRARY_PATH >> $GITHUB_ENV

- name: Build wheel
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ENVIRONMENT_PASS_LINUX: ${{ inputs.unoptimized && 'UNOPTIMIZED' || '' }}
# We use delocate to repair the wheel because it throws an error if
# - We use delocate to repair the wheel because it throws an error if
# the openssl library version is newer than the wheel's macOS version tag
# Linking the static libraries produces a warning for that same reason that but it doesn't throw an error.
# macOS wheel is only backwards compatible with the macOS major version it is built from
# Use single dash for backwards compatibility with older sw_vers
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d"." -f 1).0
# - Use single dash for backwards compatibility with older sw_vers
# - on mac m1, openssl@3 installed via brew is not in the linker's default library path
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d"." -f 1).0
CIBW_BUILD: ${{ env.BUILD_IDENTIFIER }}
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: >
Expand Down

0 comments on commit d3495bd

Please sign in to comment.