AmbientRun / Ambient

The multiplayer game engine
https://ambient.run
Apache License 2.0
3.8k stars 124 forks source link

Ambient doesn't work on macos M2 #1262

Closed kingsleyh closed 7 months ago

kingsleyh commented 7 months ago

Unfortunately Ambient doesn't work to create a new project on Macos M2:

ambient run
10:07:37  INFO build_package: ambient_build: Building package "my_tutorial" (w5rhfs2s4s47pilqndnwj7s6grg7bjah) name="my_tutorial"
10:07:37  INFO build_package: ambient_build: Assets built, building source code... name="my_tutorial"
Error: Failed to build Rust in "/Users/kings/dev/projects/my_tutorial/build/w5rhfs2s4s47pilqndnwj7s6grg7bjah"

Caused by:
    Failed to compile
    stdout:
    error[E0463]: can't find crate for `core`
      |
      = note: the `wasm32-wasi` target may not be installed
      = help: consider downloading the target with `rustup target add wasm32-wasi`

    error[E0463]: can't find crate for `compiler_builtins`

    error: aborting due to 2 previous errors

    For more information about this error, try `rustc --explain E0463`.

    stderr:
       Compiling proc-macro2 v1.0.81
       Compiling libc v0.2.153
       Compiling serde v1.0.198
       Compiling backtrace v0.3.71
       Compiling parking_lot_core v0.9.9
       Compiling cfg-if v1.0.0
       Compiling anyhow v1.0.82
       Compiling tinyvec_macros v0.1.1
       Compiling unicode-segmentation v1.11.0
       Compiling syn v1.0.109
       Compiling slab v0.4.9
       Compiling percent-encoding v2.3.1
    libunwind: malformed __unwind_info at 0x187D5BCA8 bad second level page
    libunwind: malformed __unwind_info at 0x187D5BCA8 bad second level page
    error: could not compile `cfg-if` (lib) due to 3 previous errors
    warning: build failed, waiting for other jobs to finish...
❯  rustup target add wasm32-wasi
info: component 'rust-std' for target 'wasm32-wasi' is up to date
kingsleyh commented 7 months ago

turns out I had rust installed via both brew and rustup - once I uninstalled the brew version it worked