alvr-org / alvr-visionos

Experimental visionOS client for ALVR - SteamVR on Apple Vision Pro!
MIT License
416 stars 28 forks source link

Failed to build: "failed to run custom build command for `coreaudio-sys v0.2.15`" #13

Closed Nocxr closed 7 months ago

Nocxr commented 7 months ago

Just cloned the repo and tried running the script, it starts compiling everything fine until it hits this:

error: failed to run custom build command for `coreaudio-sys v0.2.15`

Caused by:
  process didn't exit successfully: `/Users/marshall/projects/git/alvr-visionos/ALVR/target/debug/build/coreaudio-sys-aeb840a3b2a09ac8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=COREAUDIO_SDK_PATH
  cargo:rustc-link-lib=framework=AudioToolbox
  cargo:rustc-link-lib=framework=AudioToolbox
  cargo:rustc-link-lib=framework=CoreAudio
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  /Users/marshall/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coreaudio-sys-0.2.15/coreaudio.h:1:10: fatal error: 'AudioUnit/AudioUnit.h' file not found
  /Users/marshall/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coreaudio-sys-0.2.15/coreaudio.h:1:10: note: did not find header 'AudioUnit.h' in framework 'AudioUnit' (loaded from '/System/Library/Frameworks')
  thread 'main' panicked at /Users/marshall/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coreaudio-sys-0.2.15/build.rs:162:39:
  unable to generate bindings: ClangDiagnostic("/Users/marshall/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coreaudio-sys-0.2.15/coreaudio.h:1:10: fatal error: 'AudioUnit/AudioUnit.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm using a new Macbook Pro M3 Sonoma 14.3, please let me know if there is anything else I can provide that might help, thanks!

shinyquagsire23 commented 7 months ago

make sure you have the iPhoneOS SDK installed, Rust currently doesn't have a visionOS target (and libraries don't have support for it) so it's using iOS headers for dependencies in the interim

SwaMusic commented 7 months ago

Also experiencing the same and have all the SDKs for each OS installed as well.

zhuowei commented 7 months ago

I can reproduce it on my machine if the currently active Xcode is set to the Command Line Tools instead of the actual Xcode.app.

Can you please run xcode-select -p?

If it shows /Library/Developer/CommandLineTools, then your Xcode install isn't set to the active install, and Rust is trying to build with the macOS-only command line tools instead.

(This often happens with Xcode Beta, unfortunately, since it's named "Xcode-beta.app" by default.)

There's two ways to fix this:

SwaMusic commented 7 months ago

I can reproduce it on my machine if the currently active Xcode is set to the Command Line Tools instead of the actual Xcode.app.

Can you please run xcode-select -p?

If it shows /Library/Developer/CommandLineTools, then your Xcode install isn't set to the active install, and Rust is trying to build with the macOS-only command line tools instead.

(This often happens with Xcode Beta, unfortunately, since it's named "Xcode-beta.app" by default.)

There's two ways to fix this:

  • Hard way: sudo xcode-select -s /Path/To/Xcode.app
  • Easy way: just move your Xcode to /Applications/Xcode.app

My XCode was already in /Applications/Xcode.app, just pointed the command line tools there instead. It all worked but I am still receiving.

Showing Recent Issues
There is no XCFramework found at '/Users/swamini/alvr-visionos/ALVRClientCore.xcframework'.
zhuowei commented 7 months ago

Run

Product -> Clean Build Folder.

I was able to reproduce your issue by trying to build without a ALVRClientCore.xcframework; I then get the same error that you got even after I put the xcframework back. Doing a Clean Build Folder then building again worked.

Nocxr commented 7 months ago

I can reproduce it on my machine if the currently active Xcode is set to the Command Line Tools instead of the actual Xcode.app.

Can you please run xcode-select -p?

If it shows /Library/Developer/CommandLineTools, then your Xcode install isn't set to the active install, and Rust is trying to build with the macOS-only command line tools instead.

(This often happens with Xcode Beta, unfortunately, since it's named "Xcode-beta.app" by default.)

There's two ways to fix this:

  • Hard way: sudo xcode-select -s /Path/To/Xcode.app
  • Easy way: just move your Xcode to /Applications/Xcode.app

I did have all the sdks installed, but you were correct that it was set to CommandLineTools, I used the sudo command and it worked right away, thank you very much!

SwaMusic commented 7 months ago

Run

Product -> Clean Build Folder.

I was able to reproduce your issue by trying to build without a ALVRClientCore.xcframework; I then get the same error that you got even after I put the xcframework back. Doing a Clean Build Folder then building again worked.

That worked and was able to get it connected but not it just keeps connecting-disconnecting-connecting-disconnecting on loop. I see the SteamVR overlay and it's tracking and all but just keeps going through that loop every 1-2 seconds consistently.