bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36k stars 3.55k forks source link

Bevy doesn't build on macOS #14956

Open lynn-lumen opened 2 months ago

lynn-lumen commented 2 months ago

Bevy version

latest main (#14916)

[Optional] Relevant system information

I am using cargo 1.82.0-nightly (ba8b39413 2024-08-16) on an Apple M1 running macOS Sonoma 14.2.1

What you did

Using the setup mentioned above, bevy does not compile with the following error: error[E0308]: mismatched types --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/accesskit_macos-0.17.0/src/patch.rs:44:13 44 focusforwarder as unsafe extern "C" fn(, ) -> , ^^^^^^^^^^^^^^^ one type is more general than the other

= note: expected fn pointer unsafe extern "C" fn(&NSWindow, objc2::runtime::Sel) -> _ found fn pointer unsafe extern "C" for<'a> fn(&'a NSWindow, objc2::runtime::Sel) -> _

For more information about this error, try rustc --explain E0308. error: could not compile accesskit_macos (lib) due to 1 previous error

I assume this is not bevy's fault but it prevents bevy from being built.

alice-i-cecile commented 2 months ago

I think the next step here is reproducing this on access_kit alone and filing an issue there.

akimakinai commented 2 months ago

Probably this is https://github.com/rust-lang/rust/issues/129285.

zhaop commented 1 month ago

I have the same issue on MacOS with rustc 1.82.0-nightly (4074d4902 2024-08-23).

https://github.com/rust-lang/rust/issues/129285 is fixed by https://github.com/rust-lang/rust/pull/129288 on Aug 26 (for rust 1.82.0, which becomes stable on Oct 17).

In the mean time I was able to get Bevy to build again by explicitly choosing rust 1.79.0 (the version in Bevy's Cargo.toml); the latest nightly (I assume any build after 2024-08-26) also works.