oasislabs / game-box

A Truffle box for a barebones Oasis Game
4 stars 3 forks source link

Wasm/cargo contracts do not build #16

Open kliu128 opened 5 years ago

kliu128 commented 5 years ago
error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0119`.
error: Could not compile `wasm-bindgen`.

To learn more, run the command again with --verbose.

Shutting down due to failure:    Compiling wasm-bindgen v0.2.42
error[E0119]: conflicting implementations of trait `convert::traits::IntoWasmAbi` for type `&dyn for<'r> core::ops::Fn(&'r _) -> _`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/convert/closures.rs:11:9
    |
11  | /         impl<'a, 'b, $($var,)* R> IntoWasmAbi for &'a (Fn($($var),*) -> R + 'b)
12  | |             where $($var: FromWasmAbi,)*
13  | |                   R: ReturnWasmAbi
14  | |         {
...   |
22  | |             }
23  | |         }
    | |_________^ conflicting implementation for `&dyn for<'r> core::ops::Fn(&'r _) -> _`
...
111 | / stack_closures! {
112 | |     (0 invoke0 invoke0_mut)
113 | |     (1 invoke1 invoke1_mut A)
114 | |     (2 invoke2 invoke2_mut A B)
...   |
119 | |     (7 invoke7 invoke7_mut A B C D E F G)
120 | | }
    | |_- in this macro invocation
121 | 
122 | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (Fn(&A) -> R + 'b)
123 | |     where A: RefFromWasmAbi,
124 | |           R: ReturnWasmAbi
125 | | {
...   |
133 | |     }
134 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0119]: conflicting implementations of trait `convert::traits::IntoWasmAbi` for type `&mut dyn for<'r> core::ops::FnMut(&'r _) -> _`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/convert/closures.rs:60:9
    |
60  | /         impl<'a, 'b, $($var,)* R> IntoWasmAbi for &'a mut (FnMut($($var),*) -> R + 'b)
61  | |             where $($var: FromWasmAbi,)*
62  | |                   R: ReturnWasmAbi
63  | |         {
...   |
71  | |             }
72  | |         }
    | |_________^ conflicting implementation for `&mut dyn for<'r> core::ops::FnMut(&'r _) -> _`
...
111 | / stack_closures! {
112 | |     (0 invoke0 invoke0_mut)
113 | |     (1 invoke1 invoke1_mut A)
114 | |     (2 invoke2 invoke2_mut A B)
...   |
119 | |     (7 invoke7 invoke7_mut A B C D E F G)
120 | | }
    | |_- in this macro invocation
...
169 | / impl<'a, 'b, A, R> IntoWasmAbi for &'a mut (FnMut(&A) -> R + 'b)
170 | |     where A: RefFromWasmAbi,
171 | |           R: ReturnWasmAbi
172 | | {
...   |
180 | |     }
181 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0119]: conflicting implementations of trait `describe::WasmDescribe` for type `dyn for<'r> core::ops::Fn(&'r _) -> _`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/convert/closures.rs:47:9
    |
47  | /         impl<'a, $($var,)* R> WasmDescribe for Fn($($var),*) -> R + 'a
48  | |             where $($var: FromWasmAbi,)*
49  | |                   R: ReturnWasmAbi
50  | |         {
...   |
57  | |             }
58  | |         }
    | |_________^ conflicting implementation for `dyn for<'r> core::ops::Fn(&'r _) -> _`
...
111 | / stack_closures! {
112 | |     (0 invoke0 invoke0_mut)
113 | |     (1 invoke1 invoke1_mut A)
114 | |     (2 invoke2 invoke2_mut A B)
...   |
119 | |     (7 invoke7 invoke7_mut A B C D E F G)
120 | | }
    | |_- in this macro invocation
...
156 | / impl<'a, A, R> WasmDescribe for Fn(&A) -> R + 'a
157 | |     where A: RefFromWasmAbi,
158 | |           R: ReturnWasmAbi,
159 | | {
...   |
166 | |     }
167 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0119]: conflicting implementations of trait `describe::WasmDescribe` for type `dyn for<'r> core::ops::FnMut(&'r _) -> _`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/convert/closures.rs:96:9
    |
96  | /         impl<'a, $($var,)* R> WasmDescribe for FnMut($($var),*) -> R + 'a
97  | |             where $($var: FromWasmAbi,)*
98  | |                   R: ReturnWasmAbi
99  | |         {
...   |
106 | |             }
107 | |         }
    | |_________^ conflicting implementation for `dyn for<'r> core::ops::FnMut(&'r _) -> _`
...
111 | / stack_closures! {
112 | |     (0 invoke0 invoke0_mut)
113 | |     (1 invoke1 invoke1_mut A)
114 | |     (2 invoke2 invoke2_mut A B)
...   |
119 | |     (7 invoke7 invoke7_mut A B C D E F G)
120 | | }
    | |_- in this macro invocation
...
203 | / impl<'a, A, R> WasmDescribe for FnMut(&A) -> R + 'a
204 | |     where A: RefFromWasmAbi,
205 | |           R: ReturnWasmAbi
206 | | {
...   |
213 | |     }
214 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0119]: conflicting implementations of trait `closure::WasmClosure` for type `(dyn for<'r> core::ops::Fn(&'r _) -> _ + 'static)`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/closure.rs:544:9
    |
