Skip to content

Commit 3a77350

Browse files
committed
Auto merge of #13418 - PaulDance:publish-test-crates, r=weihanglo
Publish test crates ### What does this PR try to resolve? This is an attempt to close #10147. In short, publish the `cargo-test-(macro|support)` crates to crates.io. Main parts: * Updating the concerned manifests to make the packages publishable. * Adding them to `publish.py`: not sure if you want this to be done. I put them after all other packages and in reverse-dependency order to ensure things will work the best, hopefully. * Updating the contribution documentation to reflect the change. I didn't see any other place where the crates' publication was mentioned. ### How should we test and review this PR? Sadly, the effective testing could not be done by me as it would require publishing the crates, which would block future publications by Cargo team members and therefore render the whole point of this impossible or cumbersome. Hopefully, the PR is small and readable enough that mistakes can be seen easily. The real testing would need to be done manually by some team member either before by checking the source branch out or after merging. The only testing I was able to perform was to run `cargo publish --dry-run -p cargo-test-(macro|support)`. The first worked just fine. The second failed on the `crates-io` package not being available on crates.io in version `0.40.0`. However, the package is in this version in the current sources. I therefore suspect that a run of `publish.py` should work since the packages have been added there after `crates-io`. ### Additional information This is very much tentative and open to discussion. I tried my best to update things as I understood them. Please correct me on anything I would have done wrong or simply not thought of.
2 parents 499a61c + f422e96 commit 3a77350

File tree

15 files changed

+52
-13
lines changed

15 files changed

+52
-13
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ cargo-credential-libsecret = { version = "0.4.2", path = "credential/cargo-crede
3030
cargo-credential-macos-keychain = { version = "0.4.2", path = "credential/cargo-credential-macos-keychain" }
3131
cargo-credential-wincred = { version = "0.4.2", path = "credential/cargo-credential-wincred" }
3232
cargo-platform = { path = "crates/cargo-platform", version = "0.1.5" }
33-
cargo-test-macro = { path = "crates/cargo-test-macro" }
34-
cargo-test-support = { path = "crates/cargo-test-support" }
33+
cargo-test-macro = { version = "0.2.0", path = "crates/cargo-test-macro" }
34+
cargo-test-support = { version = "0.2.0", path = "crates/cargo-test-support" }
3535
cargo-util = { version = "0.2.9", path = "crates/cargo-util" }
3636
cargo-util-schemas = { version = "0.3.0", path = "crates/cargo-util-schemas" }
3737
cargo_metadata = "0.18.1"

crates/cargo-test-macro/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[package]
22
name = "cargo-test-macro"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition.workspace = true
5+
rust-version = "1.77" # MSRV:1
56
license.workspace = true
67
homepage.workspace = true
78
repository.workspace = true
8-
documentation = "https://github.com/rust-lang/cargo"
99
description = "Helper proc-macro for Cargo's testsuite."
10-
publish = false
1110

1211
[lib]
1312
proc-macro = true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-APACHE

crates/cargo-test-macro/LICENSE-MIT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-MIT

crates/cargo-test-macro/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
WARNING: You might not want to use this outside of Cargo.
2+
3+
* This is designed for testing Cargo itself. Use at your own risk.
4+
* No guarantee on any stability across versions.
5+
* No feature request would be accepted unless proved useful for testing Cargo.

crates/cargo-test-macro/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
//! # Cargo test macro.
2+
//!
3+
//! This is meant to be consumed alongside `cargo-test-support`. See
4+
//! <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
5+
//!
6+
//! WARNING: You might not want to use this outside of Cargo.
7+
//!
8+
//! * This is designed for testing Cargo itself. Use at your own risk.
9+
//! * No guarantee on any stability across versions.
10+
//! * No feature request would be accepted unless proved useful for testing Cargo.
11+
112
use proc_macro::*;
213
use std::path::Path;
314
use std::process::Command;

crates/cargo-test-support/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[package]
22
name = "cargo-test-support"
3-
version = "0.1.0"
4-
license.workspace = true
3+
version = "0.2.0"
54
edition.workspace = true
6-
publish = false
5+
rust-version = "1.77" # MSRV:1
6+
license.workspace = true
7+
homepage.workspace = true
8+
repository.workspace = true
9+
description = "Testing framework for Cargo's testsuite."
710

811
[lib]
912
doctest = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-APACHE

crates/cargo-test-support/LICENSE-MIT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-MIT

0 commit comments

Comments
 (0)