diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 50a40ef10a..24711cd17e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,13 +14,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - # Toolchain is autodetected from `rust-toolchain` file - # https://github.com/actions-rs/toolchain#the-toolchain-file - #toolchain: ${{ env.WASM_BUILD_TOOLCHAIN }} - default: true + # With rustup's nice new toml format, we just need to run rustup show to install the toolchain + # https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 + - name: Setup Rust toolchain + run: rustup show - uses: actions/cache@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55d5d4cdb7..04721e19f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,13 +127,12 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ runner.OS }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - # Toolchain is autodetected from `rust-toolchain` file - # https://github.com/actions-rs/toolchain#the-toolchain-file - #toolchain: ${{ env.WASM_BUILD_TOOLCHAIN }} - default: true + + # With rustup's nice new toml format, we just need to run rustup show to install the toolchain + # https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 + - name: Setup Rust toolchain + run: rustup show + - name: Install sccache run: | if [ ! -f ${{ runner.tool_cache }}/cargo-sccache/bin/sccache ]; then diff --git a/README.md b/README.md index be5e0eb732..85a60787d2 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,6 @@ need a refresher setting up your Substrate environment, see [Substrate's Getting git clone https://github.com/PureStake/moonbeam cd moonbeam -# Optional: Ensure you have the exact nightly toolchain used by Moonbeam's CI -./scripts/init.sh - # Build the node (The first build will be long (~30min)) cargo build --release ``` diff --git a/docker/polkadot-relay.Dockerfile b/docker/polkadot-relay.Dockerfile index 06f5d0c741..20a0930be8 100644 --- a/docker/polkadot-relay.Dockerfile +++ b/docker/polkadot-relay.Dockerfile @@ -27,7 +27,6 @@ RUN sed -i '/sc_executor::WasmExecutionMethod::Interpreted/c\\t\tsc_executor::Wa # Download rust dependencies and build the rust binary RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ export PATH=$PATH:$HOME/.cargo/bin && \ - scripts/init.sh && \ cargo build --$PROFILE --features=real-overseer # ===== SECOND STAGE ====== diff --git a/rust-toolchain b/rust-toolchain index 8895ad9465..726f81ab67 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1,5 @@ -nightly-2021-01-13 +[toolchain] +channel = "nightly-2021-01-13" +components = [ "rustfmt", "clippy" ] +targets = [ "wasm32-unknown-unknown" ] +profile = "minimal" diff --git a/scripts/init.sh b/scripts/init.sh deleted file mode 100755 index 791232afd9..0000000000 --- a/scripts/init.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $HOME/.cargo/env - -echo "*** Initializing WASM build environment" - -# TODO: 'rust-toolchain' is allowed to be a TOML file: -# https://github.com/rust-lang/rustup/blob/master/doc/src/overrides.md#the-toolchain-file -RUST_NIGHTLY_VERSION=$(cat rust-toolchain) - -if [ -z ${WASM_BUILD_TOOLCHAIN+x} ]; then - WASM_BUILD_TOOLCHAIN=$RUST_NIGHTLY_VERSION -fi - -if [ -z $CI_PROJECT_NAME ] ; then - rustup update $WASM_BUILD_TOOLCHAIN - rustup update stable -fi - -rustup component add clippy - -rustup target add wasm32-unknown-unknown --toolchain $WASM_BUILD_TOOLCHAIN