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

Apple Silicon support #1002

Closed
wants to merge 2 commits into from
Closed

Apple Silicon support #1002

wants to merge 2 commits into from

Conversation

wyhaya
Copy link
Contributor

@wyhaya wyhaya commented Dec 4, 2020

Issue: #928

bevy_audio is currently unavailable, May be related to RustAudio/coreaudio-sys#45

@joshuajbouw
Copy link
Member

Sweet, yeah that confirms exactly why results that I had when trying to compile for M1.

  • There -can- be Audio support, you MUST compile from the same architecture though, so that would limit it to only being able to build it on a M1 chip from what I understand?
  • shaderc for M1 makes sense from what I gathered too, and it does compile.

Maybe waiting for Winit to do an update would be a good idea first though. At the very least, I would suggest having the Cargo.toml git patch put in as a conditional much like WASM's.

@wyhaya
Copy link
Contributor Author

wyhaya commented Dec 4, 2020

Currently bevy_audio fails to build on the M1 chip.

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

Caused by:
  process didn't exit successfully: `/Users/../bevy/target/debug/build/coreaudio-sys../build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=COREAUDIO_SDK_PATH
  cargo:rustc-link-lib=framework=AudioToolbox
  cargo:rustc-link-lib=framework=CoreAudio
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  thread 'main' panicked at 'libclang error; possible causes include:
  - Invalid flag syntax
  - Unrecognized flags
  - Invalid flag arguments
  - File I/O errors
  - Host vs. target architecture mismatch
  If you encounter an error missing from this list, please file an issue or a PR!', /Users/../bindgen-0.56.0/src/ir/context.rs:531:15
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Related Issues: rust-lang/rust-bindgen#1211

@joshuajbouw
Copy link
Member

I see, ok good to know. Hopefully they fix it soon.

@wyhaya
Copy link
Contributor Author

wyhaya commented Dec 4, 2020

To build bevy_audio on the M1 chip, need to wait for an upstream update

rodio
    cpal
        coreaudio-rs
            coreaudio-sys

@Moxinilian Moxinilian added A-Build-System Related to build systems or continuous integration C-Feature A new feature, making something new possible labels Dec 4, 2020
@MichaelHills
Copy link
Contributor

Yep soon RustAudio/coreaudio-sys#46

@MichaelHills
Copy link
Contributor

coreaudio-sys has been published, is audio good to go now?

@@ -42,7 +50,7 @@ impl Into<shaderc::ShaderKind> for ShaderStage {
}
}

#[cfg(target_os = "ios")]
#[cfg(any(target_os = "ios", all(target_os = "macos", target_arch = "aarch64")))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function below was updated recently to return a Result. You can copy what I added here to make this work on Apple Silicon:

#1027

I created my pull request before I saw yours, oops

@wyhaya
Copy link
Contributor Author

wyhaya commented Dec 8, 2020

@MichaelHills bevy_audio now works fine!

@wyhaya
Copy link
Contributor Author

wyhaya commented Dec 8, 2020

Close this PR, looks like #1027 is working better

@wyhaya wyhaya closed this Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants