Skip to content

Commit

Permalink
Bundle arm64 binary into the universal binary for MacOS. (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha authored Sep 22, 2022
1 parent 4ccf1b8 commit 8b56f27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/arch_dylib_sign.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"source": [
"target/aarch64-apple-darwin/release/libmirrord_layer.dylib",
"target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib",
"target/x86_64-apple-darwin/release/libmirrord_layer.dylib"
],
"bundle_id": "com.metalbear.mirrord",
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ jobs:
# >> magic bits: 0000000 facf feed 000c 0100 0002 0000 0006 0000
# >> target/debug/libmirrord_layer.dylib: Mach-O 64-bit dynamically linked shared library arm64e
run: |
cargo +nightly build --release -p mirrord-layer --target=aarch64-apple-darwin
printf '\x02' | dd of=target/aarch64-apple-darwin/release/libmirrord_layer.dylib bs=1 seek=8 count=1 conv=notrunc
cargo +nightly build --release -p mirrord-layer --target=aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib
printf '\x02' | dd of=target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib bs=1 seek=8 count=1 conv=notrunc
- name: Sign layer binaries
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER }}
Expand All @@ -73,7 +74,7 @@ jobs:
- name: create universal target dir
run: mkdir -p /tmp/target/universal-apple-darwin/release
- name: create universal dylib
run: lipo -create -output /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer.dylib target/x86_64-apple-darwin/release/libmirrord_layer.dylib
run: lipo -create -output /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer.dylib target/x86_64-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib
- name: Sign layer universal
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

### Changed
- Ignore http tests because they are unstable, and they block the CI.
- Bundle arm64 binary into the universal binary for MacOS.

## 3.0.8-alpha

Expand Down

0 comments on commit 8b56f27

Please sign in to comment.