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 macOS 10.12.6 #8

Closed killkrt closed 6 years ago

killkrt commented 6 years ago

Hi,

Compiling with rust 1.25.0 (on macOS 10.12.6) I got this error:

error: unexpected close delimiter: `]`
    --> /Users/killkrt/Developer/coreaudio-sys/target/debug/build/coreaudio-sys-d982877313451e0c/out/coreaudio.rs:2164:33
     |
2164 | #[derive(Copy, Clone)]; 16usize ] , }#[test]
     |                                 ^
Rhuagh commented 6 years ago

What does xcode-select -p say?

killkrt commented 6 years ago

Here it is the output: /Library/Developer/CommandLineTools

Rhuagh commented 6 years ago

That's one weird location.

Rhuagh commented 6 years ago

@killkrt Could you try out #11 ?

killkrt commented 6 years ago

Sadly it hasn't solved my issue. Now I have this error:

error: failed to run custom build command for `coreaudio-sys v0.2.0 (file:///Users/killkrt/Developer/coreaudio-sys)`
process didn't exit successfully: `/Users/killkrt/Developer/coreaudio-sys/target/debug/build/coreaudio-sys-af3b6435cedeb014/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=framework=AudioToolbox
cargo:rustc-link-lib=framework=AudioUnit
cargo:rustc-link-lib=framework=CoreAudio
cargo:rustc-link-lib=framework=OpenAL
cargo:rustc-link-lib=framework=CoreMIDI

--- stderr
error: header '/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h' does not exist.
thread 'main' panicked at 'unable to generate bindings: ()', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Executing find / -type f -iname "coremid.h" 2>/dev/null I found out that the file is placed here:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMIDI.framework/Versions/A/Headers/CoreMIDI.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMIDI.framework/Versions/A/Headers/CoreMIDI.h
/System/Library/Frameworks/CoreMIDI.framework/Versions/A/Headers/CoreMIDI.h
Rhuagh commented 6 years ago

hmm, and you cloned my branch? what does defaults read loginwindow SystemVersionStampAsString give you ?

killkrt commented 6 years ago

Sorry, my bad, I was on the master branch, now I switched to fix/older-versions and I get the same error I got in the first post:

error: unexpected close delimiter: `]`
    --> /Users/killkrt/Developer/coreaudio-sys/target/debug/build/coreaudio-sys-f8869d8ef70218e2/out/coreaudio.rs:2164:33
     |
2164 | #[derive(Copy, Clone)]; 16usize ] , }#[test]
     |                                 ^

error: aborting due to previous error

error: Could not compile `coreaudio-sys`.

To learn more, run the command again with --verbose.
Kills-iMac:coreaudio-sys killkrt$ git branch
* fix/older-versions
  master
killkrt commented 6 years ago

Ups, sorry, I forgot to post the output of command that you asked me:

Kills-iMac:coreaudio-sys killkrt$ defaults read loginwindow SystemVersionStampAsString
10.12.6
Rhuagh commented 6 years ago

That looks like bindgen producing broken code.

What xcode version are you running?

Rhuagh commented 6 years ago

xcodebuild -version

killkrt commented 6 years ago

Umh, that's weird:

Kills-iMac:~ killkrt$ xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

I fixed it using:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

So now it is returning:

Xcode 9.2
Build version 9C40b

Then I restarted the Terminal application made a cargo clean && cargo build, but I'm still experiencing the same problem (unexpected close delimeter...)

Rhuagh commented 6 years ago

Super weird, I don't know what else to consider here. I can't reproduce it using Xcode 9.2 on Travis either.

Rhuagh commented 6 years ago

Try reinstalling Xcode maybe?

killkrt commented 6 years ago

I found the issue! It was rustfmt, updating it made the trick! You can close the issue!

Thank you for the support!

Rhuagh commented 6 years ago

AH, np! Good that you found it! :)