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 error on Monterey #74

Closed br0kenpixel closed 1 year ago

br0kenpixel commented 1 year ago

I have an empty project with the following Cargo.toml:

[package]
name = "coreaudio_test"
version = "0.1.0"
edition = "2021"

[dependencies]
coreaudio-sys = "0.2.11"

Running cargo build fails with the following error:

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

Caused by:
  process didn't exit successfully: `/Users/fabianvarga/Documents/C Projects/Rust/coreaudio_test/target/debug/build/coreaudio-sys-289c5ff5170c0e1b/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:rustc-link-lib=framework=OpenAL
  cargo:rustc-link-lib=framework=CoreMIDI
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  thread 'main' panicked at '"enum_(unnamed_at_/Library/Developer/CommandLineTools/SDKs/MacOSX_sdk/usr/include/MacTypes_h_382_1)" is not a valid Ident', /Users/fabianvarga/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.53/src/fallback.rs:780:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

macOS Monterey 12.6.3 (21G419) rustc 1.68.0 (2c8cc3432 2023-03-06)

publictheta commented 1 year ago

Sorry. Just after this issue was created, I mistakenly created a duplicate as #75.

As I mentioned in #75, this error seems to be caused by a change in the behavior of Clang that was updated recently, and can be resolved by updating the bindgen crate that this crate depends on.

The master branch's Cargo.toml has already been updated by Dependabot to use bindgen v0.64, which has already fixed this issue, so I think releasing this should eliminate the error.

br0kenpixel commented 1 year ago

Thanks! It works now.