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

cargo publish fails building even after successful cargo build --release #14661

Closed
dd-dreams opened this issue Oct 9, 2024 · 2 comments
Closed
Labels
C-bug Category: bug Command-publish S-triage Status: This issue is waiting on initial triage.

Comments

@dd-dreams
Copy link

dd-dreams commented Oct 9, 2024

Problem

Hello. As the title says, I have released a new version of my package, though cargo publish fails. All the checks pass, builds are passing, but only cargo publish won't pass. I have implemented a Clone trait for my struct, and I'm running self.writer.1.clone() on another module, though it fails. I'm talking about: https://github.com/dd-dreams/aft/blob/2021421ea77881f0d0fecd268a081580eb7bdc97/aft-crypto/src/data.rs#L126, https://github.com/dd-dreams/aft/blob/2021421ea77881f0d0fecd268a081580eb7bdc97/aft/src/sender.rs#L310.
I receive this error:

error[E0599]: no method named `clone` found for struct `EncAlgo` in the current scope
   --> src/sender.rs:310:27
    |
310 |             self.writer.1.clone()
    |                           ^^^^^ method not found in `EncAlgo<T>`

Steps

  1. Clone my repository.
  2. Run cargo publish --dry-run -p aft.

Possible Solution(s)

No response

Notes

No response

Version

No response

@dd-dreams dd-dreams added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Oct 9, 2024
@epage
Copy link
Contributor

epage commented Oct 9, 2024

Note that the reproduction steps are incomplete

$ git clone https://github.com/dd-dreams/aft.git
$ cd aft
$ cargo publish --dry-run
error: the `-p` argument must be specified to select a single package to publish

I assume you meant

$ git clone https://github.com/dd-dreams/aft.git
$ cd aft/aft
$ cargo publish --dry-run

When cargo publish runs, it removes all paths from [dependencies], relying solely on the registry. The verify step then builds using these updated [dependencies]. You can see this in action if you run cargo package and inspect the generated .crate file.

I'm assuming in this case, you need to publish aft-crypto first. #1169 is tracking support for cargo publish --dry-run --workspace.

@dd-dreams
Copy link
Author

Oh, I guess I forgot about publishing aft-crypto first. Thanks, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-publish S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants