You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current nightly builds of rust use new wasm opcodes for sign-extension which will not load under the LLVM running on the official servers. Private servers tested appear to have no problem with the new opcodes.
Errors like Compiling wasm function #1389:<screeps::constants::small_enums::Direction as ... failed: Invalid opcode (enable with --experimental-wasm-se) @+1009670 will occur on attempt to load the module.
Ideally we'll be able to have a setting to control disabling these newer opcodes (possibly integrated into cargo-screeps) but a working workaround has not yet been identified - see rust-lang/rust#109807
The text was updated successfully, but these errors were encountered:
The workaround that we've identified to this issue using the resources in the linked issue requires nightly rust. To work around:
Add build flags with set the target cpu to mvp, and rebuild std, which is usually used from the distribution pre-compiled. Example from my screeps.toml:
Additionally (and technically a separate issue), add the --disable-sign-ext to the options passed to wasm-opt, as current versions will add the new opcodes even when rustc does not. Example from my Cargo.toml:
An alternative workaround identified in the linked rust issue, that doesn't require build-std (but does require wasm-opt), is to add --signext-lowering to your wasm-opt options.
Current nightly builds of rust use new wasm opcodes for sign-extension which will not load under the LLVM running on the official servers. Private servers tested appear to have no problem with the new opcodes.
Errors like
Compiling wasm function #1389:<screeps::constants::small_enums::Direction as ... failed: Invalid opcode (enable with --experimental-wasm-se) @+1009670
will occur on attempt to load the module.Ideally we'll be able to have a setting to control disabling these newer opcodes (possibly integrated into cargo-screeps) but a working workaround has not yet been identified - see rust-lang/rust#109807
The text was updated successfully, but these errors were encountered: