From a140f769ad23025b71a6b1118251a5a45bea263f Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 28 Jan 2022 13:48:03 -0800 Subject: [PATCH 1/4] chore: pin Rust versions in CI --- .circleci/config.yml | 5 +- .cirrus.yml | 8 +- .github/workflows/ci.yml | 127 +++++++++++++++++++----------- .github/workflows/loom.yml | 9 ++- .github/workflows/stress-test.yml | 13 ++- 5 files changed, 108 insertions(+), 54 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 397d9357055..7e5b83fbdb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,9 @@ jobs: machine: image: ubuntu-2004:202101-01 resource_class: arm.medium + environment: + # Change to pin rust versino + RUST_STABLE: stable steps: - checkout - run: @@ -11,7 +14,7 @@ jobs: command: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh chmod +x rustup.sh - ./rustup.sh -y + ./rustup.sh -y --default-toolchain $RUST_STABLE source "$HOME"/.cargo/env # Only run Tokio tests - run: cargo test --all-features -p tokio diff --git a/.cirrus.yml b/.cirrus.yml index 1f431b2d201..5916acd96c4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,6 +1,8 @@ freebsd_instance: image: freebsd-12-2-release-amd64 env: + RUST_STABLE: stable + RUST_NIGHTLY: nightly-2022-01-12 RUSTFLAGS: -D warnings # Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the @@ -12,7 +14,7 @@ task: setup_script: - pkg install -y bash curl - curl https://sh.rustup.rs -sSf --output rustup.sh - - sh rustup.sh -y --profile minimal --default-toolchain stable + - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env - | echo "~~~~ rustc --version ~~~~" @@ -29,7 +31,7 @@ task: setup_script: - pkg install -y bash curl - curl https://sh.rustup.rs -sSf --output rustup.sh - - sh rustup.sh -y --profile minimal --default-toolchain nightly-2022-01-12 + - sh rustup.sh -y --profile minimal --default-toolchain $RUST_NIGHTLY - . $HOME/.cargo/env - | echo "~~~~ rustc --version ~~~~" @@ -43,7 +45,7 @@ task: setup_script: - pkg install -y bash curl - curl https://sh.rustup.rs -sSf --output rustup.sh - - sh rustup.sh -y --profile minimal --default-toolchain stable + - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env - rustup target add i686-unknown-freebsd - | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74f5e06863b..c95c19673c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,11 @@ name: CI env: RUSTFLAGS: -Dwarnings RUST_BACKTRACE: 1 - nightly: nightly-2022-01-12 - minrust: 1.46 + # Change to specific Rust release to pin + rust_stable: stable + rust_nightly: nightly-2021-04-25 + rust_clippy: 1.52.0 + rust_min: 1.45.2 defaults: run: @@ -51,6 +54,11 @@ jobs: - macos-latest steps: - uses: actions/checkout@v2 + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - name: Install Rust run: rustup update stable - uses: Swatinem/rust-cache@v1 @@ -96,8 +104,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: Enable parking_lot send_guard feature # Inserts the line "plsend = ["parking_lot/send_guard"]" right after [features] @@ -110,8 +121,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: Install Valgrind @@ -148,10 +162,12 @@ jobs: - macos-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - # Run `tokio` with "unstable" cfg flag. - name: test tokio full --cfg unstable run: cargo test --all-features @@ -164,29 +180,29 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.nightly }} + toolchain: ${{ env.rust_nightly }} + components: miri override: true - uses: Swatinem/rust-cache@v1 - - name: Install Miri + - name: miri run: | set -e - rustup component add miri - cargo miri setup - rm -rf tokio/tests - - - name: miri - run: cargo miri test --features rt,rt-multi-thread,sync task + rm -rf tests + cargo miri test --features rt,rt-multi-thread,sync task working-directory: tokio + san: name: san runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.nightly }} + toolchain: ${{ env.rust_nightly }} override: true - uses: Swatinem/rust-cache@v1 - name: asan @@ -209,9 +225,10 @@ jobs: - arm-linux-androideabi steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ env.rust_stable }} target: ${{ matrix.target }} override: true - uses: Swatinem/rust-cache@v1 @@ -226,17 +243,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.nightly }} + toolchain: ${{ env.rust_nightly }} + target: ${{ matrix.target }} override: true - uses: Swatinem/rust-cache@v1 - name: Install cargo-hack run: cargo install cargo-hack - - name: check --each-feature run: cargo hack check --all --each-feature -Z avoid-dev-deps - # Try with unstable feature flags - name: check --each-feature --unstable run: cargo hack check --all --each-feature -Z avoid-dev-deps @@ -248,9 +265,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_min }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.minrust }} + toolchain: ${{ env.rust_min }} override: true - uses: Swatinem/rust-cache@v1 - name: "test --workspace --all-features" @@ -261,9 +279,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.nightly }} + toolchain: ${{ env.rust_nightly }} override: true - uses: Swatinem/rust-cache@v1 - name: Install cargo-hack @@ -292,10 +311,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true + components: rustfmt - uses: Swatinem/rust-cache@v1 - # Check fmt - name: "rustfmt --check" # Workaround for rust-lang/cargo#7732 @@ -310,12 +332,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update 1.57 && rustup default 1.57 + - name: Install Rust ${{ env.rust_clippy }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_clippy }} + override: true + components: clippy - uses: Swatinem/rust-cache@v1 - - name: Install clippy - run: rustup component add clippy - # Run clippy - name: "clippy --all" run: cargo clippy --all --tests --all-features @@ -325,9 +348,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.nightly }} + toolchain: ${{ env.rust_nightly }} override: true - uses: Swatinem/rust-cache@v1 - name: "doc --lib --all-features" @@ -341,11 +365,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: build --cfg loom run: cargo test --no-run --lib --features full + - name: loom ${{ matrix.scope }} + run: cargo test --lib --release --features full -- --nocapture $SCOPE working-directory: tokio env: RUSTFLAGS: --cfg loom --cfg tokio_unstable -Dwarnings @@ -373,8 +402,11 @@ jobs: - macos-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: Test hyper run: | @@ -398,8 +430,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh diff --git a/.github/workflows/loom.yml b/.github/workflows/loom.yml index fde9f1114e1..83a6743cb17 100644 --- a/.github/workflows/loom.yml +++ b/.github/workflows/loom.yml @@ -10,6 +10,8 @@ name: Loom env: RUSTFLAGS: -Dwarnings RUST_BACKTRACE: 1 + # Change to specific Rust release to pin + rust_stable: stable jobs: loom: @@ -28,8 +30,11 @@ jobs: - time::driver steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: loom ${{ matrix.scope }} run: cargo test --lib --release --features full -- --nocapture $SCOPE diff --git a/.github/workflows/stress-test.yml b/.github/workflows/stress-test.yml index 3619d419742..a6a24fdea14 100644 --- a/.github/workflows/stress-test.yml +++ b/.github/workflows/stress-test.yml @@ -5,6 +5,12 @@ on: branches: - master +env: + RUSTFLAGS: -Dwarnings + RUST_BACKTRACE: 1 + # Change to specific Rust release to pin + rust_stable: stable + jobs: stess-test: name: Stress Test @@ -15,8 +21,11 @@ jobs: - simple_echo_tcp steps: - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable + - name: Install Rust ${{ env.rust_stable }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_stable }} + override: true - uses: Swatinem/rust-cache@v1 - name: Install Valgrind run: | From 77e2e9242f25f95b7ccfcefc06825dae60d3323b Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 29 Jan 2022 14:36:08 -0800 Subject: [PATCH 2/4] fix MSRV --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c95c19673c4..1ef4e5bc48f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ env: rust_stable: stable rust_nightly: nightly-2021-04-25 rust_clippy: 1.52.0 - rust_min: 1.45.2 + rust_min: 1.46.0 defaults: run: From fbe8c5bee61445d87bc27a91c2feba8697421e30 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 29 Jan 2022 14:41:09 -0800 Subject: [PATCH 3/4] fix nightly version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ef4e5bc48f..e36062e9eb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ env: RUST_BACKTRACE: 1 # Change to specific Rust release to pin rust_stable: stable - rust_nightly: nightly-2021-04-25 + rust_nightly: nightly-2022-01-12 rust_clippy: 1.52.0 rust_min: 1.46.0 From 81d83535398f2221a607c6a7c3def0b3663183d4 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 29 Jan 2022 17:56:43 -0800 Subject: [PATCH 4/4] fix merge conflict fail --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36062e9eb3..1eac009b53d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,8 +373,6 @@ jobs: - uses: Swatinem/rust-cache@v1 - name: build --cfg loom run: cargo test --no-run --lib --features full - - name: loom ${{ matrix.scope }} - run: cargo test --lib --release --features full -- --nocapture $SCOPE working-directory: tokio env: RUSTFLAGS: --cfg loom --cfg tokio_unstable -Dwarnings