Closed WooterTheTroubleshooter closed 6 years ago
Thanks for reporting this! I really haven't been maintaining this repository well recently.
After pushing some updates to the screeps-in-rust-via-wasm tools and this repository, I think I have it building. I pushed a workaround for the nightly issue, so I'm building with the 2018-08-05
nightly
I'm now using cargo-web 0.6.15
, cargo-screeps 0.1.4
, and the latest update from this repository with screeps-game-api 0.1.0
.
$ cargo install -f cargo-web
...
$ cargo install -f cargo-screeps
...
$ git pull
...
$ git rev-parse HEAD
ed32a3d92764fee96da94b75a329c41c8167a350
$ cargo web --version
cargo-web 0.6.15
$ cargo screeps --version
cargo-screeps 0.1.4
$ rustc --version
rustc 1.30.0-nightly (73c78734b 2018-08-05)
$ cargo screeps --build
cargo_screeps: compiling...
Compiling proc-macro2 v0.4.12
Compiling unicode-xid v0.1.0
Compiling serde v1.0.71
Compiling ryu v0.2.3
Compiling num-traits v0.2.5
Compiling itoa v0.4.2
Compiling base-x v0.2.2
Compiling stdweb v0.4.8
Compiling discard v1.0.3
Compiling cfg-if v0.1.5
Compiling scoped-tls v0.1.2
Compiling proc-macro2 v0.2.3
Compiling log v0.4.3
Compiling fern v0.5.6
Compiling quote v0.4.2
Compiling quote v0.6.6
Compiling syn v0.12.15
Compiling syn v0.14.8
Compiling num-traits v0.1.43
Compiling serde_json v1.0.26
Compiling enum_primitive v0.1.1
Compiling serde_derive v1.0.71
Compiling stdweb-derive v0.4.0
Compiling stdweb-internal-macros v0.1.0
Compiling screeps-game-api v0.1.0
Compiling screeps-starter-rust v0.0.0 (file:///home/daboross/Projects/Rust/screeps-starter-rust)
Finished release [optimized] target(s) in 1m 24s
Garbage collecting "screeps-starter-rust.wasm"...
Processing "screeps-starter-rust.wasm"...
Finished processing of "screeps-starter-rust.wasm"!
cargo_screeps: compiled.
Let me know if this works for you too!
I'm getting back into screeps recently and it'd be great to have some new users of the screeps-in-rust-via-wasm
toolset to help test usability.
Ah, I hadn't pushed code. This repository should be actually updated now.
Ok, so I have got it working now. I was running into some trouble with my own repository, however updating the original repository worked.
I'll post my actions here for others having the same issues.
Really interested to see if I am able to convert/redesign my current strategy using rust.
$ cargo screeps --build
cargo_screeps: compiling...
Finished release [optimized] target(s) in 0.03s
Garbage collecting "screeps-wooter.wasm"...
Processing "screeps-wooter.wasm"...
Finished processing of "screeps-wooter.wasm"!
error: 'cargo web' generated unexpected JS prefix! This means it's updated without 'cargo screeps' also having updates. Please report this issue to https://github.com/daboross/screeps-in-rust-via-wasm/issues and include the first ~30 lines of /home/wouter/Screeps/rust/target/wasm32-unknown-unknown/release/screeps-wooter.js
$ rm Cargo.lock
$ cargo screeps --build
cargo_screeps: compiling...
Compiling proc-macro2 v0.4.12
Compiling serde v1.0.71
Compiling ryu v0.2.3
Compiling cfg-if v0.1.5
Compiling log v0.4.3
Compiling fern v0.5.6
Compiling quote v0.6.6
Compiling syn v0.14.8
Compiling serde_json v1.0.26
Compiling serde_derive v1.0.71
Compiling stdweb-internal-macros v0.1.0
Compiling stdweb-derive v0.4.0
Compiling stdweb v0.4.8
Compiling screeps-game-api v0.1.0
Compiling screeps-starter-rust v0.0.0 (file:///home/wouter/Screeps/rust)
Finished release [optimized] target(s) in 1m 08s
Garbage collecting "screeps-starter-rust.wasm"...
Processing "screeps-starter-rust.wasm"...
Finished processing of "screeps-starter-rust.wasm"!
error: error: multiple js files found in /home/wouter/Screeps/rust/target/wasm32-unknown-unknown/release
$ rm -rf target/wasm32-unknown-unknown/release/
$ cargo screeps --build
cargo_screeps: compiling...
Compiling itoa v0.4.2
Compiling discard v1.0.3
Compiling cfg-if v0.1.5
Compiling scoped-tls v0.1.2
Compiling serde v1.0.71
Compiling ryu v0.2.3
Compiling num-traits v0.2.5
Compiling stdweb v0.4.8
Compiling log v0.4.3
Compiling fern v0.5.6
Compiling num-traits v0.1.43
Compiling enum_primitive v0.1.1
Compiling serde_json v1.0.26
Compiling screeps-game-api v0.1.0
Compiling screeps-starter-rust v0.0.0 (file:///home/wouter/Screeps/rust)
Finished release [optimized] target(s) in 37.76s
Garbage collecting "screeps-starter-rust.wasm"...
Processing "screeps-starter-rust.wasm"...
Finished processing of "screeps-starter-rust.wasm"!
cargo_screeps: compiled.
@WooterTheTroubleshooter Thanks for the update! I'll add the tip about cleaning the target dir to the README.
Just to let you know, there was one error in the code I'd written to fix cargo-screeps
which made it only work for projects named screeps-starter-rust
. With the latest release it should actually be fixed to work for any other projects with different names.
@daboross Thank you, I was wondering about that.
I have tried compiling using both screeps-game-api 0.0.8 and 0.0.10.
As I am new to rust, I'm not really sure where to start.