mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
Wasm-builder 3.0 (#7532)
* Build every wasm crate in its own project with wasm-builder Building all wasm crates in one workspace was a nice idea, however it just introduced problems: 1. We needed to prune old members, but this didn't worked for old git deps. 2. We locked the whole wasm workspace while building one crate. This could lead to infinitely locking the workspace on a crash. Now we just build every crate in its own project, this means we will build the dependencies multiple times. While building the dependencies multiple times, we still decrease the build time by around 30 seconds for Polkadot and Substrate because of the new parallelism ;) * Remove the requirement on wasm-builder-runner This removes the requirement on wasm-builder-runner by using the new `build_dep` feature of cargo. We use nightly anyway and that enables us to use this feature. This solves the problem of not mixing build/proc-macro deps with normal deps. By doing this we get rid off this complicated project structure and can depend directly on `wasm-builder`. This also removes all the code from wasm-builder-runner and mentions that it is deprecated. * Copy the `Cargo.lock` to the correct folder * Remove wasm-builder-runner * Update docs * Fix deterministic check Modified-by: Bastian Köcher <git@kchr.de> * Try to make the ui test happy * Switch to `SKIP_WASM_BUILD` * Rename `SKIP_WASM_BINARY` to the correct name... * Update utils/wasm-builder/src/builder.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Update utils/wasm-builder/src/builder.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -197,7 +197,7 @@ cargo-check-benches:
|
||||
<<: *docker-env
|
||||
<<: *test-refs
|
||||
script:
|
||||
- BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all
|
||||
- SKIP_WASM_BUILD=1 time cargo +nightly check --benches --all
|
||||
- cargo run --release -p node-bench -- ::node::import::native::sr25519::transfer_keep_alive::paritydb::small
|
||||
- cargo run --release -p node-bench -- ::trie::read::small
|
||||
- sccache -s
|
||||
@@ -208,7 +208,7 @@ cargo-check-subkey:
|
||||
<<: *test-refs
|
||||
script:
|
||||
- cd ./bin/utils/subkey
|
||||
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
|
||||
- SKIP_WASM_BUILD=1 time cargo check --release
|
||||
- sccache -s
|
||||
|
||||
test-deterministic-wasm:
|
||||
@@ -222,7 +222,7 @@ test-deterministic-wasm:
|
||||
# build runtime
|
||||
- cargo build --verbose --release -p node-runtime
|
||||
# make checksum
|
||||
- sha256sum target/release/wbuild/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
|
||||
- sha256sum target/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
|
||||
# clean up – FIXME: can we reuse some of the artifacts?
|
||||
- cargo clean
|
||||
# build again
|
||||
@@ -343,7 +343,7 @@ cargo-check-macos:
|
||||
<<: *docker-env
|
||||
<<: *test-refs
|
||||
script:
|
||||
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
|
||||
- SKIP_WASM_BUILD=1 time cargo check --release
|
||||
- sccache -s
|
||||
tags:
|
||||
- osx
|
||||
@@ -451,7 +451,7 @@ build-linux-subkey: &build-subkey
|
||||
- mkdir -p ./artifacts/subkey
|
||||
script:
|
||||
- cd ./bin/utils/subkey
|
||||
- BUILD_DUMMY_WASM_BINARY=1 time cargo build --release --verbose
|
||||
- SKIP_WASM_BUILD=1 time cargo build --release --verbose
|
||||
- cd -
|
||||
- mv ./target/release/subkey ./artifacts/subkey/.
|
||||
- echo -n "Subkey version = "
|
||||
@@ -483,7 +483,7 @@ build-rust-doc:
|
||||
- ./crate-docs/
|
||||
script:
|
||||
- rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds
|
||||
- BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
|
||||
- SKIP_WASM_BUILD=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
|
||||
time cargo +nightly doc --no-deps --workspace --all-features --verbose
|
||||
- mv ./target/doc ./crate-docs
|
||||
- echo "<meta http-equiv=refresh content=0;url=sc_service/index.html>" > ./crate-docs/index.html
|
||||
|
||||
Reference in New Issue
Block a user