Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Can't compile / run tests? (wasm version mismatch?) #28

Closed
axelchalon opened this issue Feb 2, 2018 · 17 comments
Closed

Can't compile / run tests? (wasm version mismatch?) #28

axelchalon opened this issue Feb 2, 2018 · 17 comments

Comments

@axelchalon
Copy link
Collaborator

axelchalon commented Feb 2, 2018

Hey, so I'm working on implementing changes to ethabi right now and I would like at some point to make sure that sol-rs and the tests still work fine with the new version. However if I simply clone the sol-rs repo and run cargo test on master right now I get the following error: https://gist.github.com/axelchalon/1db3284c11adf373dbe57648120dd678. Is this expected? This is the same error as on the CI (except I also get this error for previous commits)

might be because there's no cargo.lock and stuff changed?

any pointers appreciated! cheers

@tomusdrw
Copy link
Collaborator

tomusdrw commented Feb 2, 2018

Yes. I think we either need to include Cargo.lock or rather better update ethcore crate to specify a revision inside ethcore/Cargo.toml within Parity repo (more hassle for wasm guys when they want to update it).

@snd
Copy link
Contributor

snd commented Feb 21, 2018

running into the same problem. also for a weekend project that uses the ethcore crate.

i assume any project that has a dependency on the ethcore crate will fail to build (unless ) because of this.
tried using the stable branch. didn't help.

would be great if this could get fixed so at least the following compiles:

ethcore = { git = "https://github.com/paritytech/parity.git", branch = "stable" }

stuck here.
what's a temporary solution?

@snd
Copy link
Contributor

snd commented Feb 21, 2018

tried with newest master and different branches. ran into different similar compilation errors. all wasm version mismatch related.

@tomusdrw
Copy link
Collaborator

tomusdrw commented Feb 21, 2018

The workaround is to:

  1. Create a new project that uses sol-rs as a dependency
  2. See a compilation failure
  3. Go to parity repo and check parity_wasm version in Cargo.lock
  4. Run cargo update -p parity-wasm --precise <hash-found-in-parity> in your project.

@snd
Copy link
Contributor

snd commented Feb 21, 2018

what exactly do you mean by <hash-found-in-parity>?
not finding any (commit) hash for parity-wasm in https://github.com/paritytech/parity/blob/master/Cargo.lock.

if i try cargo update -p parity-wasm --precise 0.25.0 i get:

error: There are multiple `parity-wasm` packages in your project, and the specification `parity-wasm` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  parity-wasm:0.25.0
  parity-wasm:0.23.0

if i then try cargo update -p parity-wasm:0.23.0 --precise 0.25.0:

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: no matching version `^0.23` found for package `parity-wasm` (required by `wasm`)
location searched: registry `https://github.com/rust-lang/crates.io-index`
versions found: 0.25.0

fresh project. only dependency is ethcore = { git = "https://github.com/paritytech/parity.git" }

@tomusdrw
Copy link
Collaborator

Weird. Just noticed that we are using a branch of parity. Made a PR: openethereum/parity-ethereum#7964

@snd
Copy link
Contributor

snd commented Feb 21, 2018

PR: great!

i'm having these 2 wasm versions problems with the current master (01d9bff3cf6aca8bb436defd090090fbb5776b61) as well as the td-evm branch.
previous comment was about master

@tomusdrw
Copy link
Collaborator

can you try removing Cargo.lock now? I've updated td-evm to reflect current master, so there should be only one version included now.

@snd
Copy link
Contributor

snd commented Feb 21, 2018

should i try with td-evm?

@snd
Copy link
Contributor

snd commented Feb 21, 2018

in current master only 0.23 is specified explicitly (https://github.com/paritytech/parity/blob/c060d9584dae34e0e215f061bd61b2ebd375956b/ethcore/wasm/Cargo.toml#L10) and locked. something else that's also using parity-wasm seems to be pulling in 0.25

@snd
Copy link
Contributor

snd commented Feb 21, 2018

that something else is wasm-utils 0.1 which is locked to 0.1 in parity master and depends on parity-wasm 0.25.0 whereas the rest of parity depends on parity-wasm 0.23.0

@snd
Copy link
Contributor

snd commented Feb 21, 2018

@tomusdrw
Copy link
Collaborator

@snd so just pin wasm-utils to previous version before this commit:
paritytech/wasm-utils@fbb5d1d

$ cargo update -p wasm-utils --precise 9e92237c4ddf136782fb1e76bddc6499ec663463

@snd
Copy link
Contributor

snd commented Feb 21, 2018

@tomusdrw thanks!

using td-evm at openethereum/parity-ethereum@d06ccbb resulted the same 2 versions error.

after pinning wasm-utils as you described i'm getting:

   Compiling wasm v0.1.0 (https://github.com/paritytech/parity.git?branch=td-evm#d06ccbb0)
error[E0053]: method `invoke_index` has an incompatible type for trait
   --> /Users/basilisk/.cargo/git/checkouts/parity-dc9825eb65b3adf1/d06ccbb/ethcore/wasm/src/runtime.rs:662:3
    |
662 |           fn invoke_index(
    |  _________^
663 | |             &mut self,
664 | |             index: usize,
665 | |             args: RuntimeArgs,
...   |
693 | |             }
694 | |         }
    | |_________^ expected struct `wasmi::Trap`, found enum `wasmi::Error`
    |
    = note: expected type `fn(&mut runtime::Runtime<'a>, usize, wasmi::RuntimeArgs<'_>) -> std::result::Result<std::option::Option<wasmi::RuntimeValue>, wasmi::Trap>`
               found type `fn(&mut runtime::Runtime<'a>, usize, wasmi::RuntimeArgs<'_>) -> std::result::Result<std::option::Option<wasmi::RuntimeValue>, wasmi::Error>`

error: aborting due to previous error

error: Could not compile `wasm`.

@snd
Copy link
Contributor

snd commented Feb 21, 2018

that's no longer related to parity-wasm but wasmi instead. making progress. though it would be really nice if the versions of the wasm related crates would match up and be compatible with each other.

@snd
Copy link
Contributor

snd commented May 31, 2018

this no longer seems to be an issue. keeping this open until we have master pass CI again

@snd
Copy link
Contributor

snd commented Jun 7, 2018

seems resolved on #31. will reopen if this appears again

@snd snd closed this as completed Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants