cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support on Apple Silicon

alexbleotu opened this issue · comments

I tried to install the carg-instrumensts package both via brew and directly via cargo on an Apple M1 with a Silicon cpu.

First, the brew installation gave a red herring error

failed to parse manifest at `/path/to/Cargo.toml`

which seemed very odd when looking at the source code and seeing it uses functions from the cargo crate, so I tried importing the manifest file myself with the same calls and it worked fine

Second, the installation via cargo

cargo install cargo-instruments

failed with an architecture error

 ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Tried switching to the x86 rust toolchain which will compile the binary and attempt to run it through Rosetta (I am using nightly)

$ rustup default nightly-x86_64-apple-darwin

Compilation was fine, but profiling doesn't work

  Profiling target/release/simulator with template 'Time Profiler'
      Failed instruments errored: Run issues were detected (trace is still ready to be viewed):
* [Error] Failed to start the recording: ktrace cannot trace the system under Rosetta translation

* [Error] Unexpected failure: Data source agent failed to arm.

* [Error] Unexpected failure: Couriers have returned unexpectedly.