Skip to content

Commit 7b6ccb5

Browse files
committed
chore: backport CI fixes
1 parent 4b174ce commit 7b6ccb5

File tree

6 files changed

+49
-26
lines changed

6 files changed

+49
-26
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*')
22
auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*'
33
freebsd_instance:
4-
image_family: freebsd-14-0
4+
image_family: freebsd-14-2
55
env:
66
RUST_STABLE: stable
77
RUST_NIGHTLY: nightly-2024-05-05

.github/workflows/ci.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
run: |
178178
set -euxo pipefail
179179
RUSTFLAGS="$RUSTFLAGS -C panic=abort -Zpanic-abort-tests" cargo nextest run --workspace --exclude tokio-macros --exclude tests-build --all-features --tests
180-
180+
181181
test-integration-tests-per-feature:
182182
needs: basics
183183
name: Run integration tests for each feature
@@ -455,10 +455,18 @@ jobs:
455455
runs-on: ubuntu-latest
456456
steps:
457457
- uses: actions/checkout@v4
458-
- name: Check semver
458+
- name: Check `tokio` semver
459+
uses: obi1kenobi/cargo-semver-checks-action@v2
460+
with:
461+
rust-toolchain: ${{ env.rust_stable }}
462+
package: tokio
463+
release-type: minor
464+
- name: Check semver for rest of the workspace
465+
if: ${{ !startsWith(github.event.pull_request.base.ref, 'tokio-1.') }}
459466
uses: obi1kenobi/cargo-semver-checks-action@v2
460467
with:
461468
rust-toolchain: ${{ env.rust_stable }}
469+
exclude: tokio
462470
release-type: minor
463471

464472
cross-check:
@@ -689,7 +697,14 @@ jobs:
689697
toolchain: ${{ env.rust_min }}
690698
- uses: Swatinem/rust-cache@v2
691699
- name: "check --workspace --all-features"
692-
run: cargo check --workspace --all-features
700+
run: |
701+
if [[ "${{ github.event.pull_request.base.ref }}" =~ ^tokio-1\..* ]]; then
702+
# Only check `tokio` crate as the PR is backporting to an earlier tokio release.
703+
cargo check -p tokio --all-features
704+
else
705+
# Check all crates in the workspace
706+
cargo check --workspace --all-features
707+
fi
693708
env:
694709
RUSTFLAGS: "" # remove -Dwarnings
695710

@@ -927,10 +942,10 @@ jobs:
927942
targets: ${{ matrix.target }}
928943

929944
# Install dependencies
930-
- name: Install cargo-hack, wasmtime, and cargo-wasi
945+
- name: Install cargo-hack, wasmtime
931946
uses: taiki-e/install-action@v2
932947
with:
933-
tool: cargo-hack,wasmtime,cargo-wasi
948+
tool: cargo-hack,wasmtime
934949

935950
- uses: Swatinem/rust-cache@v2
936951
- name: WASI test tokio full
@@ -956,9 +971,12 @@ jobs:
956971

957972
- name: test tests-integration --features wasi-rt
958973
# TODO: this should become: `cargo hack wasi test --each-feature`
959-
run: cargo wasi test --test rt_yield --features wasi-rt
974+
run: cargo test --target ${{ matrix.target }} --test rt_yield --features wasi-rt
960975
if: matrix.target == 'wasm32-wasip1'
961976
working-directory: tests-integration
977+
env:
978+
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
979+
RUSTFLAGS: -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
962980

963981
- name: test tests-integration --features wasi-threads-rt
964982
run: cargo test --target ${{ matrix.target }} --features wasi-threads-rt
@@ -980,7 +998,7 @@ jobs:
980998
rust:
981999
# `check-external-types` requires a specific Rust nightly version. See
9821000
# the README for details: https://github.com/awslabs/cargo-check-external-types
983-
- nightly-2023-10-21
1001+
- nightly-2024-06-30
9841002
steps:
9851003
- uses: actions/checkout@v4
9861004
- name: Install Rust ${{ matrix.rust }}
@@ -991,7 +1009,7 @@ jobs:
9911009
- name: Install cargo-check-external-types
9921010
uses: taiki-e/cache-cargo-install-action@v1
9931011
with:
994-
1012+
9951013
- name: check-external-types
9961014
run: cargo check-external-types --all-features
9971015
working-directory: tokio
@@ -1051,11 +1069,11 @@ jobs:
10511069
- name: Make sure dictionary words are sorted and unique
10521070
run: |
10531071
# `sed` removes the first line (number of words) and
1054-
# the last line (new line).
1055-
#
1072+
# the last line (new line).
1073+
#
10561074
# `sort` makes sure everything in between is sorted
10571075
# and contains no duplicates.
1058-
#
1076+
#
10591077
# Since `sort` is sensitive to locale, we set it
10601078
# using LC_ALL to en_US.UTF8 to be consistent in different
10611079
# environments.

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@ members = [
1717

1818
[workspace.metadata.spellcheck]
1919
config = "spellcheck.toml"
20+
21+
[workspace.lints.rust]
22+
unexpected_cfgs = { level = "warn", check-cfg = [
23+
'cfg(fuzzing)',
24+
'cfg(loom)',
25+
'cfg(mio_unsupported_force_poll_poll)',
26+
'cfg(tokio_allow_from_blocking_fd)',
27+
'cfg(tokio_internal_mt_counters)',
28+
'cfg(tokio_no_parking_lot)',
29+
'cfg(tokio_no_tuning_tests)',
30+
'cfg(tokio_taskdump)',
31+
'cfg(tokio_unstable)',
32+
] }

examples/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ path = "named-pipe-multi-client.rs"
9494
[[example]]
9595
name = "dump"
9696
path = "dump.rs"
97+
98+
[lints]
99+
workspace = true

tokio/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ features = ["full", "test-util"]
171171
allowed_external_types = [
172172
"bytes::buf::buf_impl::Buf",
173173
"bytes::buf::buf_mut::BufMut",
174-
175174
"tokio_macros::*",
176175
]
176+
177+
[lints]
178+
workspace = true

tokio/src/runtime/tests/queue.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::runtime::scheduler::multi_thread::{queue, Stats};
2-
use crate::runtime::task::{self, Schedule, Task};
32

43
use std::cell::RefCell;
54
use std::thread;
@@ -272,15 +271,3 @@ fn stress2() {
272271
assert_eq!(num_pop, NUM_TASKS);
273272
}
274273
}
275-
276-
struct Runtime;
277-
278-
impl Schedule for Runtime {
279-
fn release(&self, _task: &Task<Self>) -> Option<Task<Self>> {
280-
None
281-
}
282-
283-
fn schedule(&self, _task: task::Notified<Self>) {
284-
unreachable!();
285-
}
286-
}

0 commit comments

Comments
 (0)