From 80300763b107b42b684ba09a541e1a159cdd9acb Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Wed, 7 Feb 2024 22:56:56 +0100 Subject: [PATCH 1/9] Chore(cargo-test-*): Add license file links Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- crates/cargo-test-macro/LICENSE-APACHE | 1 + crates/cargo-test-macro/LICENSE-MIT | 1 + crates/cargo-test-support/LICENSE-APACHE | 1 + crates/cargo-test-support/LICENSE-MIT | 1 + 4 files changed, 4 insertions(+) create mode 120000 crates/cargo-test-macro/LICENSE-APACHE create mode 120000 crates/cargo-test-macro/LICENSE-MIT create mode 120000 crates/cargo-test-support/LICENSE-APACHE create mode 120000 crates/cargo-test-support/LICENSE-MIT diff --git a/crates/cargo-test-macro/LICENSE-APACHE b/crates/cargo-test-macro/LICENSE-APACHE new file mode 120000 index 00000000000..1cd601d0a3a --- /dev/null +++ b/crates/cargo-test-macro/LICENSE-APACHE @@ -0,0 +1 @@ +../../LICENSE-APACHE \ No newline at end of file diff --git a/crates/cargo-test-macro/LICENSE-MIT b/crates/cargo-test-macro/LICENSE-MIT new file mode 120000 index 00000000000..b2cfbdc7b0b --- /dev/null +++ b/crates/cargo-test-macro/LICENSE-MIT @@ -0,0 +1 @@ +../../LICENSE-MIT \ No newline at end of file diff --git a/crates/cargo-test-support/LICENSE-APACHE b/crates/cargo-test-support/LICENSE-APACHE new file mode 120000 index 00000000000..1cd601d0a3a --- /dev/null +++ b/crates/cargo-test-support/LICENSE-APACHE @@ -0,0 +1 @@ +../../LICENSE-APACHE \ No newline at end of file diff --git a/crates/cargo-test-support/LICENSE-MIT b/crates/cargo-test-support/LICENSE-MIT new file mode 120000 index 00000000000..b2cfbdc7b0b --- /dev/null +++ b/crates/cargo-test-support/LICENSE-MIT @@ -0,0 +1 @@ +../../LICENSE-MIT \ No newline at end of file From f9b570275519a068b055ddc51b23d757651ab7c0 Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Wed, 7 Feb 2024 23:02:44 +0100 Subject: [PATCH 2/9] Chore(cargo-test-*/Cargo.toml): Standardize basic fields for publication Marks the crates as publishable. Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- crates/cargo-test-macro/Cargo.toml | 3 +-- crates/cargo-test-support/Cargo.toml | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index e216936ee2f..c03f220e610 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -2,12 +2,11 @@ name = "cargo-test-macro" version = "0.1.0" edition.workspace = true +rust-version.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..df6dfebfc0a 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "cargo-test-support" version = "0.1.0" -license.workspace = true edition.workspace = true -publish = false +rust-version.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +description = "Testing framework for Cargo's testsuite." [lib] doctest = false From d691d034c7934cc3313921343e22a3a48a84fded Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Thu, 8 Feb 2024 00:36:58 +0100 Subject: [PATCH 3/9] Chore(cargo-test-*/Cargo.toml): Bump versions to make ci/validate-version-bump.sh pass Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- Cargo.lock | 4 ++-- crates/cargo-test-macro/Cargo.toml | 2 +- crates/cargo-test-support/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f02a4f1ac0f..698fc474ca4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,11 +408,11 @@ dependencies = [ [[package]] name = "cargo-test-macro" -version = "0.1.0" +version = "0.2.0" [[package]] name = "cargo-test-support" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anstream", "anstyle", diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index c03f220e610..b156fbe546f 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-test-macro" -version = "0.1.0" +version = "0.2.0" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index df6dfebfc0a..742f85035ea 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-test-support" -version = "0.1.0" +version = "0.2.0" edition.workspace = true rust-version.workspace = true license.workspace = true From 2879fc0d60c51dbc023bc0e516207c1f4f4fc78c Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Thu, 8 Feb 2024 01:21:46 +0100 Subject: [PATCH 4/9] Chore(cargo-test-*/Cargo.toml): Bump MSRVs to make corresponding CI check pass Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- crates/cargo-test-macro/Cargo.toml | 2 +- crates/cargo-test-support/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index b156fbe546f..68e621f0103 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-test-macro" version = "0.2.0" edition.workspace = true -rust-version.workspace = true +rust-version = "1.77" # MSRV:1 license.workspace = true homepage.workspace = true repository.workspace = true diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index 742f85035ea..fd64a66efc7 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-test-support" version = "0.2.0" edition.workspace = true -rust-version.workspace = true +rust-version = "1.77" # MSRV:1 license.workspace = true homepage.workspace = true repository.workspace = true From 01e1fe247be72a362e2874b22a85485f1135bb76 Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Wed, 7 Feb 2024 23:22:43 +0100 Subject: [PATCH 5/9] Chore(Cargo.toml): Add versions for cargo-test-* Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6523d2a3802..ac0e1b9a4d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,8 @@ cargo-credential-libsecret = { version = "0.4.2", path = "credential/cargo-crede cargo-credential-macos-keychain = { version = "0.4.2", path = "credential/cargo-credential-macos-keychain" } cargo-credential-wincred = { version = "0.4.2", path = "credential/cargo-credential-wincred" } cargo-platform = { path = "crates/cargo-platform", version = "0.1.5" } -cargo-test-macro = { path = "crates/cargo-test-macro" } -cargo-test-support = { path = "crates/cargo-test-support" } +cargo-test-macro = { version = "0.2.0", path = "crates/cargo-test-macro" } +cargo-test-support = { version = "0.2.0", path = "crates/cargo-test-support" } cargo-util = { version = "0.2.9", path = "crates/cargo-util" } cargo-util-schemas = { version = "0.3.0", path = "crates/cargo-util-schemas" } cargo_metadata = "0.18.1" From 8be4cc39e2fd8a28065bef8e136f8bc388c5010d Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Wed, 7 Feb 2024 23:27:12 +0100 Subject: [PATCH 6/9] Chore(publish.py): Add cargo-test-* to publication list Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- publish.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish.py b/publish.py index 0524651b59c..2918e1d998a 100755 --- a/publish.py +++ b/publish.py @@ -26,6 +26,8 @@ 'crates/cargo-util', 'crates/crates-io', 'crates/cargo-util-schemas', + 'crates/cargo-test-macro', + 'crates/cargo-test-support', '.', ] From 6f581e905651e953ea7ab46373016da92fe40d08 Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Tue, 26 Mar 2024 11:05:39 +0100 Subject: [PATCH 7/9] Chore(xtask-bump-check): Exclude cargo-test-* to make corresponding CI check pass Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- crates/xtask-bump-check/src/xtask.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/xtask-bump-check/src/xtask.rs b/crates/xtask-bump-check/src/xtask.rs index 6f8dffc75d6..a53a0a8bcfb 100644 --- a/crates/xtask-bump-check/src/xtask.rs +++ b/crates/xtask-bump-check/src/xtask.rs @@ -168,6 +168,8 @@ fn bump_check(args: &clap::ArgMatches, gctx: &cargo::util::GlobalContext) -> Car let mut cmd = ProcessBuilder::new("cargo"); cmd.arg("semver-checks") .arg("check-release") + .args(&["--exclude", "cargo-test-macro"]) // FIXME: Remove once 1.79 is stable. + .args(&["--exclude", "cargo-test-support"]) // FIXME: Remove once 1.79 is stable. .arg("--workspace"); gctx.shell().status("Running", &cmd)?; cmd.exec()?; @@ -176,6 +178,8 @@ fn bump_check(args: &clap::ArgMatches, gctx: &cargo::util::GlobalContext) -> Car let mut cmd = ProcessBuilder::new("cargo"); cmd.arg("semver-checks") .arg("--workspace") + .args(&["--exclude", "cargo-test-macro"]) // FIXME: Remove once 1.79 is stable. + .args(&["--exclude", "cargo-test-support"]) // FIXME: Remove once 1.79 is stable. .arg("--baseline-rev") .arg(referenced_commit.id().to_string()); for krate in crates_not_check_against_channels { From 29c45d0e663d171fb665b2db53abffd17d9cb5b1 Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Wed, 7 Feb 2024 23:39:19 +0100 Subject: [PATCH 8/9] Docs(process/release): Update to include test tools in publication Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- src/doc/contrib/src/process/release.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/contrib/src/process/release.md b/src/doc/contrib/src/process/release.md index 3c3062f325c..9b3ce372586 100644 --- a/src/doc/contrib/src/process/release.md +++ b/src/doc/contrib/src/process/release.md @@ -131,9 +131,9 @@ Cargo's library and its related dependencies (like `cargo-util`) are published to [crates.io] as part of the 6-week stable release process by the [Release team]. There is a [`publish.py` script] that is used by the Release team's automation scripts (see <https://github.com/rust-lang/simpleinfra/>) to handle -determining which packages to publish. The test and build tool crates aren't -published. This runs on the specific git commit associated with the cargo -submodule in the `stable` branch in `rust-lang/rust` at the time of release. +determining which packages to publish. The build tool crates aren't published. +This runs on the specific git commit associated with the cargo submodule in the +`stable` branch in `rust-lang/rust` at the time of release. On very rare cases, the Cargo team may decide to manually publish a new release to [crates.io]. For example, this may be necessary if there is a From f422e96b31b7086e9c27c7fd0735f3a568a5e95d Mon Sep 17 00:00:00 2001 From: Paul Mabileau <paulmabileau@hotmail.fr> Date: Mon, 26 Feb 2024 21:41:48 +0100 Subject: [PATCH 9/9] Docs(crates/cargo-test-*): Add external usage warning As discussed in #10147. Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr> --- crates/cargo-test-macro/README.md | 5 +++++ crates/cargo-test-macro/src/lib.rs | 11 +++++++++++ crates/cargo-test-support/README.md | 5 +++++ crates/cargo-test-support/src/lib.rs | 6 ++++++ 4 files changed, 27 insertions(+) create mode 100644 crates/cargo-test-macro/README.md create mode 100644 crates/cargo-test-support/README.md diff --git a/crates/cargo-test-macro/README.md b/crates/cargo-test-macro/README.md new file mode 100644 index 00000000000..311d5ed6d66 --- /dev/null +++ b/crates/cargo-test-macro/README.md @@ -0,0 +1,5 @@ +WARNING: You might not want to use this outside of Cargo. + +* This is designed for testing Cargo itself. Use at your own risk. +* No guarantee on any stability across versions. +* No feature request would be accepted unless proved useful for testing Cargo. diff --git a/crates/cargo-test-macro/src/lib.rs b/crates/cargo-test-macro/src/lib.rs index f813b835a45..9d4a5fbaa99 100644 --- a/crates/cargo-test-macro/src/lib.rs +++ b/crates/cargo-test-macro/src/lib.rs @@ -1,3 +1,14 @@ +//! # Cargo test macro. +//! +//! This is meant to be consumed alongside `cargo-test-support`. See +//! <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests. +//! +//! WARNING: You might not want to use this outside of Cargo. +//! +//! * This is designed for testing Cargo itself. Use at your own risk. +//! * No guarantee on any stability across versions. +//! * No feature request would be accepted unless proved useful for testing Cargo. + use proc_macro::*; use std::path::Path; use std::process::Command; diff --git a/crates/cargo-test-support/README.md b/crates/cargo-test-support/README.md new file mode 100644 index 00000000000..311d5ed6d66 --- /dev/null +++ b/crates/cargo-test-support/README.md @@ -0,0 +1,5 @@ +WARNING: You might not want to use this outside of Cargo. + +* This is designed for testing Cargo itself. Use at your own risk. +* No guarantee on any stability across versions. +* No feature request would be accepted unless proved useful for testing Cargo. diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs index 15a77adc7ff..a02f8293380 100644 --- a/crates/cargo-test-support/src/lib.rs +++ b/crates/cargo-test-support/src/lib.rs @@ -1,6 +1,12 @@ //! # Cargo test support. //! //! See <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests. +//! +//! WARNING: You might not want to use this outside of Cargo. +//! +//! * This is designed for testing Cargo itself. Use at your own risk. +//! * No guarantee on any stability across versions. +//! * No feature request would be accepted unless proved useful for testing Cargo. #![allow(clippy::disallowed_methods)] #![allow(clippy::print_stderr)]