coreaudio-sys icon indicating copy to clipboard operation
coreaudio-sys copied to clipboard

Build fails in Sonoma 14.5 with Nix

Open alvatar opened this issue 1 year ago • 4 comments

Caused by:
  process didn't exit successfully: `/Users/alvatar/Developer/coreaudio-sys/target/debug/build/coreaudio-sys-b3082b771964cd59/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
  /Users/alvatar/Developer/coreaudio-sys/coreaudio.h:1:10: fatal error: 'AudioUnit/AudioUnit.h' file not found
  thread 'main' panicked at build.rs:162:39:
  unable to generate bindings: ClangDiagnostic("/Users/alvatar/Developer/coreaudio-sys/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

The main problem is that AudioUnit/AudioUnit.h doesn't really exist as a path: AudioUnit.h is directly found in the Headers folder of the framework, so I cannot tweak the Nix environment to find it.

Looking at build.rs I grew a bit suspicious, that perhaps AudioToolbox should be used instead?

any pointers appreciated, thanks!

alvatar avatar May 21 '24 17:05 alvatar

Hi sorry for the slow reply. I don't have a nix setup to help so it's tough to help. This looks related or the same as #78.

simlay avatar Jun 02 '24 04:06 simlay

I also have issues building a package with coreaudio-sys as dependency using nix build. Will compile a simple example tomorrow.

multivac61 avatar Jun 20 '24 18:06 multivac61

Here is a fix to the issue. please close and file in nix instead.

multivac61 avatar Jun 20 '24 18:06 multivac61

I'm getting the same error in MacOS Sequoia 14.6, when compiling uiua which references coreaudio-sys v0.2.17, so it doesn't seem to be nix-related.

memark avatar Sep 25 '25 20:09 memark