From 24c00a3773d693f4de8ae84eb93d9c66deac67f3 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 24 Jan 2024 17:33:18 -0500 Subject: [PATCH 1/4] chore: remove `version` field from `publish=false` packages In 1.75 cargo allows versionless manifest. We should keep up and dogfood ourselves. --- Cargo.lock | 6 +++--- benches/benchsuite/Cargo.toml | 2 -- benches/capture/Cargo.toml | 2 -- crates/cargo-test-macro/Cargo.toml | 2 -- crates/cargo-test-support/Cargo.toml | 2 -- crates/mdman/Cargo.toml | 2 -- crates/resolver-tests/Cargo.toml | 2 -- crates/semver-check/Cargo.toml | 2 -- crates/xtask-build-man/Cargo.toml | 2 -- crates/xtask-bump-check/Cargo.toml | 2 -- crates/xtask-stale-label/Cargo.toml | 2 -- 11 files changed, 3 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0a7cc9b9d3..8043f3ee7ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "capture" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cargo_metadata", "flate2", @@ -394,11 +394,11 @@ dependencies = [ [[package]] name = "cargo-test-macro" -version = "0.1.0" +version = "0.0.0" [[package]] name = "cargo-test-support" -version = "0.1.0" +version = "0.0.0" dependencies = [ "anstream", "anstyle", diff --git a/benches/benchsuite/Cargo.toml b/benches/benchsuite/Cargo.toml index efda5ea9dc7..49a629ca2b1 100644 --- a/benches/benchsuite/Cargo.toml +++ b/benches/benchsuite/Cargo.toml @@ -1,12 +1,10 @@ [package] name = "benchsuite" -version = "0.0.0" edition.workspace = true license.workspace = true homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" description = "Benchmarking suite for Cargo." -publish = false [dependencies] cargo.workspace = true diff --git a/benches/capture/Cargo.toml b/benches/capture/Cargo.toml index cb3742d790e..171809f43e7 100644 --- a/benches/capture/Cargo.toml +++ b/benches/capture/Cargo.toml @@ -1,10 +1,8 @@ [package] name = "capture" -version = "0.1.0" edition.workspace = true license.workspace = true description = "Tool for capturing a real-world workspace for benchmarking." -publish = false [dependencies] cargo_metadata.workspace = true diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index e216936ee2f..78533492ac3 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -1,13 +1,11 @@ [package] name = "cargo-test-macro" -version = "0.1.0" edition.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true documentation = "https://github.com/rust-lang/cargo" description = "Helper proc-macro for Cargo's testsuite." -publish = false [lib] proc-macro = true diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index a8b7b8f1dd1..af348e3d5fa 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -1,9 +1,7 @@ [package] name = "cargo-test-support" -version = "0.1.0" license.workspace = true edition.workspace = true -publish = false [lib] doctest = false diff --git a/crates/mdman/Cargo.toml b/crates/mdman/Cargo.toml index 375d8ac750f..fc29046fe34 100644 --- a/crates/mdman/Cargo.toml +++ b/crates/mdman/Cargo.toml @@ -1,10 +1,8 @@ [package] name = "mdman" -version = "0.0.0" edition.workspace = true license.workspace = true description = "Creates a man page page from markdown." -publish = false [dependencies] anyhow.workspace = true diff --git a/crates/resolver-tests/Cargo.toml b/crates/resolver-tests/Cargo.toml index 44f90690051..e4d94211cf8 100644 --- a/crates/resolver-tests/Cargo.toml +++ b/crates/resolver-tests/Cargo.toml @@ -1,8 +1,6 @@ [package] name = "resolver-tests" -version = "0.0.0" edition.workspace = true -publish = false [dependencies] cargo.workspace = true diff --git a/crates/semver-check/Cargo.toml b/crates/semver-check/Cargo.toml index 62301104995..3f244642540 100644 --- a/crates/semver-check/Cargo.toml +++ b/crates/semver-check/Cargo.toml @@ -1,9 +1,7 @@ [package] name = "semver-check" -version = "0.0.0" authors = ["Eric Huss"] edition.workspace = true -publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/xtask-build-man/Cargo.toml b/crates/xtask-build-man/Cargo.toml index 8c694543adf..b03c1b66982 100644 --- a/crates/xtask-build-man/Cargo.toml +++ b/crates/xtask-build-man/Cargo.toml @@ -1,8 +1,6 @@ [package] name = "xtask-build-man" -version = "0.0.0" edition.workspace = true -publish = false [dependencies] diff --git a/crates/xtask-bump-check/Cargo.toml b/crates/xtask-bump-check/Cargo.toml index 44ce34141bf..8871e71da71 100644 --- a/crates/xtask-bump-check/Cargo.toml +++ b/crates/xtask-bump-check/Cargo.toml @@ -1,8 +1,6 @@ [package] name = "xtask-bump-check" -version = "0.0.0" edition.workspace = true -publish = false [dependencies] anyhow.workspace = true diff --git a/crates/xtask-stale-label/Cargo.toml b/crates/xtask-stale-label/Cargo.toml index 3e555f6c02e..00c39f4552f 100644 --- a/crates/xtask-stale-label/Cargo.toml +++ b/crates/xtask-stale-label/Cargo.toml @@ -1,8 +1,6 @@ [package] name = "xtask-stale-label" -version = "0.0.0" edition.workspace = true -publish = false [dependencies] toml_edit.workspace = true From 55b72abd567b397c24f0abfc8ec82d29f4018be7 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 24 Jan 2024 17:35:22 -0500 Subject: [PATCH 2/4] chore(ci): cargo-hack `--no-private` --no-private Perform without publish = false crates. This is similar to --ignore-private, but is more powerful because this also prevents private crates from affecting lockfile and metadata. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e5a74e6b314..e616758e38d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -258,4 +258,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: taiki-e/install-action@cargo-hack - - run: cargo hack check --all-targets --rust-version --workspace --ignore-private + - run: cargo hack check --all-targets --rust-version --workspace --no-private From b0a8a2cdb654807767541f4cccf8c23a14954fc3 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 24 Jan 2024 20:52:08 -0500 Subject: [PATCH 3/4] chore(ci): cargo-hack `--no-dev-deps` One thing to note is that the use of the --all-targets flag (that builds tests/examples) needed to be removed and the --no-dev-deps flag is needed. This is because the dev-dependencies use versionless manifests that cannot be read by the old compiler. That said, we are not running tests with the old compiler, so I don't see a problem if the test suite cannot be built on the old compiler. Co-authored-by: Taiki Endo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e616758e38d..aed32bc90bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -258,4 +258,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: taiki-e/install-action@cargo-hack - - run: cargo hack check --all-targets --rust-version --workspace --no-private + - run: cargo hack check --rust-version --workspace --no-private --no-dev-deps From ebb7ff4e121b53a2c8673446966238b23d5fda36 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 24 Jan 2024 17:36:12 -0500 Subject: [PATCH 4/4] docs(ci): also suggest `cargo hack --no-private` --- src/doc/src/guide/continuous-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/guide/continuous-integration.md b/src/doc/src/guide/continuous-integration.md index 282ca1ab8de..df6a90dd6a4 100644 --- a/src/doc/src/guide/continuous-integration.md +++ b/src/doc/src/guide/continuous-integration.md @@ -173,7 +173,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: taiki-e/install-action@cargo-hack - - run: cargo hack check --rust-version --workspace --all-targets --ignore-private + - run: cargo hack check --rust-version --workspace --all-targets --no-private ``` This tries to balance thoroughness with turnaround time: - A single platform is used as most projects are platform-agnostic, trusting platform-specific dependencies to verify their behavior.