Panicked building example code using cargo Screeps build
Closed this issue · 2 comments
Hello,
I have an M1 MacBook Pro 2021 and cannot build the example using the command cargo screeps build
. This command results in the error:
info: syncing channel updates for '1.47.0-aarch64-apple-darwin'
info: latest update on 2020-10-08, rust version 1.47.0 (18bf6b4f0 2020-10-07)
error: target 'aarch64-apple-darwin' not found in channel. Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets
If I increase the version in the rust-toolchain to 1.51.0, the command executes successfully. But if I increase the rust-toolchain version to 1.52.0, I get the following error:
foo@Foo-MacBook-Pro screeps-starter-rust % cargo screeps build
cargo_screeps::run: compiling...
Finished release [optimized] target(s) in 0.01s
Processing "screeps-starter-rust.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', /Users/foo/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/wasm_context.rs:642:41
stack backtrace:
0: 0x10253d794 - std::backtrace_rs::backtrace::libunwind::trace::ha03082fdb36b8e44
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x10253d794 - std::backtrace_rs::backtrace::trace_unsynchronized::hf1acb3d3fce46837
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x10253d794 - std::sys_common::backtrace::_print_fmt::hbc7deaf5374edfd8
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5
3: 0x10253d794 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha9a1a8bf7485458d
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22
4: 0x10255bbc8 - core::fmt::write::h9ee5b099821ae5e1
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17
5: 0x1025366c8 - std::io::Write::write_fmt::h240449cbf2a536ee
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15
6: 0x10253f1ac - std::sys_common::backtrace::_print::hf65124e94f800e0d
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5
7: 0x10253f1ac - std::sys_common::backtrace::print::haec7f207d91c0faa
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9
8: 0x10253f1ac - std::panicking::default_hook::{{closure}}::h321649ccf26de565
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22
9: 0x10253ee88 - std::panicking::default_hook::h1e736e6294672e8d
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9
10: 0x10253f684 - std::panicking::rust_panic_with_hook::hd083a3aa5c934ce6
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:698:17
11: 0x10253f578 - std::panicking::begin_panic_handler::{{closure}}::hb5be8aaa10a229ca
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:588:13
12: 0x10253dc70 - std::sys_common::backtrace::__rust_end_short_backtrace::h68e10e4f00198298
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:138:18
13: 0x10253f2d0 - rust_begin_unwind
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
14: 0x1025807b4 - core::panicking::panic_fmt::hffc63a015c61fdde
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
15: 0x1021baa5c - cargo_web::wasm_context::Context::from_module::h72ce9e18148a1fdb
16: 0x102245e10 - cargo_web::wasm::process_wasm_file::h5d22829be25298ce
17: 0x102250b94 - core::ops::function::impls::<impl core::ops::function::FnMut for &mut F>::call_mut::h1763cd22f1902d81
18: 0x102217fa4 - cargo_web::cargo_shim::BuildConfig::build_internal::ha741dd3707b9cb64
19: 0x102215de0 - cargo_web::cargo_shim::BuildConfig::build::hb45f87225748bdb0
20: 0x102261b40 - cargo_web::build::Project::build_or_check::hfcbe3e1fd144ba97
21: 0x1021fe574 - cargo_web::cmd_build::command_build_or_check::hed6787e4db507c40
22: 0x1021c1c08 - cargo_web::run::hcdffbb0dfc555251
23: 0x1021046cc - cargo_screeps::build::build::h6dee5d584e3da6da
24: 0x1020fbcd8 - cargo_screeps::run::run_build::h626faec630b66f6c
25: 0x1020fba90 - cargo_screeps::run::run::h4c8d0fc752711f56
26: 0x1020e44a0 - cargo_screeps::main::hfedb224feaac2d5d
27: 0x1020e12ac - std::sys_common::backtrace::__rust_begin_short_backtrace::h31aca442ec747e21
28: 0x1020e6494 - std::rt::lang_start::{{closure}}::h109adba717e61f6e
29: 0x102530c90 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h3b331d3fbbcc71c7
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280:13
30: 0x102530c90 - std::panicking::try::do_call::hff616b6be7bbc015
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
31: 0x102530c90 - std::panicking::try::h298ba2ba2d72fd07
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
32: 0x102530c90 - std::panic::catch_unwind::h82d7a0ad94159423
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
33: 0x102530c90 - std::rt::lang_start_internal::{{closure}}::h801a38d4a43d99be
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:48
34: 0x102530c90 - std::panicking::try::do_call::h8ecac938bf293f4a
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
35: 0x102530c90 - std::panicking::try::he8bacc15da046b2c
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
36: 0x102530c90 - std::panic::catch_unwind::hfbee3bd78d2873c3
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
37: 0x102530c90 - std::rt::lang_start_internal::hbbfe6e663b24763e
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:20
38: 0x1020e465c - _main
In summary: changing the version specified in the rust-toolchain file to 1.51.0 enabled the example to build. I hope this helps.
Getting same issue, using 1.63.0.
Same problem. Just needs the update to 1.56.0
in the rust-toolchain