Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on a cross compiling toolchain from Linux #48

Open
clangdo opened this issue Feb 18, 2021 · 3 comments
Open

Build fails on a cross compiling toolchain from Linux #48

clangdo opened this issue Feb 18, 2021 · 3 comments

Comments

@clangdo
Copy link

clangdo commented Feb 18, 2021

I think the wrong thing is linked right here:

coreaudio-sys/build.rs

Lines 53 to 57 in 5837e3a

#[cfg(feature = "audio_unit")]
{
println!("cargo:rustc-link-lib=framework=AudioToolbox");
headers.push("AudioUnit/AudioUnit.h");
}

It was changed when you updated to the most recent version of bindgen in f1354c7, 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 clangdo changed the title Build fails on a cross compiling toolchain from linux Build fails on a cross compiling toolchain from Linux Feb 18, 2021
@MichaelHills
Copy link
Contributor

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 #49 but @simlay do you remember why you made this change? Was something broken for iOS?

@simlay
Copy link
Member

simlay commented Feb 22, 2021

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.

@MichaelHills
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants