cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files
MIT License
672 stars 34 forks source link

Fails to link libstd on macOS #74

Open 5nefarious opened 2 years ago

5nefarious commented 2 years ago

I'm working on a project using Bevy on macOS. Attempting to run cargo instruments produces the following result:

% cargo instruments -t "Game Performance"               
    Finished dev [optimized + debuginfo] target(s) in 0.80s
   Profiling target/debug/render-test with template 'Game Performance'
dyld[4563]: Library not loaded: '@rpath/libstd-997c4eb22009d353.dylib'
  Referenced from: '/Users/REDACTED/render-test/target/debug/render-test'

  Reason: tried: '/usr/local/lib/libstd-997c4eb22009d353.dylib' (no such file), '/usr/lib/libstd-997c4eb22009d353.dylib' (no such file)
  Trace file target/instruments/render-test_Game-Performance_2022-09-24_211925-582.trace

When running the executable directly, I get the same error unless I pass DYLD_FALLBACK_LIBRARY_PATH=$HOME/.rustup/toolchains/stable-x86_64-apple-darwin/lib. However, this does not seem to fix the issue with cargo instruments.

cmyr commented 1 year ago

huh, I'm really not sure what's going on here. Do other instruments work? When you say "running the executable directly", do you mean your executable, or do you mean the instruments executable?