From dd1196d36930bf23d5ba32402f5dadef861546fa Mon Sep 17 00:00:00 2001 From: figsoda Date: Wed, 18 Mar 2026 02:27:46 -0400 Subject: [PATCH] ci: patch workspace members to disambiguate `--package` (#7967) --- .github/workflows/ci.yml | 11 +++++++---- Cargo.toml | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e352385c8..52c7fd1b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,7 @@ jobs: cargo nextest run --workspace --features $TOKIO_STABLE_FEATURES # Removing workspace patches to run tests without path dependencies # (if not specified differently in the crate) - sed -i.bak '/^\[patch\.crates-io\]$/d; /^tokio = { path = "tokio"\s*}$/d' Cargo.toml && rm -f Cargo.toml.bak + perl -0 -i -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml cargo nextest run \ --workspace \ --exclude tokio \ @@ -226,7 +226,7 @@ jobs: cargo check --workspace --tests --features $TOKIO_STABLE_FEATURES # Removing the tokio workspace patch to run tests without path dependencies # (if not specified differently in the crate) - sed -i '/^\[patch\.crates-io\]$/d; /^tokio = { path = "tokio"\s*}$/d' Cargo.toml + perl -0 -i -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml cargo check --workspace --exclude tokio --tests --features $TOKIO_STABLE_FEATURES valgrind: @@ -822,14 +822,17 @@ jobs: cargo clippy --workspace --tests --no-deps --features $TOKIO_STABLE_FEATURES # Removing the tokio workspace patch to check without path dependencies # (if not specified differently in the crate) - sed -i '/^\[patch\.crates-io\]$/d; /^tokio = { path = "tokio"\s*}$/d' Cargo.toml + perl -0 -i.bak -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml cargo clippy --workspace --exclude tokio --tests --no-deps --features $TOKIO_STABLE_FEATURES - name: "clippy --workspace --all-features --unstable" run: | # Forcing the cargo lock regeneration to apply the tokio patch rm Cargo.lock - cargo clippy --workspace --tests --no-deps --all-features --config 'patch.crates-io.tokio.path="tokio"' + mv Cargo.toml Cargo.toml.nopatch + mv Cargo.toml.bak Cargo.toml + cargo clippy --workspace --tests --no-deps --all-features # check without path dependencies + mv Cargo.toml.nopatch Cargo.toml cargo clippy --workspace --exclude tokio --tests --no-deps --all-features env: RUSTFLAGS: --cfg tokio_unstable -Dwarnings diff --git a/Cargo.toml b/Cargo.toml index a71fdbc3c..2238a50d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,10 @@ members = [ [patch.crates-io] tokio = { path = "tokio" } +tokio-macros = { path = "tokio-macros" } +tokio-stream = { path = "tokio-stream" } +tokio-test = { path = "tokio-test" } +tokio-util = { path = "tokio-util" } [workspace.metadata.spellcheck] config = "spellcheck.toml"