Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"

[workspace.dependencies]
annotate-snippets = { version = "0.12.3", features = ["simd"] }
annotate-snippets = { version = "0.12.4", features = ["simd"] }
anstream = "0.6.20"
anstyle = "1.0.11"
anyhow = "1.0.98"
Expand Down
17 changes: 12 additions & 5 deletions src/cargo/ops/registry/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,18 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
let source_description = source.source_id().to_string();
let short_pkg_descriptions = package_list(to_confirm.iter().copied(), "or");
if plan.is_empty() {
opts.gctx.shell().note(format!(
"waiting for {short_pkg_descriptions} to be available at {source_description}.\n\
You may press ctrl-c to skip waiting; the {crate} should be available shortly.",
crate = if to_confirm.len() == 1 { "crate" } else {"crates"}
))?;
let report = &[
annotate_snippets::Group::with_title(
annotate_snippets::Level::NOTE
.secondary_title(format!(
"waiting for {short_pkg_descriptions} to be available at {source_description}"
))),
annotate_snippets::Group::with_title(annotate_snippets::Level::HELP.secondary_title(format!(
"you may press ctrl-c to skip waiting; the {crate} should be available shortly",
crate = if to_confirm.len() == 1 { "crate" } else {"crates"}
))),
];
opts.gctx.shell().print_report(report, false)?;
} else {
opts.gctx.shell().note(format!(
"waiting for {short_pkg_descriptions} to be available at {source_description}.\n\
Expand Down
12 changes: 6 additions & 6 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.0.1 at registry `alternative`

"#]])
Expand Down Expand Up @@ -525,8 +525,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.0.1 at registry `alternative`

"#]])
Expand Down Expand Up @@ -607,8 +607,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.0.1 to be available at registry `alternative`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.0.1 at registry `alternative`

"#]])
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2261,8 +2261,8 @@ fn publish_artifact_dep() {
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[UPLOADING] foo v0.1.0 ([ROOT]/foo)
[UPLOADED] foo v0.1.0 to registry `crates-io`
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.0 at registry `crates-io`

"#]])
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] a v0.0.1 ([ROOT]/foo)
[UPLOADED] a v0.0.1 to registry `crates-io`
[NOTE] waiting for a v0.0.1 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for a v0.0.1 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] a v0.0.1 at registry `crates-io`

"#]])
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/credential_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ fn publish() {
[UPLOADING] foo v0.1.0 ([ROOT]/foo)
{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]"}
[UPLOADED] foo v0.1.0 to registry `alternative`
[NOTE] waiting for foo v0.1.0 to be available at registry `alternative`.
You may press ctrl-c [..]
[NOTE] waiting for foo v0.1.0 to be available at registry `alternative`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.0 at registry `alternative`

"#]])
Expand Down Expand Up @@ -564,7 +564,7 @@ fn token_caching() {
{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]"}
[UPLOADED] foo v0.1.0 to registry `alternative`
[NOTE] waiting [..]
You may press ctrl-c [..]
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.0 at registry `alternative`

"#]];
Expand All @@ -585,7 +585,7 @@ You may press ctrl-c [..]
{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.1","cksum":"[..]"}
[UPLOADED] foo v0.1.1 to registry `alternative`
[NOTE] waiting [..]
You may press ctrl-c [..]
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.1 at registry `alternative`

"#]];
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cross_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ fn publish_with_target() {
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.0.0 ([ROOT]/foo)
[UPLOADED] foo v0.0.0 to registry `crates-io`
[NOTE] waiting for foo v0.0.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.0.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.0.0 at registry `crates-io`

"#]])
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/features_namespaced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,8 @@ fn publish_no_implicit() {
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[UPLOADING] foo v0.1.0 ([ROOT]/foo)
[UPLOADED] foo v0.1.0 to registry `crates-io`
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.0 at registry `crates-io`

"#]])
Expand Down Expand Up @@ -1074,8 +1074,8 @@ fn publish() {
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.1.0 ([ROOT]/foo)
[UPLOADED] foo v0.1.0 to registry `crates-io`
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v0.1.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v0.1.0 at registry `crates-io`

"#]])
Expand Down
20 changes: 10 additions & 10 deletions tests/testsuite/inheritable_workspace_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ fn inherit_own_workspace_fields() {
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v1.2.3 ([ROOT]/foo)
[UPLOADED] foo v1.2.3 to registry `crates-io`
[NOTE] waiting for foo v1.2.3 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for foo v1.2.3 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] foo v1.2.3 at registry `crates-io`

"#]])
Expand Down Expand Up @@ -334,8 +334,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] bar v0.2.0 ([ROOT]/foo)
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] bar v0.2.0 at registry `crates-io`

"#]])
Expand Down Expand Up @@ -501,8 +501,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] bar v0.2.0 ([ROOT]/foo)
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] bar v0.2.0 at registry `crates-io`

"#]])
Expand Down Expand Up @@ -762,8 +762,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-lice
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] bar v1.2.3 ([ROOT]/foo/bar)
[UPLOADED] bar v1.2.3 to registry `crates-io`
[NOTE] waiting for bar v1.2.3 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for bar v1.2.3 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] bar v1.2.3 at registry `crates-io`

"#]])
Expand Down Expand Up @@ -936,8 +936,8 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] bar v0.2.0 ([ROOT]/foo/bar)
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
[NOTE] waiting for bar v0.2.0 to be available at registry `crates-io`
[HELP] you may press ctrl-c to skip waiting; the crate should be available shortly
[PUBLISHED] bar v0.2.0 at registry `crates-io`

"#]])
Expand Down
Loading
Loading