544 | /         unsafe impl<$($var,)* R> WasmClosure for Fn($($var),*) -> R + 'static
545 | |             where $($var: FromWasmAbi + 'static,)*
546 | |                   R: ReturnWasmAbi + 'static,
547 | |         {
...   |
587 | |             }
588 | |         }
    | |_________^ conflicting implementation for `(dyn for<'r> core::ops::Fn(&'r _) -> _ + 'static)`
...
689 | / doit! {
690 | |     ()
691 | |     (A)
692 | |     (A B)
...   |
697 | |     (A B C D E F G)
698 | | }
    | |_- in this macro invocation
...
706 | / unsafe impl<A, R> WasmClosure for Fn(&A) -> R
707 | |     where A: RefFromWasmAbi,
708 | |           R: ReturnWasmAbi + 'static,
709 | | {
...   |
747 | |     }
748 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0119]: conflicting implementations of trait `closure::WasmClosure` for type `(dyn for<'r> core::ops::FnMut(&'r _) -> _ + 'static)`:
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.42/src/closure.rs:590:9
    |
590 | /         unsafe impl<$($var,)* R> WasmClosure for FnMut($($var),*) -> R + 'static
591 | |             where $($var: FromWasmAbi + 'static,)*
592 | |                   R: ReturnWasmAbi + 'static,
593 | |         {
...   |
634 | |             }
635 | |         }
    | |_________^ conflicting implementation for `(dyn for<'r> core::ops::FnMut(&'r _) -> _ + 'static)`
...
689 | / doit! {
690 | |     ()
691 | |     (A)
692 | |     (A B)
...   |
697 | |     (A B C D E F G)
698 | | }
    | |_- in this macro invocation
...
750 | / unsafe impl<A, R> WasmClosure for FnMut(&A) -> R
751 | |     where A: RefFromWasmAbi,
752 | |           R: ReturnWasmAbi + 'static,
753 | | {
...   |
792 | |     }
793 | | }
    | |_- first implementation here
    |
    = note: downstream crates may implement trait `convert::traits::FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0119`.
error: Could not compile `wasm-bindgen`.

To learn more, run the command again with --verbose.

Error: Unknown exit code: 1
    at ChildProcess.<anonymous> (/usr/lib/node_modules/truffle-oasis/build/webpack:/packages/truffle-external-compile/index.js:120:1)
    at ChildProcess.emit (events.js:194:15)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:600:12)
Truffle v5.0.4 (core: 5.0.0)
Node v10.15.1
   Compiling serde v1.0.90
   Compiling syn v0.15.32
   Compiling serde_json v1.0.39
   Compiling wasm-bindgen-backend v0.2.37
   Compiling serde_derive v1.0.90
   Compiling oasis-game-core-derive v0.9.1
   Compiling wasm-bindgen-macro-support v0.2.37
   Compiling wasm-bindgen-macro v0.2.37
   Compiling oasis-game-core v0.9.0
   Compiling wasm-bindgen v0.2.37
   Compiling rand_os v0.1.3
   Compiling console_error_panic_hook v0.1.6
   Compiling oasis-game-client-proxy v0.9.0
   Compiling rand v0.6.5
   Compiling core v0.1.0 (/project/core/game)

Apparently this may be related to https://github.com/rustwasm/wasm-bindgen/issues/1439, but I tried updating rust using rustup in the contract kit and it produced further errors, such as

error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `rustc-hex`.
warning: build failed, waiting for other jobs to finish...
error: build failed

cc @RektInPieces

clementfung commented 5 years ago

Hi! We noticed that wasm-bindgen dependencies were constantly breaking out demo, so we've fixed the dependency to be 0.2.37. I've updated the Cargo.toml files accordingly.

Please let me know if you're able to compile the contracts, sorry for the slow turnaround!