Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds more like a regression from the development of
-Zpackage-workspace
. This starts happening since nightly-2024-09-17, which contains the cargo submodule update (rust-lang/rust#130377).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is it: 6ede1e2 in #14448. The fix might need to consider the presence of
--dry-run
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the doc like this PR is also fine, if we consider they are not equivalent anymore.
@epage since you were involved in #14448, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moved an error that happens after
--dry-run
stops to before. I view this as a positive improvement, helping to catch errors earlier.As for the docs, it depends on what you mean by equivalent. @trevyn in the future, please start with an issue. This might seem like an obvious documentation bug but we need to dig more into your situation to really understand what should be updated, whether docs, something else, etc. In general, there are differences between
cargo publish -n
andcargo package
and we added another (and--workspace
has more). So the question is what you read from "equivalent" that you found this to be wrong and needed to be updated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, i interpret "equivalent" to mean identical in function, which is not the case for the above example. (see https://doc.rust-lang.org/std/cmp/trait.Eq.html 😂)
My use case is to run
publish --dry-run
in CI, partly as an additional verification, but primarily to report the compressed package size.I agree that
publish --dry-run
erroring here is an improvement, and happily switched topackage
, which works great for me.I found the docs helpful to find this alternative, but in my mind and usage the two are indeed no longer "equivalent". :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section of documentation is telling users how to prepare for publish by doing a one-off command,. In that context,
cargo publish -n
andcargo package
are similar.What command to run in CI to catch problems during development is a different situation that this documentation is not speaking to.
However, I'm not too sure the value of calling out
cargo package
here. imo that would be the reason would remove the reference.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my initial reaction too, but this section of the docs was the first thing I found when my
--dry-run
failed and I was trying to figure out what to do about it, andpackage
was indeed the solution.Will defer to your judgement of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"which is similar" instead of "which is equivalent"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. They used to be “more equivalent” before
-Zpackage-worksapce
came out. I also agree that we should removecargo package
entirely from that sentence.An alternative to this is that we could expand the doc of
cargo publish --dry-run
a bit. We could document about it checks whatcargo package
does plus some extra stuff. If people don't want to talk to remote registries for those extra checks, usecargo package
.