-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add --dry-run to cargo publish #2849
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
if !opts.verify && opts.dry_run { | ||
bail!("cannot specify both no verify and dry run \ | ||
simultaneously"); | ||
} |
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.
Could you clarify on what we're preventing with this check? I could imagine --dry-run
also being done to check the *.crate
manually without actually performing a build being a use case
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.
It was in the original PR. My guess is that it's not a full dry run if the verification step isn't run. Combining --no-verify and --dry-run works fine with the guard removed so I can remove it if you like.
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.
Yeah thinking back I think this should be ok to remove
Thanks @wezm! Looks great to me! cc @rust-lang/tools, other thoughts? |
Just from looking at the screenshot, "warning: Aborting" should not be capitalized. |
Should it be a warning at all? Seems like expected behaviour |
@@ -28,6 +29,7 @@ Options: | |||
--no-verify Don't verify package tarball before publish | |||
--allow-dirty Allow publishing with a dirty source directory | |||
--manifest-path PATH Path to the manifest of the package to publish | |||
--dry-run Performs all checks without uploading |
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.
nit: Perform, not Performs
I wondered about that. Perhaps the Uploading step could looks follows when it's a dry run:
Although that would be fairly easy to miss. |
I vaguely remember that s3cmd'd |
Ok folks what do you need from me to get this over the line? |
☔ The latest upstream changes (presumably #2867) made this pull request unmergeable. Please resolve the merge conflicts. |
Let's take out the extra check and leave the UI as-is for now, we can always tweak later and it's unfortunately not easy right now to have something vastly different than this. |
Ok
Should be good to go. |
Thanks! Could you also squash the commits as well? Other than that looks good to go to me. |
Squashed commit of the following: commit deed1d7b99c1cd142f7782d3b3b782d949e1f71f Author: Wesley Moore <wes@wezm.net> Date: Fri Jul 15 13:35:01 2016 +1000 Remove --dry-run and --no-verify mutual exclusion commit 8a91fcf2a1aa3ba682fee67bb5b3e7c2c2cce8ef Merge: 0c0d057 970535d Author: Wesley Moore <wes@wezm.net> Date: Fri Jul 15 13:30:38 2016 +1000 Merge remote-tracking branch 'upstream/master' into publish_dry_run commit 0c0d0572533599b3c0e42797a6014edf480f1dc2 Author: Wesley Moore <wes@wezm.net> Date: Tue Jul 12 08:03:15 2016 +1000 Improve grammar in --dry-run option commit a17c1bf6f41f016cafdcb8cfc58ccbe34d54fbb8 Author: Wesley Moore <wes@wezm.net> Date: Mon Jul 11 14:17:41 2016 +1000 Add test for passing no-verify and dry-run to publish commit 284810cca5df3268596f18700c0247de2f621c98 Author: Wesley Moore <wes@wezm.net> Date: Mon Jul 11 14:51:38 2016 +1000 Add test for publish --dry-run commit 8514e47fbce61c20b227815887a377c25d17d004 Merge: 2b061c5 ef07b81 Author: Wesley Moore <wes@wezm.net> Date: Mon Jul 11 08:27:10 2016 +1000 Merge branch 'publish_dry_run' of github.com:JustAPerson/cargo into publish_dry_run commit ef07b81 Author: Jason Priest <jpriest128@gmail.com> Date: Tue Jun 9 23:11:51 2015 -0500 Improve publish `--dry-run` Catch a few more errors by aborting midway through transmit(). commit 0686fb0 Author: Jason Priest <jpriest128@gmail.com> Date: Tue Jun 9 14:38:58 2015 -0500 Teach publish the `--dry-run` flag Closes rust-lang#1332
All squashed now |
Add --dry-run to cargo publish This PR picks up where @JustAPerson left off in #1699. I've updated their changes to apply to current master and added tests, including (I think) a test that checks that the upload doesn't actually occur. The output is as it was before: ![output](https://cloud.githubusercontent.com/assets/21787/16720362/f7ea710e-4778-11e6-8163-65f3978bb7ae.png) Closes #1332
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
This PR picks up where @JustAPerson left off in #1699. I've updated their changes to apply to current master and added tests, including (I think) a test that checks that the upload doesn't actually occur.
The output is as it was before:
Closes #1332