Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tries to publish sub-project twice in a workspace #471

Closed
bbaldino opened this issue May 26, 2022 · 5 comments · Fixed by #472
Closed

Tries to publish sub-project twice in a workspace #471

bbaldino opened this issue May 26, 2022 · 5 comments · Fixed by #472
Labels
bug Not as expected

Comments

@bbaldino
Copy link

I'm not sure if maybe the structure of my workspace project is incorrect (I couldn't find examples of what cargo-release expects), but it can be seen here. When I run cargo release --workspace minor --execute, it appears to try and push one of the sub-projects again when it's trying to publish the 'main' project. Output of the command:

brians-MacBook-Pro:packetrs bbaldino$ cargo release --workspace minor --execute
Release
  packetrs-impl 0.4.0
  packetrs-macro 0.4.0
  packetrs 0.4.0
? [y/N]
y
[2022-05-26T16:29:02Z INFO  cargo_release::release] Update packetrs-impl to version 0.4.0
[2022-05-26T16:29:02Z INFO  cargo_release::release] Fixing packetrs's dependency on packetrs-impl to `=0.4.0` (from `=0.3.0`)
[2022-05-26T16:29:02Z INFO  cargo_release::release] Fixing packetrs-macro's dependency on packetrs-impl to `=0.4.0` (from `=0.3.0`)
[master b10c139] (cargo-release) version 0.4.0
 3 files changed, 3 insertions(+), 3 deletions(-)
[2022-05-26T16:29:02Z INFO  cargo_release::release] Update packetrs-macro to version 0.4.0
[2022-05-26T16:29:02Z INFO  cargo_release::release] Fixing packetrs's dependency on packetrs-macro to `=0.4.0` (from `=0.3.0`)
[master 83649d6] (cargo-release) version 0.4.0
 2 files changed, 2 insertions(+), 2 deletions(-)
[2022-05-26T16:29:02Z INFO  cargo_release::release] Update packetrs to version 0.4.0
[master 3fc6125] (cargo-release) version 0.4.0
 1 file changed, 1 insertion(+), 1 deletion(-)
[2022-05-26T16:29:02Z INFO  cargo_release::release] Publishing packetrs-impl
    Updating crates.io index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
   Verifying packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling syn v1.0.95
   Compiling serde v1.0.137
   Compiling anyhow v1.0.57
   Compiling byteorder v1.4.3
   Compiling ux v0.1.4
   Compiling quote v1.0.18
   Compiling thiserror-impl v1.0.31
   Compiling toml v0.5.9
   Compiling thiserror v1.0.31
   Compiling proc-macro-crate v1.1.3
   Compiling bit-cursor v0.1.0
   Compiling packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/target/package/packetrs-impl-0.4.0)
    Finished dev [unoptimized + debuginfo] target(s) in 29.24s
   Uploading packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
[2022-05-26T16:29:34Z INFO  cargo_release::cargo] Waiting for publish to complete...
[2022-05-26T16:29:36Z INFO  cargo_release::release] Publishing packetrs-macro
    Updating crates.io index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging packetrs-macro v0.4.0 (/Users/bbaldino/work/packetrs/macro)
   Verifying packetrs-macro v0.4.0 (/Users/bbaldino/work/packetrs/macro)
  Downloaded packetrs-impl v0.4.0
  Downloaded 1 crate (8.2 KB) in 0.44s
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling syn v1.0.95
   Compiling serde v1.0.137
   Compiling anyhow v1.0.57
   Compiling byteorder v1.4.3
   Compiling ux v0.1.4
   Compiling quote v1.0.18
   Compiling toml v0.5.9
   Compiling thiserror-impl v1.0.31
   Compiling thiserror v1.0.31
   Compiling proc-macro-crate v1.1.3
   Compiling bit-cursor v0.1.0
   Compiling packetrs-impl v0.4.0
   Compiling packetrs-macro v0.4.0 (/Users/bbaldino/work/packetrs/target/package/packetrs-macro-0.4.0)
    Finished dev [unoptimized + debuginfo] target(s) in 29.20s
   Uploading packetrs-macro v0.4.0 (/Users/bbaldino/work/packetrs/macro)
[2022-05-26T16:30:08Z INFO  cargo_release::cargo] Waiting for publish to complete...
[2022-05-26T16:30:10Z INFO  cargo_release::release] Publishing packetrs
    Updating crates.io index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
   Verifying packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling syn v1.0.95
   Compiling serde v1.0.137
   Compiling anyhow v1.0.57
   Compiling byteorder v1.4.3
   Compiling ux v0.1.4
   Compiling quote v1.0.18
   Compiling thiserror-impl v1.0.31
   Compiling toml v0.5.9
   Compiling thiserror v1.0.31
   Compiling proc-macro-crate v1.1.3
   Compiling bit-cursor v0.1.0
   Compiling packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/target/package/packetrs-impl-0.4.0)
    Finished dev [unoptimized + debuginfo] target(s) in 28.62s
   Uploading packetrs-impl v0.4.0 (/Users/bbaldino/work/packetrs/impl)
error: failed to publish to registry at https://crates.io
@epage
Copy link
Collaborator

epage commented May 26, 2022

Looks like its a bug in cargo-release related to default-members. Its apparently respected for cargo publish but only the first manifest gets published. It seems there are generally problems with publish, see rust-lang/cargo#10677

@epage epage added the bug Not as expected label May 26, 2022
@epage
Copy link
Collaborator

epage commented May 26, 2022

I suspect this can't be fixed until rust-lang/cargo#7267 is addressed.

To bypass default-members, we nee to pass -p with a pkgid but only if its in a workspace. We could just do -p packetrs which will work in most cases unless a different version of the package shows up in the dependency tree. This happens with clap which has a dev-dependency on criterion which depends on a prior version of clap.

Oddly enough, I did just test this out and it looks like publish actually works with -p clap, ignoring the other clap in the dependency tree. I'm unsure how intended or not this is and if its safe to assume it will continue to work.

epage added a commit to epage/cargo-release that referenced this issue May 26, 2022
epage added a commit to epage/cargo-release that referenced this issue May 26, 2022
@epage
Copy link
Collaborator

epage commented May 26, 2022

The fix was just published as v0.20.6

@bbaldino
Copy link
Author

Awesome, thanks a lot for the quick resolution! I'll give 0.20.6 a shot.

@bbaldino
Copy link
Author

Can confirm that fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants