rustyscreeps / screeps-starter-rust

Starter Rust AI for Screeps, the JavaScript-based MMO game
MIT License
121 stars 47 forks source link

RuntimeError: unreachable #20

Closed Jeroendevr closed 3 years ago

Jeroendevr commented 3 years ago

Dear Rustyscreeps team,

SInce yesterday, I tried to deploy the default starter pack, the Screeps Application yield the following errors.

I cannot figure out if this is related to me, screeps or the screeps starter code.

Can one give clarification or provide some debugging steps.

[15:25:13][shard3]RuntimeError: unreachable
    at rust_panic (wasm-function[251]:1)
    at _ZN3std9panicking20rust_panic_with_hook17hc5713da015ebaa19E (wasm-function[21]:117)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17hc5eba7f0030e8f4fE (wasm-function[264]:1)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17he811f0bd07938b42E (wasm-function[263]:6)
    at rust_begin_unwind (wasm-function[38]:52)
    at _ZN4core9panicking9panic_fmt17h775d5c012939dd41E (wasm-function[35]:48)
    at _ZN4core9panicking5panic17hf103660e9eaae571E (wasm-function[24]:67)
    at _ZN153_$LT$stdweb..webcore..serialization..SerializedValue$u20$as$u20$core..convert..From$LT$stdweb..webcore..serialization..SerializedUntaggedFunction$GT$$GT$4from17h868468bc5e8b6c07E (wasm-function[225]:14)
    at _ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hd43e95b003140950E (wasm-function[5]:1)
shanemadden commented 3 years ago

I suspect this might be due to https://github.com/rustyscreeps/screeps-game-api/issues/331 - our released version is based on stdweb, which is unmaintained and broken in Rust 1.48. Try running rustup default 1.47.0 then building again and see if that resolves the errors?

Jeroendevr commented 3 years ago

Great advice, it seems to work. Thanks. There is a lot going on around this stdweb as could read in the related issues. Is there a way for new users to inform them about running 1.47?

shanemadden commented 3 years ago

Best idea I have at the moment is to add a line to the readme warning people that they'll unfortunately need to use old Rust to compile currently, unless anyone has any better ideas I'll plan on making a PR for that.

Jeroendevr commented 3 years ago

Thanks for your help, I'll get going learning Rust while Screeping.

jakob-ledermann commented 3 years ago

You could also include a file rust-toolchain so no one else needs to remember. I don't know if there is a way to couple it to a specific dependency version (which would make sure it can not be forgotten to remove once std-web gets fixed). I actually first tried to fix it with rustup override set 1.47.0 which worked fine for me. As far as I understood this stores the override for my project on my pc, so all the other rust projects don't get affected.