RustAudio / coreaudio-sys

Raw bindings to the OSX CoreAudio framework generated by bindgen (see coreaudio-rs for a more rust-esque wrapper).
MIT License
69 stars 38 forks source link

Build fails on M1 Mac with Sonoma 14.4.1 and Homebrew #96

Open mchitre opened 7 months ago

mchitre commented 7 months ago

Was working previously, something in a recent upgrade seems to have broken it.

Possibly related to #85, but not the same.

Build chain info:

» clang --version
Homebrew clang version 15.0.7
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm@15/bin

Error message:

» cargo b
   Compiling coreaudio-sys v0.2.13
error: failed to run custom build command for `coreaudio-sys v0.2.13`

Caused by:
  process didn't exit successfully: `/Users/mandar/Projects/unet/unet-grogu/src/main/rust/grogud/target/debug/build/coreaudio-sys-4de2ae8acebe8098/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=COREAUDIO_SDK_PATH
  cargo:rustc-link-lib=framework=AudioUnit
  cargo:rustc-link-lib=framework=AudioToolbox
  cargo:rustc-link-lib=framework=CoreAudio
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1633:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1664:16: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1677:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1695:7: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1711:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1729:7: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1742:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1760:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1787:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1802:16: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1813:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1828:21: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2072:8: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2089:24: error: unknown type name 'ItemCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2600:6: error: unknown type name 'ByteCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2603:6: error: unknown type name 'ByteCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2684:6: error: unknown type name 'ByteCount'
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2687:6: error: unknown type name 'ByteCount'
  thread 'main' panicked at /Users/mandar/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coreaudio-sys-0.2.13/build.rs:150:39:
  unable to generate bindings: ClangDiagnostic("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1633:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1664:16: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1677:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1695:7: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1711:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1729:7: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1742:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1760:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1787:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1802:16: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1813:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1828:21: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2072:8: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2089:24: error: unknown type name 'ItemCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2600:6: error: unknown type name 'ByteCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2603:6: error: unknown type name 'ByteCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2684:6: error: unknown type name 'ByteCount'\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:2687:6: error: unknown type name 'ByteCount'\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
mchitre commented 7 months ago

Uninstalling homebrew llvm@15 works

simlay commented 7 months ago

Thanks for the report!

Looking at the versions of your setup, I'm not sure why this happened. The bindgen dependebot change to fix #85 was published in coreaudio-sys 0.2.13 (what you have).

I assume that uninstalling llvm@15 results in using clang shipped with xcode which for me (macos 14.4.1, xcode 15.3) is clang 15.

mchitre commented 7 months ago

Yes, clang with xcode works. Homebrew version doesn't.