Skip to content
  1. Jun 14, 2022
    • Bastian Köcher's avatar
      wasm-builder: Fix constant re-running of `build.rs` scripts. (#11624) · d70d5892
      Bastian Köcher authored
      Recently we added the wasm binaries to the `rerun-if-changed` list. The problem with that is that
      they have a later mtime than the `invoked.timestamp` file and this file's mtime is used to determine
      if the `build.rs` script needs to be re-run. The solution to this is that we copy the mtime of this
      `invoked.timestamp` file and add it to the wasm binaries. Then cargo/rustc doesn't constantly wants
      to rerun the `build.rs` script.
      d70d5892
  2. Jun 02, 2022
  3. May 04, 2022
  4. Apr 30, 2022
  5. Mar 19, 2022
  6. Feb 14, 2022
    • Bastian Köcher's avatar
      wasm-builder: Support latest nightly (#10837) · 47622d69
      Bastian Köcher authored
      * wasm-builder: Support latest nightly
      
      With latest nightly, aka rust version 1.60+ namespaced features are added. This changes the handling
      of optional dependencies. We currently have features that enable optional dependencies when `std` is
      enabled. This was before no problem, but now the wasm-builder detects them as enabled. To support
      the transition period until 1.60 is released as stable, this pr adds an heuristic to not enable these
      optional crates in the wasm build when they are enabled in the `std` feature. This heuristic fails
      when someones enables these optional dependencies from the outside as well as via the `std` feature,
      however we hope that no one is doing this at the moment. When namespaced features are enabled, these
      dependencies needs to be enabled using `dep:dependency-name` to solve this properly.
      
      https://doc.rust-lang.org/cargo/reference/unstable.html#namespaced-features
      
      * Remove accidentally added features
      47622d69
  7. Feb 02, 2022
  8. Jan 31, 2022
  9. Jan 22, 2022
  10. Jan 21, 2022
    • Bastian Köcher's avatar
      wasm-builder: Improve workspace handling (#10700) · f41ef340
      Bastian Köcher authored
      When building a wasm binary from a different repo inside a local workspace, we did not used the
      correct `Cargo.toml` to find the correct patches and features. The solution to this is to just walk
      up from the target directory until we find the workspace we are currently compiling. If this
      heuristic isn't working, we print a warning and let the user set an env variable
      `WASM_BUILD_WORKSPACE_HINT` to tell the `wasm-builder` where the actual workspace is.
      f41ef340
  11. Jan 03, 2022
  12. Nov 18, 2021
  13. Nov 13, 2021
  14. Nov 10, 2021
    • Benjamin Kampmann's avatar
      Intend to reactivate cargo-unleash check (#10167) · 2168a6d0
      Benjamin Kampmann authored
      * Intend to reactivate cargo-unleash check
      
      It appears the bug it was deactivated for has been resolved a while ago. Trying to reactivate the checks.
      
      * adding missing cargo.toml metadata for BEEFY crates
      
      * fix wrong version reference
      
      * matching up versions
      
      * disable faulty cache
      
      * switching more versions to prerelease
      
      * Revert "disable faulty cache"
      
      This reverts commit 411a12ae444a9695a8bfea4458a868438d870b06.
      
      * bump minor of sc-allocator to fix already-published-issue
      
      * fixup another pre-released dependency problem
      
      * temp switch to latest unleash
      
      * fixing dependency version and features
      
      * prometheus endpoint has also been changed
      
      * fixing proposer metrics versioning
      
      * fixing hex feature for beefy
      
      * fix generate-bags feature selection
      
      * fixup Cargo.lock
      
      * upgrade prometheus dependencies
      
      * missed one
      
      * switch to latest release
      2168a6d0
    • zjb0807's avatar
      Upgrade wasm builder (#10226) · 617e2cc7
      zjb0807 authored
      * add TypeInfo for DispatchTime
      
      * upgrade wasm-builder to Rust 2021
      
      * remove resolver
      
      * revert resolver in virtual workspace
      617e2cc7
  15. Nov 04, 2021
  16. Oct 13, 2021
  17. Oct 04, 2021
  18. Sep 24, 2021
    • Bastian Köcher's avatar
      Prepare UI tests for rust 1.55 (#9637) · 62187b59
      Bastian Köcher authored
      
      
      * Prepare UI tests for rust 1.54
      
      * Delete wrong_page.stderr
      
      * CI: run with a staging CI image
      
      * Revert "CI: run with a staging CI image"
      
      This reverts commit 66f5b00d14b50fd9d8fbf773f7e884f380697591.
      
      * CI: debug, again
      
      * LOG_TARGET is only used in std
      
      * Remove unnecessary unsafe
      
      * Fixes
      
      * Use correct rustc locally
      
      * FMT
      
      * Compile with benchmarking
      
      * Review feedback
      
      * Some ui tests
      
      * I know...
      
      * Fix wasm tests
      
      Co-authored-by: default avatarDenis P <[email protected]>
      Co-authored-by: default avatarthiolliere <[email protected]>
      62187b59
  19. Aug 13, 2021
  20. Aug 11, 2021
  21. Jul 28, 2021
  22. Jul 22, 2021
  23. Jul 21, 2021
    • Bastian Köcher's avatar
      Run cargo fmt on the whole code base (#9394) · 7b56ab15
      Bastian Köcher authored
      * Run cargo fmt on the whole code base
      
      * Second run
      
      * Add CI check
      
      * Fix compilation
      
      * More unnecessary braces
      
      * Handle weights
      
      * Use --all
      
      * Use correct attributes...
      
      * Fix UI tests
      
      * AHHHHHHHHH
      
      * 🤦
      
      * Docs
      
      * Fix compilation
      
      * 🤷
      
      * Please stop
      
      * 🤦
      
       x 2
      
      * More
      
      * make rustfmt.toml consistent with polkadot
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      7b56ab15
  24. Jul 11, 2021
    • Benjamin Kampmann's avatar
      Attempting to fix publishing (#9140) · c78c2892
      Benjamin Kampmann authored
      
      
      * mark template and utils as non-publish
      
      * switch to development version for testing
      
      * activate unleash check
      
      * maybe if I disable all rules...
      
      * Fix isolated compilation of `max-encoded-len-derive` with `syn`
      
      error[E0369]: binary operation `==` cannot be applied to type `syn::Path`
        --> src/lib.rs:88:29
         |
      88 |             .filter(|attr| attr.path == parse_quote!(max_encoded_len_crate))
         |                            --------- ^^ ----------------------------------- _
         |                            |
         |                            syn::Path
      
      error: aborting due to previous error
      
      For more information about this error, try `rustc --explain E0369`.
      Error: could not compile `max-encoded-len-derive`
      
      * WIP: bump changes crates since v3 tag to next breaking
      
      cargo unleash version bump-breaking --changed-since v3.0.0
      cargo unleash version set-pre dev --changed-since v3.0.0
      
      FIXME: Don't modify crates that are not yet released, e.g.
      `max-encoded-len-derive`
      
      * Update lockfile
      
      * WIP: Bump sp-transaction-pool as well
      
      * WIP: Bump sp-offchain as well
      
      * WIP: Bump frame-system-rpc-runtime-api as well
      
      * WIP: Bump sp-authority-discovery as well
      
      * Manually deactivate dev-deps before `cargo unleash check`
      
      Otherwise we run into `Cycle detected` error.
      
      * Bump sp-consensus-slots
      
      * Add missing Cargo.lock change
      
      * Bump sp-consensus-vrf as well
      
      * Bump sp-keyring as well
      
      * Bump sp-consensus-pow as well
      
      * Try to speed up the `unleash-check` job
      
      Previously, the job took 106 minutes - let's see if explicitly
      specifying a `CARGO_TARGET_DIR` will help
      
      * fixup: Ensure the temp target dir exists for unleash check
      
      * Bump pallet-transaction-payment-rpc-runtime-api as well
      
      Needed for Polkadot
      
      * Bump pallet-transaction-payment-rpc as well
      
      Needed for Polkadot
      
      * Try updating crates after patching in the Polkadot CI job
      
      * Use another approach to update patched Substrate crates
      
      * Try to update all sp-core versions in Polkadot CI job
      
      * Simplify sp-core version checking
      
      * Apply another shellcheck lint
      
      * Just do the simplest thing I guess
      
      * Welp don't do --offline then
      
      * Clean up `unleash-check` job triggers
      
      Co-authored-by: default avatarDenis Pisarev <[email protected]>
      
      * Fix a note in unleash-check cache step
      
      * Add a note about temporary optimization in cargo-unleash
      
      * Pin a newer version of cargo-unleash
      
      Co-authored-by: default avatarIgor Matuszewski <[email protected]>
      Co-authored-by: default avatarDenis Pisarev <[email protected]>
      c78c2892
  25. Jun 15, 2021
  26. Jun 07, 2021
    • cheme's avatar
      Compact proof utilities in sp_trie. (#8574) · f01c3966
      cheme authored
      * validation extension in sp_io
      
      * need paths
      
      * arc impl
      
      * missing host function in executor
      
      * io to pkdot
      
      * decode function.
      
      * encode primitive.
      
      * trailing tab
      
      * multiple patch
      
      * fix child trie logic
      
      * restore master versionning
      
      * bench compact proof size
      
      * trie-db 22.3 is needed
      
      * line width
      
      * split line
      
      * fixes for bench (additional root may not be needed as original issue was
      with empty proof).
      
      * revert compact from block size calculation.
      
      * New error type for compression.
      
      * Adding test (incomplete (failing)).
      Also lacking real proof checking (no good primitives in sp-trie crate).
      
      * There is currently no proof recording utility in sp_trie, removing
      test.
      
      * small test of child root in proof without a child proof.
      
      * remove empty test.
      
      * remove non compact proof size
      
      * Missing revert.
      
      * proof method to encode decode.
      f01c3966
  27. Apr 27, 2021
  28. Apr 12, 2021
  29. Apr 07, 2021
  30. Mar 01, 2021
    • Bastian Köcher's avatar
      Init `RuntimeLogger` automatically for each runtime api call (#8128) · 68390d40
      Bastian Köcher authored
      
      
      * Init `RuntimeLogger` automatically for each runtime api call
      
      This pr change the runtime api in such a way to always and automatically
      enable the `RuntimeLogger`. This enables the user to use `log` or
      `tracing` from inside the runtime to create log messages. As logging
      introduces some extra code and especially increases the size of the wasm
      blob. It is advised to disable all logging completely with
      `sp-api/disable-logging` when doing the wasm builds for the on-chain
      wasm runtime.
      
      Besides these changes, the pr also brings most of the logging found in
      frame to the same format "runtime::*".
      
      * Update frame/im-online/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update test-utils/runtime/Cargo.toml
      
      * Fix test
      
      * Don't use tracing in the runtime, as we don't support it :D
      
      * Fixes
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      68390d40
  31. Feb 10, 2021
  32. Jan 04, 2021
    • Bastian Köcher's avatar
      Happy new year (#7814) · e3e651f7
      Bastian Köcher authored
      * Happy new year
      
      Updates the copyright years and fixes wrong license headers.
      
      * Fix the template
      
      * Split HEADER into HEADER-APACHE & HEADER-GPL
      e3e651f7
  33. Nov 24, 2020
    • Bastian Köcher's avatar
      Wasm-builder 3.0 (#7532) · 923cb8ee
      Bastian Köcher authored
      
      
      * 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: default avatarBastian Köcher <[email protected]>
      
      * 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: default avatarAndré Silva <[email protected]>
      
      * Update utils/wasm-builder/src/builder.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      923cb8ee
  34. Oct 19, 2020
    • Bastian Köcher's avatar
      Make `wasm-builder` print the rustc version (#7351) · 23382db1
      Bastian Köcher authored
      * Make `wasm-builder` print the rustc version
      
      This makes `wasm-builder` print the rustc version that is being used to
      compile the project. This is rather useful, because people can check
      faster if the used rustc version is maybe known for being broken with
      Substrate.
      
      * Apply suggestions from code review
      
      * Add some comments
      23382db1
  35. Oct 12, 2020
  36. Sep 15, 2020
    • Bastian Köcher's avatar
      Improve error output of wasm-builder when wasm ins't installed (#7105) · 9dd5812e
      Bastian Köcher authored
      This improves the error message of wasm-builder when the wasm toolchain
      isn't installed. Currently we print that the wasm toolchain is not
      installed, but the actual problem is that there is a bug in the
      packaging in rust. This will now be much easier to debug, by printing
      the full error message of the compiler.
      9dd5812e
  37. Sep 10, 2020
  38. Sep 08, 2020
  39. Jul 22, 2020
    • Wei Tang's avatar
      Better handling of stable-only build (#6569) · ac8de557
      Wei Tang authored
      
      
      * Better handling of stable-only build
      
      * Fix node template build
      
      * Fix wasm builder node-template version mismatch
      
      * Fix load_spec error
      
      * Add , in parameter
      
      * Add descrptive panic messages in tests
      
      * Add descriptive tests in node/executor benches
      
      * Fix missing compact_code_unwrap
      
      * Add missing wasm_binary_unwrap function for executor integration test
      
      * Only define import_sp_io in no_std
      
      * Small Cargo.toml styling fix
      
      * Bump wasm-builder to 2.0.0
      
      * Fix all `with_wasm_builder_from_crates` version in Substrate
      
      * Use `with_wasm_builder_from_crates` for node-template
      
      Co-authored-by: default avatarGavin Wood <[email protected]>
      ac8de557