Skip to content
New issue

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

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

Already on GitHub? # to your account

Initial stuff for aarch64 ios simulator support #151

Merged
merged 2 commits into from
Mar 21, 2022

Conversation

simlay
Copy link
Contributor

@simlay simlay commented Mar 21, 2022

Closes #147.

I don't think we can test this in CI. I've tested it on my m1 and it works as expected.

This change results in cargo dinghy all-devices shows:

$ cargo dinghy all-devices
List of available devices for all platforms:
Host: [host]
IosSimDevice { "id": "09EA58D0-0385-4151-AEFB-EBD5D40BA04B", "name": iPhone 8, "os": com.apple.CoreSimulator.SimRuntime.iOS-15-4 }: [auto-ios-aarch64-sim, auto-ios-x86_64]
IosSimDevice { "id": "DF2E630F-5872-4718-9F1C-B20C188013F5", "name": iPhone 8 Plus, "os": com.apple.CoreSimulator.SimRuntime.iOS-15-4 }: [auto-ios-aarch64-sim, auto-ios-x86_64]

Though, on non-m1 apple products it will still display auto-ios-aarch64-sim and if ran, I assume it would fail with a weird error but I've not tested that. Should I make non aarch64 devices not list the auto-ios-aarch64-sim?

As a note why this is useful I tested this with hyperfine in the test-ws CI (that's pre-compiled):

$ hyperfine '../target/debug/cargo-dinghy --platform auto-ios-aarch64-sim test pass'
Benchmark 1: ../target/debug/cargo-dinghy --platform auto-ios-aarch64-sim test pass
  Time (mean ± σ):      2.238 s ±  0.034 s    [User: 0.324 s, System: 0.190 s]
  Range (min … max):    2.209 s …  2.333 s    10 runs

$ hyperfine '../target/debug/cargo-dinghy --platform auto-ios-x86_64 test pass'
Benchmark 1: ../target/debug/cargo-dinghy --platform auto-ios-x86_64 test pass
  Time (mean ± σ):      4.030 s ±  0.197 s    [User: 1.279 s, System: 0.667 s]
  Range (min … max):    3.858 s …  4.542 s    10 runs

In this case, I think this ~2 second difference might be due to macOS or the iOS simulator starting Rosetta 2 to run the x86 program but being able to test and benchmark on the architecture a program is running is important.

@kali
Copy link
Collaborator

kali commented Mar 21, 2022

Thanks for the PRs, happy to see other people finding this terrible hack useful :)

@kali kali merged commit 99263c6 into sonos:main Mar 21, 2022
@simlay simlay deleted the add-aarch64-apple-ios-sim-support branch March 21, 2022 14:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for aarch64-apple-ios-sim in dinghy
2 participants