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

Build fails on a cross compiling toolchain from Linux

Open clangdo opened this issue 4 years ago • 3 comments

I think the wrong thing is linked right here: https://github.com/RustAudio/coreaudio-sys/blob/5837e3a1ce84f747ec96be956ca0b6d85d7b1736/build.rs#L53-L57

It was changed when you updated to the most recent version of bindgen in https://github.com/RustAudio/coreaudio-sys/commit/f1354c780970b06b9a764b9b800f5262b2398a7c, perhaps in error?

If I am incorrect feel free to set me straight, but with a project I've been working with changing that back to linking the AudioUnit framework fixes things. To see this issue in context you can view the output of this CI pipeline.

Edit: it comes to my attention that at least one person in our community was able to build veloren natively on their mac presumably linking with the AudioToolbox library, so this might be a simple case of compatibility breaking with an older SDK because of the new linking?

clangdo avatar Feb 18 '21 07:02 clangdo

At the time this looked suspicious, but I think I confirmed that it was sane for iOS builds. I had made an iOS XCode project and adding "AudioUnit" framework didn't really do anything. Adding "AudioToolbox" is what made the project build. Also if you visit https://developer.apple.com/documentation/audiotoolbox/1439851-audiounitinitialize it says the framework is "Audio Toolbox" so nothing seemed out of the ordinary.

Given that changing that line back fixes it for you, I guess the documentation is misleading and perhaps this is a difference between macOS and iOS? Or something related to the SDK used in cross-compiling?

I don't think it'd be that harmful to just add both frameworks in instead of just 1 or the other? When I was googling the issue earlier I came across this https://forum.juce.com/t/plug-in-built-with-xcode-11-fails-to-load-on-yosemite-10-10/35912/44 which suggests that if we have both lines then AudioUnit needs to be first.

I've created this in response https://github.com/RustAudio/coreaudio-sys/pull/49 but @simlay do you remember why you made this change? Was something broken for iOS?

MichaelHills avatar Feb 21 '21 04:02 MichaelHills

Edit: it comes to my attention that at least one person in our community was able to build veloren natively on their mac presumably linking with the AudioToolbox library, so this might be a simple case of compatibility breaking with an older SDK because of the new linking?

Huh. Interesting. If it broke recently, that'd be my guess.

I've created this in response #49 but @simlay do you remember why you made this change? Was something broken for iOS?

Yeah, it was for iOS but I don't recall what specifically.

simlay avatar Feb 22 '21 06:02 simlay

Yeah, it was for iOS but I don't recall what specifically.

It's possible it was related to the ObjC generation which we aborted for the time being?

MichaelHills avatar Feb 22 '21 11:02 MichaelHills