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

Cargo build fails on example on MacOS 14.0 because it could not compile ahash #10241

Closed
eikopf opened this issue Oct 23, 2023 · 4 comments
Closed
Labels
C-Dependencies A change to the crates that Bevy depends on

Comments

@eikopf
Copy link

eikopf commented Oct 23, 2023

  • Bevy 0.11.3
  • Rust 1.75.0 (nightly, aarch64)
  • MacOS Sonoma (14.0)

This looks to be because of ahash #170, which has been fixed and is waiting to be merged into the master branch.

@eikopf eikopf added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Oct 23, 2023
@mockersf
Copy link
Member

the fix has been merged, and version 0.8.5 has been published. does it work for you with it?

@mockersf mockersf added C-Dependencies A change to the crates that Bevy depends on and removed S-Needs-Triage This issue needs to be labelled C-Bug An unexpected or incorrect behavior labels Oct 24, 2023
@eikopf
Copy link
Author

eikopf commented Oct 25, 2023

sorry for the delay; the project now builds, but segfaults on cargo run. i assume this is an OS thing, because i'm just trying to build this:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, bevy::window::close_on_esc)
        .run();
}

with this Cargo.toml:

[package]
name = "bevy-sandbox"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.11.0", features = ["dynamic_linking"] }

# from the bevy book setup process

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

@eikopf
Copy link
Author

eikopf commented Oct 25, 2023

also worth noting that this also happens when dynamic linking is disabled, and after rebuilding without it i got the following error message:

> cargo run
    Finished dev [optimized + debuginfo] target(s) in 0.28s
     Running `target/debug/bevy-sandbox`
2023-10-25T15:06:08.988886Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
thread 'main' panicked at /rustc/1c05d50c8403c56d9a8b6fb871f15aaa26fb5d07/library/core/src/iter/adapters/enumerate.rs:87:17:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)

this only happened on the first run after the build, and then i continued to get the same segfault behaviour as before.

@eikopf
Copy link
Author

eikopf commented Oct 28, 2023

final note for now; this issue only appears on the most recent nightly toolchain, and so it looks like this is a duplicate of #10273. for anyone looking for a workaround, set

[profile.dev.package."*"]
opt-level = 2

in your Cargo.toml.

@eikopf eikopf closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

No branches or pull requests

2 participants