-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile the tendermint
and light-client
crates to WASM
#553
Conversation
It is currently unclear why this error has appeared, though I suspect it is a bug in Cargo related to the combination of doc tests and features flags. Doc-tests tendermint-light-client error[E0460]: found possibly newer version of crate `tendermint` which `tendermint_rpc` depends on --> /Users/coromac/Informal/Code/Current/tendermint-rs/light-client/src/components/io.rs:7:5 | 7 | use tendermint_rpc as rpc; | ^^^^^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `tendermint`: /Users/coromac/Informal/Code/Current/tendermint-rs/target/debug/deps/libtendermint.rlib crate `tendermint`: /Users/coromac/Informal/Code/Current/tendermint-rs/target/debug/deps/libtendermint-735716e8d731096d.rmeta crate `tendermint_rpc`: /Users/coromac/Informal/Code/Current/tendermint-rs/target/debug/deps/libtendermint_rpc-ad41c355acf2752f.rlib error: aborting due to previous error
I had to disable the only previously enabled acceptance test of the light node CLI for the test suite to pass (7c07134). Without this commit,
It is currently unclear why this error has appeared, though I suspect it is a bug in Cargo related to features flags (which we now use to disable non WASM-compatible code). EDIT: The reason for why disabling this test resolves the issue above, is that there is no more a need to rebuild the light node crate to run the light node binary with |
Since the test I had to comment out was just testing that the version number emitted by the |
light-client-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
target: wasm32-unknown-unknown | ||
- name: Build Tendermint for WASM | ||
run: cd tendermint && cargo build --target wasm32-unknown-unknown --release --no-default-features | ||
- name: Build Light Client for WASM | ||
run: cd light-client && cargo build --target wasm32-unknown-unknown --release --no-default-features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wohoooo 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
See: #463
This PR also adds a job to the CI to test that both crates can compile to WASM.