mpy-cross: Build an arm64 (M1) bin and a universal bin

This commit is contained in:
Jeff Epler 2021-05-30 11:59:57 -05:00
parent b0dd0e344c
commit ed977e9f25
2 changed files with 27 additions and 0 deletions

View File

@ -154,8 +154,24 @@ jobs:
with: with:
name: mpy-cross-macos-catalina name: mpy-cross-macos-catalina
path: mpy-cross/mpy-cross path: mpy-cross/mpy-cross
- name: Select SDK for M1 build
run: sudo xcode-select -switch /Applications/Xcode_12.3.app
- name: Build mpy-cross (arm64)
run: make -C mpy-cross -j2 -f Makefile.m1 V=2
- uses: actions/upload-artifact@v2
with:
name: mpy-cross-macos-bigsur-arm64
path: mpy-cross/mpy-cross-arm64
- name: Make universal binary
run: lipo -create -output mpy-cross-macos-universal mpy-cross/mpy-cross mpy-cross/mpy-cross-arm64
- uses: actions/upload-artifact@v2
with:
name: mpy-cross-macos-universal
path: mpy-cross-macos-universal
- name: Upload mpy-cross build to S3 - name: Upload mpy-cross build to S3
run: | run: |
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross-macos-universal s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-universal-${{ env.CP_VERSION }} --no-progress --region us-east-1
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross-arm64 s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-bigsur-${{ env.CP_VERSION }}-arm64 --no-progress --region us-east-1
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1
env: env:
AWS_PAGER: '' AWS_PAGER: ''

11
mpy-cross/Makefile.m1 Normal file
View File

@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT
PROG=mpy-cross-arm64
BUILD=build-arm64
include mpy-cross.mk
# Because mpy-cross.mk unconditionally overwrites CC for Darwin, we must set it BELOW the inclusion
CC := $(shell xcrun --sdk macosx11.1 --find clang) -isysroot $(shell xcrun --sdk macosx11.1 --show-sdk-path) -target arm64-apple-macos11 -DMICROPY_NLR_SETJMP=1
$(info pt2 CC=$(CC))