From 9943acda81e19563c9f35ad2426e473732760e75 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 24 Jul 2020 16:28:24 -0700 Subject: [PATCH] chore: complete CI migration to Github Actions (#2680) --- .cirrus.yml | 12 -- .github/workflows/ci.yml | 222 ++++++++++++++++++++++++++++ .github/workflows/test_tokio.yml | 129 ---------------- azure-pipelines.yml | 121 --------------- ci/azure-cargo-check.yml | 29 ---- ci/azure-check-docs.yml | 15 -- ci/azure-check-features.yml | 38 ----- ci/azure-check-minrust.yml | 14 -- ci/azure-clippy.yml | 16 -- ci/azure-cross-compile.yml | 44 ------ ci/azure-deploy-docs.yml | 39 ----- ci/azure-install-rust.yml | 40 ----- ci/azure-is-release.yml | 9 -- ci/azure-loom.yml | 29 ---- ci/azure-miri.yml | 23 --- ci/azure-patch-crates.yml | 16 -- ci/azure-rustfmt.yml | 18 --- ci/azure-test-build.yml | 17 --- ci/azure-test-integration.yml | 28 ---- ci/azure-test-nightly.yml | 19 --- ci/azure-test-stable.yml | 64 -------- ci/azure-tsan.yml | 34 ----- ci/patch.toml | 7 - ci/tsan | 39 ----- tokio/src/io/util/async_read_ext.rs | 4 +- tokio/src/time/tests/test_delay.rs | 2 - 26 files changed, 225 insertions(+), 803 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test_tokio.yml delete mode 100644 azure-pipelines.yml delete mode 100644 ci/azure-cargo-check.yml delete mode 100644 ci/azure-check-docs.yml delete mode 100644 ci/azure-check-features.yml delete mode 100644 ci/azure-check-minrust.yml delete mode 100644 ci/azure-clippy.yml delete mode 100644 ci/azure-cross-compile.yml delete mode 100644 ci/azure-deploy-docs.yml delete mode 100644 ci/azure-install-rust.yml delete mode 100644 ci/azure-is-release.yml delete mode 100644 ci/azure-loom.yml delete mode 100644 ci/azure-miri.yml delete mode 100644 ci/azure-patch-crates.yml delete mode 100644 ci/azure-rustfmt.yml delete mode 100644 ci/azure-test-build.yml delete mode 100644 ci/azure-test-integration.yml delete mode 100644 ci/azure-test-nightly.yml delete mode 100644 ci/azure-test-stable.yml delete mode 100644 ci/azure-tsan.yml delete mode 100644 ci/patch.toml delete mode 100644 ci/tsan diff --git a/.cirrus.yml b/.cirrus.yml index 7a5f9a6d6..fa035e81c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -19,18 +19,6 @@ task: - | echo "~~~~ rustc --version ~~~~" rustc --version - - # Remove any existing patch statements - mv Cargo.toml Cargo.toml.bck - sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml - - # Patch all crates - cat ci/patch.toml >> Cargo.toml - - # Print `Cargo.toml` for debugging - echo "~~~~ Cargo.toml ~~~~" - cat Cargo.toml - echo "~~~~~~~~~~~~~~~~~~~~" test_script: - . $HOME/.cargo/env - cargo test --all diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..33ac957cd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,222 @@ +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +name: CI + +env: + RUSTFLAGS: -Dwarnings + RUST_BACKTRACE: 1 + nightly: nightly-2020-07-12 + minrust: 1.39.0 + +jobs: + test: + name: test tokio full + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + - macos-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + - name: Install cargo-hack + run: cargo install cargo-hack + + # Run `tokio` with `full` features. This excludes testing utilities which + # can alter the runtime behavior of Tokio. + - name: test tokio full + run: cargo test --features full + working-directory: tokio + + # Check `tokio` with `full + parking_lot` to make sure it compiles. + - name: check tokio full,parking_lot + run: cargo check --features full,parking_lot + working-directory: tokio + + # Test **all** crates in the workspace with all features. + - name: test all --all-features + run: cargo test --workspace --all-features + + # Run integration tests for each feature + - name: test tests-integration --each-feature + run: cargo hack test --each-feature + working-directory: tests-integration + + # Run macro build tests + - name: test tests-build --each-feature + run: cargo hack test --each-feature + working-directory: tests-build + + test-unstable: + name: test tokio full --unstable + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + - macos-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + + # Run `tokio` with "unstable" cfg flag. + - name: test tokio full --cfg unstable + run: cargo test --features full + working-directory: tokio + env: + RUSTFLAGS: '--cfg tokio_unstable' + + miri: + name: miri + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.nightly }} + override: true + - name: Install Miri + run: | + set -e + rustup component add miri + cargo miri setup + rm -rf tokio/tests + + - name: miri + run: cargo miri test --features rt-core,rt-threaded,rt-util,sync -- -- task + working-directory: tokio + + cross: + name: cross + runs-on: ubuntu-latest + strategy: + matrix: + target: + - i686-unknown-linux-gnu + - powerpc-unknown-linux-gnu + - powerpc64-unknown-linux-gnu + - mips-unknown-linux-gnu + - arm-linux-androideabi + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + - uses: actions-rs/cargo@v1 + with: + use-cross: true + command: check + args: --workspace --target ${{ matrix.target }} + + features: + name: features + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.nightly }} + override: true + - 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 + env: + RUSTFLAGS: --cfg tokio_unstable + + minrust: + name: minrust + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.minrust }} + override: true + + - name: "test --workspace --all-features" + run: cargo check --workspace --all-features + + fmt: + name: fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + - name: Install rustfmt + run: rustup component add rustfmt + + # Check fmt + - name: "rustfmt --check" + # Workaround for rust-lang/cargo#7732 + run: rustfmt --check --edition 2018 $(find . -name '*.rs' -print) + + clippy: + name: clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + - name: Install clippy + run: rustup component add clippy + + # Run clippy + - name: "clippy --all" + run: cargo clippy --all --tests + + docs: + name: docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.nightly }} + override: true + + - name: "doc --lib --all-features" + run: cargo doc --lib --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs + + loom: + name: loom + runs-on: ubuntu-latest + strategy: + matrix: + scope: + - --skip loom_pool + - loom_pool::group_a + - loom_pool::group_b + - loom_pool::group_c + - loom_pool::group_d + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update stable + + - name: loom ${{ matrix.scope }} + run: cargo test --lib --release --features full -- --nocapture $SCOPE + working-directory: tokio + env: + RUSTFLAGS: --cfg loom --cfg tokio_unstable + LOOM_MAX_PREEMPTIONS: 2 + SCOPE: ${{ matrix.scope }} diff --git a/.github/workflows/test_tokio.yml b/.github/workflows/test_tokio.yml deleted file mode 100644 index d6d32b8f5..000000000 --- a/.github/workflows/test_tokio.yml +++ /dev/null @@ -1,129 +0,0 @@ -on: - push: - branches: ["master"] - pull_request: - branches: ["master"] - -name: Test tokio - -env: - RUSTFLAGS: -Dwarnings - RUST_BACKTRACE: 1 - nightly: nightly-2020-01-25 - -jobs: - test_tokio: - name: Test tokio full - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - windows-latest - - ubuntu-latest - - macos-latest - steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable - - # Run `tokio` with only `full` - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path ${{ github.workspace }}/tokio/Cargo.toml --features full - name: tokio - cargo test --features full - - # Run `tokio` with "unstable" cfg flag - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path ${{ github.workspace }}/tokio/Cargo.toml --features full - env: - RUSTFLAGS: '--cfg tokio_unstable' - name: tokio - cargo test --features full --cfg tokio_unstable - - test_cross_subcrates: - name: Test ${{ matrix.crate }} (${{ matrix.os }}) all-features - runs-on: ${{ matrix.os }} - strategy: - matrix: - crate: - - tokio - - tests-integration - os: - - windows-latest - - ubuntu-latest - - macos-latest - include: - - crate: tokio-macros - os: ubuntu-latest - - crate: tokio-test - os: ubuntu-latest - - crate: tokio-util - os: ubuntu-latest - - crate: examples - os: ubuntu-latest - - steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable - - # Run with all crate features - - name: ${{ matrix.crate }} - cargo test --all-features - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path ${{ github.workspace }}/${{ matrix.crate }}/Cargo.toml --all-features - - # Check benches - - name: ${{ matrix.crate }} - cargo check --benches - uses: actions-rs/cargo@v1 - with: - command: check - args: --manifest-path ${{ github.workspace }}/${{ matrix.crate }}/Cargo.toml --all-features --benches - - - name: Patch Cargo.toml - shell: bash - run: | - set -e - - # Remove any existing patch statements - mv Cargo.toml Cargo.toml.bck - sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml - - # Patch all crates - cat ci/patch.toml >> Cargo.toml - - # Print `Cargo.toml` for debugging - echo "~~~~ Cargo.toml ~~~~" - cat Cargo.toml - echo "~~~~~~~~~~~~~~~~~~~~" - - # Run with all crate features - - name: ${{ matrix.crate }} - cargo test --all-features - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path ${{ github.workspace }}/${{ matrix.crate }}/Cargo.toml --all-features - - test_integration: - name: Integration tests - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - windows-latest - - ubuntu-latest - - macos-latest - steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable - - run: cargo install cargo-hack - name: Install cargo-hack - - uses: actions-rs/cargo@v1 - name: cargo hack test --each-feature - with: - command: hack - args: test --manifest-path ${{ github.workspace }}/tests-integration/Cargo.toml --each-feature diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ba0b9da38..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,121 +0,0 @@ -trigger: ["master"] -pr: ["master"] - -variables: - RUSTFLAGS: -Dwarnings - nightly: nightly-2020-05-29 - -jobs: -# Test top level crate -- template: ci/azure-test-stable.yml - parameters: - name: test_tokio - rust: stable - displayName: Test tokio - cross: true - crates: - - tokio - - tests-integration - -# Test sub crates -- template: ci/azure-test-stable.yml - parameters: - name: test_linux - displayName: Test sub crates - - rust: stable - crates: - - tokio-macros - - tokio-test - - tokio-util - - examples - -# Run integration tests -- template: ci/azure-test-integration.yml - parameters: - name: test_integration - displayName: Integration tests - rust: stable - -# Run tests from `tests-build`. This requires a different process -- template: ci/azure-test-build.yml - parameters: - name: test_build - displayName: Test build permutations - rust: stable - -# Run miri tests -- template: ci/azure-miri.yml - parameters: - name: miri - rust: $(nightly) - -# Try cross compiling -- template: ci/azure-cross-compile.yml - parameters: - name: cross - rust: stable - -# Check each feature works properly -- template: ci/azure-check-features.yml - parameters: - rust: $(nightly) - name: check_features - -# This represents the minimum Rust version supported by -# Tokio. Updating this should be done in a dedicated PR and -# cannot be greater than two 0.x releases prior to the -# current stable. -# -# Tests are not run as tests may require newer versions of -# rust. -- template: ci/azure-check-minrust.yml - parameters: - name: minrust - rust: 1.39.0 - -# Check formatting -- template: ci/azure-rustfmt.yml - parameters: - rust: stable - name: rustfmt - -# Apply clippy lints to all crates -- template: ci/azure-clippy.yml - parameters: - rust: stable - name: clippy - -# Check doc generation -- template: ci/azure-check-docs.yml - parameters: - rust: $(nightly) - name: docs - -# - template: ci/azure-tsan.yml -# parameters: -# name: tsan -# rust: stable - -# Run loom tests -- template: ci/azure-loom.yml - parameters: - name: loom - rust: stable - -- template: ci/azure-deploy-docs.yml - parameters: - rust: stable - dependsOn: - - rustfmt - - docs - - clippy - - test_tokio - - test_linux - - test_integration - - test_build - - loom - - miri - - cross - - minrust - - check_features -# - tsan diff --git a/ci/azure-cargo-check.yml b/ci/azure-cargo-check.yml deleted file mode 100644 index 5bf7af201..000000000 --- a/ci/azure-cargo-check.yml +++ /dev/null @@ -1,29 +0,0 @@ -parameters: - noDefaultFeatures: '--no-default-features' - -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-is-release.yml - - - ${{ each crate in parameters.crates }}: - - ${{ each feature in crate.value }}: - - script: cargo check ${{ parameters.noDefaultFeatures }} --features ${{ feature }} - displayName: Check `${{ crate.key }}`, features = ${{ feature }} - workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }} - condition: and(succeeded(), not(variables['isRelease'])) - - - template: azure-patch-crates.yml - - - ${{ each crate in parameters.crates }}: - - ${{ each feature in crate.value }}: - - script: cargo check ${{ parameters.noDefaultFeatures }} --features ${{ feature }} - displayName: Check `${{ crate.key }}`, features = ${{ feature }} - workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }} diff --git a/ci/azure-check-docs.yml b/ci/azure-check-docs.yml deleted file mode 100644 index 6f94f339e..000000000 --- a/ci/azure-check-docs.yml +++ /dev/null @@ -1,15 +0,0 @@ -jobs: -# Check docs -- job: ${{ parameters.name }} - displayName: Check docs - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: | - RUSTDOCFLAGS="--cfg docsrs" cargo doc --lib --no-deps --all-features - displayName: Check docs - diff --git a/ci/azure-check-features.yml b/ci/azure-check-features.yml deleted file mode 100644 index 989213005..000000000 --- a/ci/azure-check-features.yml +++ /dev/null @@ -1,38 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: Check features - strategy: - matrix: - Linux: - vmImage: ubuntu-16.04 - MacOS: - vmImage: macos-latest - Windows: - vmImage: vs2017-win2016 - pool: - vmImage: $(vmImage) - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-patch-crates.yml - - - script: cargo install cargo-hack - displayName: Install cargo-hack - - # Check each feature works properly - # * --each-feature - # run for each feature which includes --no-default-features and default features of package - # * -Z avoid-dev-deps - # build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866 - # tracking-issue: https://github.com/rust-lang/cargo/issues/5133 - - script: cargo hack check --all --each-feature -Z avoid-dev-deps - displayName: cargo hack check --all --each-feature - - # Try with unstable feature flags - - script: cargo hack check --all --each-feature -Z avoid-dev-deps - displayName: cargo hack check --all --each-feature - env: - RUSTFLAGS: '--cfg tokio_unstable' diff --git a/ci/azure-check-minrust.yml b/ci/azure-check-minrust.yml deleted file mode 100644 index 1a28f53bd..000000000 --- a/ci/azure-check-minrust.yml +++ /dev/null @@ -1,14 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: Min supported Rust version - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-patch-crates.yml - - - script: cargo check --all - displayName: cargo check --all diff --git a/ci/azure-clippy.yml b/ci/azure-clippy.yml deleted file mode 100644 index b843223f4..000000000 --- a/ci/azure-clippy.yml +++ /dev/null @@ -1,16 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: Clippy - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - script: | - rustup component add clippy - cargo clippy --version - displayName: Install clippy - - script: | - cargo clippy --all --all-features --tests - displayName: cargo clippy --all --tests diff --git a/ci/azure-cross-compile.yml b/ci/azure-cross-compile.yml deleted file mode 100644 index 11c530ca1..000000000 --- a/ci/azure-cross-compile.yml +++ /dev/null @@ -1,44 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - strategy: - matrix: - i686: - vmImage: ubuntu-16.04 - target: i686-unknown-linux-gnu - powerpc: - vmImage: ubuntu-16.04 - target: powerpc-unknown-linux-gnu - powerpc64: - vmImage: ubuntu-16.04 - target: powerpc64-unknown-linux-gnu - mips: - vmImage: ubuntu-16.04 - target: mips-unknown-linux-gnu - arm: - vmImage: ubuntu-16.04 - target: arm-linux-androideabi - pool: - vmImage: $(vmImage) - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: sudo apt-get update - displayName: apt-get update - - - script: sudo apt-get install gcc-multilib - displayName: Install gcc-multilib - - - script: cargo install cross - displayName: Install cross - - # Always patch - - template: azure-patch-crates.yml - - - script: cross check --all --target $(target) - displayName: Check source - - # - script: cross check --tests --all --target $(target) - # displayName: Check tests diff --git a/ci/azure-deploy-docs.yml b/ci/azure-deploy-docs.yml deleted file mode 100644 index 77ec1b0f6..000000000 --- a/ci/azure-deploy-docs.yml +++ /dev/null @@ -1,39 +0,0 @@ -parameters: - dependsOn: [] - -jobs: -- job: documentation - displayName: 'Deploy API Documentation' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - pool: - vmImage: 'Ubuntu 16.04' - dependsOn: - - ${{ parameters.dependsOn }} - steps: - - template: azure-install-rust.yml - parameters: - # rust_version: stable - rust_version: ${{ parameters.rust }} - - script: | - cargo doc --all --no-deps --all-features - cp -R target/doc '$(Build.BinariesDirectory)' - displayName: 'Generate Documentation' - - script: | - set -e - - git --version - ls -la - git init - git config user.name 'Deployment Bot (from Azure Pipelines)' - git config user.email 'deploy@tokio-rs.com' - git config --global credential.helper 'store --file ~/.my-credentials' - printf "protocol=https\nhost=github.com\nusername=carllerche\npassword=%s\n\n" "$GITHUB_TOKEN" | git credential-store --file ~/.my-credentials store - git remote add origin https://github.com/tokio-rs/tokio - git checkout -b gh-pages - git add . - git commit -m 'Deploy Tokio API documentation' - git push -f origin gh-pages - env: - GITHUB_TOKEN: $(githubPersonalToken) - workingDirectory: '$(Build.BinariesDirectory)' - displayName: 'Deploy Documentation' diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml deleted file mode 100644 index 4cf5ca3f9..000000000 --- a/ci/azure-install-rust.yml +++ /dev/null @@ -1,40 +0,0 @@ -steps: - # Linux and macOS. - - script: | - set -e - - if [ "$RUSTUP_TOOLCHAIN" == "nightly" ]; then - echo "++ getting latest miri version" - export RUSTUP_TOOLCHAIN="nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" - echo "$RUSTUP_TOOLCHAIN" - fi - - curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain none - export PATH=$PATH:$HOME/.cargo/bin - rustup toolchain install $RUSTUP_TOOLCHAIN - rustup default $RUSTUP_TOOLCHAIN - echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" - env: - RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} - displayName: "Install rust (*nix)" - condition: not(eq(variables['Agent.OS'], 'Windows_NT')) - - # Windows. - - script: | - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y --profile minimal --default-toolchain none - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - rustup toolchain install %RUSTUP_TOOLCHAIN% - rustup default %RUSTUP_TOOLCHAIN% - echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" - env: - RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} - displayName: "Install rust (windows)" - condition: eq(variables['Agent.OS'], 'Windows_NT') - - # All platforms. - - script: | - rustup toolchain list - rustc -Vv - cargo -V - displayName: Query rust and cargo versions diff --git a/ci/azure-is-release.yml b/ci/azure-is-release.yml deleted file mode 100644 index d7271b345..000000000 --- a/ci/azure-is-release.yml +++ /dev/null @@ -1,9 +0,0 @@ -steps: - - bash: | - set -e - - if git log --no-merges -1 --format='%B' | grep -qF '[ci-release]'; then - echo "##vso[task.setvariable variable=isRelease]true" - fi - failOnStderr: true - displayName: Check if release commit diff --git a/ci/azure-loom.yml b/ci/azure-loom.yml deleted file mode 100644 index df02711bb..000000000 --- a/ci/azure-loom.yml +++ /dev/null @@ -1,29 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: Loom tests - strategy: - matrix: - rest: - scope: --skip loom_pool - pool_group_a: - scope: loom_pool::group_a - pool_group_b: - scope: loom_pool::group_b - pool_group_c: - scope: loom_pool::group_c - pool_group_d: - scope: loom_pool::group_d - pool: - vmImage: ubuntu-16.04 - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: RUSTFLAGS="--cfg loom --cfg tokio_unstable" cargo test --lib --release --features "full" -- --nocapture $(scope) - env: - LOOM_MAX_PREEMPTIONS: 2 - CI: 'True' - displayName: $(scope) - workingDirectory: $(Build.SourcesDirectory)/tokio diff --git a/ci/azure-miri.yml b/ci/azure-miri.yml deleted file mode 100644 index 05bc973b2..000000000 --- a/ci/azure-miri.yml +++ /dev/null @@ -1,23 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: Miri - pool: - vmImage: ubuntu-16.04 - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: | - rustup component add miri - cargo miri setup - rm -rf $(Build.SourcesDirectory)/tokio/tests - displayName: Install miri - - # TODO: enable all tests once they pass - - script: cargo miri test --features rt-core,rt-threaded,rt-util,sync -- -- task - env: - CI: 'True' - displayName: cargo miri test - workingDirectory: $(Build.SourcesDirectory)/tokio diff --git a/ci/azure-patch-crates.yml b/ci/azure-patch-crates.yml deleted file mode 100644 index 7bf96e602..000000000 --- a/ci/azure-patch-crates.yml +++ /dev/null @@ -1,16 +0,0 @@ -steps: - - script: | - set -e - - # Remove any existing patch statements - mv Cargo.toml Cargo.toml.bck - sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml - - # Patch all crates - cat ci/patch.toml >> Cargo.toml - - # Print `Cargo.toml` for debugging - echo "~~~~ Cargo.toml ~~~~" - cat Cargo.toml - echo "~~~~~~~~~~~~~~~~~~~~" - displayName: Patch Cargo.toml diff --git a/ci/azure-rustfmt.yml b/ci/azure-rustfmt.yml deleted file mode 100644 index f8e79d720..000000000 --- a/ci/azure-rustfmt.yml +++ /dev/null @@ -1,18 +0,0 @@ -jobs: -# Check formatting -- job: ${{ parameters.name }} - displayName: Check rustfmt - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - script: | - rustup component add rustfmt - cargo fmt --version - displayName: Install rustfmt - - script: | - # Workaround for rust-lang/cargo#7732 - rustfmt --check --edition 2018 $(find . -name '*.rs' -print) - displayName: Check formatting diff --git a/ci/azure-test-build.yml b/ci/azure-test-build.yml deleted file mode 100644 index 944b9e24f..000000000 --- a/ci/azure-test-build.yml +++ /dev/null @@ -1,17 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - pool: - vmImage: 'Ubuntu 16.04' - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: cargo install cargo-hack - displayName: Install cargo-hack - - - script: cargo hack test --each-feature - displayName: cargo hack test --each-feature - workingDirectory: $(Build.SourcesDirectory)/tests-build diff --git a/ci/azure-test-integration.yml b/ci/azure-test-integration.yml deleted file mode 100644 index f498a6496..000000000 --- a/ci/azure-test-integration.yml +++ /dev/null @@ -1,28 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - strategy: - matrix: - Linux: - vmImage: ubuntu-16.04 - MacOS: - vmImage: macos-latest - Windows: - vmImage: vs2017-win2016 - pool: - vmImage: $(vmImage) - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - script: cargo install cargo-hack - displayName: Install cargo-hack - - # Run with all crate features - - script: cargo hack test --each-feature - env: - CI: 'True' - displayName: cargo hack test --each-feature - workingDirectory: $(Build.SourcesDirectory)/tests-integration diff --git a/ci/azure-test-nightly.yml b/ci/azure-test-nightly.yml deleted file mode 100644 index bbb444426..000000000 --- a/ci/azure-test-nightly.yml +++ /dev/null @@ -1,19 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - pool: - vmImage: ubuntu-16.04 - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-patch-crates.yml - - - script: cargo check --all - displayName: cargo check --all - - # Check benches - - script: cargo check --benches --all - displayName: Check benchmarks diff --git a/ci/azure-test-stable.yml b/ci/azure-test-stable.yml deleted file mode 100644 index 55aa84e09..000000000 --- a/ci/azure-test-stable.yml +++ /dev/null @@ -1,64 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - strategy: - matrix: - Linux: - vmImage: ubuntu-16.04 - - ${{ if parameters.cross }}: - MacOS: - vmImage: macos-latest - Windows: - vmImage: vs2017-win2016 - pool: - vmImage: $(vmImage) - - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-is-release.yml - - # Run `tokio` with only `full` - - script: cargo test --features full - env: - RUST_BACKTRACE: 1 - CI: 'True' - displayName: tokio - cargo test --features full - workingDirectory: $(Build.SourcesDirectory)/tokio - - # Run `tokio` with "unstable" cfg flag - - script: cargo test --all-features - env: - RUSTFLAGS: '--cfg tokio_unstable' - RUST_BACKTRACE: 1 - CI: 'True' - displayName: tokio - cargo test --features full - workingDirectory: $(Build.SourcesDirectory)/tokio - - - ${{ each crate in parameters.crates }}: - # Run with all crate features - - script: cargo test --all-features - env: - RUST_BACKTRACE: 1 - CI: 'True' - displayName: ${{ crate }} - cargo test --all-features - workingDirectory: $(Build.SourcesDirectory)/${{ crate }} - - # Check benches - - script: cargo check --all-features --benches - displayName: ${{ crate }} - cargo check --benches - workingDirectory: $(Build.SourcesDirectory)/${{ crate }} - - - template: azure-patch-crates.yml - - - ${{ each crate in parameters.crates }}: - # Run with all crate features - - script: cargo test --all-features - env: - RUST_BACKTRACE: 1 - CI: 'True' - displayName: ${{ crate }} - cargo test --all-features - workingDirectory: $(Build.SourcesDirectory)/${{ crate }} diff --git a/ci/azure-tsan.yml b/ci/azure-tsan.yml deleted file mode 100644 index 0104697e1..000000000 --- a/ci/azure-tsan.yml +++ /dev/null @@ -1,34 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - displayName: TSAN - strategy: - matrix: - Timer: - cmd: cargo test -p tokio-timer --test hammer - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - parameters: - rust_version: ${{ parameters.rust }} - - - template: azure-patch-crates.yml - - script: | - set -e - - # Make sure the benchmarks compile - export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0" - export TSAN_OPTIONS="suppressions=`pwd`/ci/tsan" - export RUST_BACKTRACE=1 - - # Run address sanitizer - RUSTFLAGS="-Z sanitizer=address" \ - $(cmd) --target x86_64-unknown-linux-gnu - - # Run thread sanitizer - RUSTFLAGS="-Z sanitizer=thread" \ - $(cmd) --target x86_64-unknown-linux-gnu - displayName: TSAN / MSAN - env: - TSAN: yes - diff --git a/ci/patch.toml b/ci/patch.toml deleted file mode 100644 index 1650e3b1d..000000000 --- a/ci/patch.toml +++ /dev/null @@ -1,7 +0,0 @@ -# Patch dependencies to run all tests against versions of the crate in the -# repository. -[patch.crates-io] -tokio = { path = "tokio" } -tokio-macros = { path = "tokio-macros" } -tokio-test = { path = "tokio-test" } -tokio-util = { path = "tokio-util" } diff --git a/ci/tsan b/ci/tsan deleted file mode 100644 index 3791c2703..000000000 --- a/ci/tsan +++ /dev/null @@ -1,39 +0,0 @@ -# TSAN suppressions file for Tokio - -# TSAN does not understand fences and `Arc::drop` is implemented using a fence. -# This causes many false positives. -race:Arc*drop -race:Weak*drop - -# `std` mpsc is not used in any Tokio code base. This race is triggered by some -# rust runtime logic. -race:std*mpsc_queue -race:std*lang_start -race:drop*std::thread* - -# Probably more fences in std. -race:__call_tls_dtors - -# The epoch-based GC uses fences. -race:crossbeam_epoch - -# Push and steal operations in crossbeam-deque may cause data races, but such -# data races are safe. If a data race happens, the value read by `steal` is -# forgotten and the steal operation is then retried. -race:crossbeam_deque*push -race:crossbeam_deque*steal - -# This filters out expected data race in the Treiber stack implementations. -# Treiber stacks are inherently racy. The pop operation will attempt to access -# the "next" pointer on the node it is attempting to pop. However, at this -# point it has not gained ownership of the node and another thread might beat -# it and take ownership of the node first (touching the next pointer). The -# original pop operation will fail due to the ABA guard, but tsan still picks -# up the access on the next pointer. -race:Backup::next_sleeper -race:Backup::set_next_sleeper -race:WorkerEntry::set_next_sleeper - -# This ignores a false positive caused by `thread::park()`/`thread::unpark()`. -# See: https://github.com/rust-lang/rust/pull/54806#issuecomment-436193353 -race:pthread_cond_destroy diff --git a/tokio/src/io/util/async_read_ext.rs b/tokio/src/io/util/async_read_ext.rs index 1ed7e6cfe..dd280a188 100644 --- a/tokio/src/io/util/async_read_ext.rs +++ b/tokio/src/io/util/async_read_ext.rs @@ -990,7 +990,7 @@ cfg_io_util! { /// /// If successful, the total number of bytes read is returned. /// - /// [`read()`]: fn@crate::io::AsyncReadExt::read + /// [`read()`]: AsyncReadExt::read /// /// # Errors /// @@ -1084,6 +1084,8 @@ cfg_io_util! { /// /// [`read()`]: fn@crate::io::AsyncReadExt::read /// + /// [read]: AsyncReadExt::read + /// /// # Examples /// /// [`File`][crate::fs::File]s implement `Read`: diff --git a/tokio/src/time/tests/test_delay.rs b/tokio/src/time/tests/test_delay.rs index f843434be..b708f6fc0 100644 --- a/tokio/src/time/tests/test_delay.rs +++ b/tokio/src/time/tests/test_delay.rs @@ -1,5 +1,3 @@ -#![warn(rust_2018_idioms)] - use crate::park::{Park, Unpark}; use crate::time::driver::{Driver, Entry, Handle}; use crate::time::Clock;