Print information about updated packages#1931
Conversation
|
Rats, CI fails. I'll have to patch all the tests for the new blurbs. |
There was a problem hiding this comment.
Another part of package ids is the source it comes from (e.g. foo from crates.io is different than foo from github). In addition to indicating the source, updates of git repositories probably want to print out the SHA that was updated to instead of the revision as that's the "precise" notion there. You should be able to access this through the precise field of the SourceId
There was a problem hiding this comment.
Alright, that shouldn't be hard. How would you like the SourceId displayed in the Git and the non-Git cases?
There was a problem hiding this comment.
Falling back to the normal Display implementation should be good enough
|
Thanks for picking this up @thirtythreeforty, looking good! We do also modify the lockfile in the case that the manifest was modified and then Also, to ensure that this scales well, could you try running this over Servo? If you check out servo and run |
|
Here's the output from Servo: |
|
The The lack of source on the second line is still a bit confusing, but I suppose it's easy enough to figure out that it's from the crate registry. |
|
Yeah we've got a pretty strong convention of not printing the registry URL for registry packages, so I think it'll quickly become common knowledge that "no source" means "crates.io". Also, thanks for generating that! Did it take an overly long time to generate or was it nice and speedy? (make sure you're using a |
|
Initially it took a while to download and it did a ton of work (looked like it was compiling something?) when it was updating git repos, but subsequent runs are pretty quick and don't heat up the processor at all. Generating the list of changes takes no time at all, as far as I can tell.
|
|
Perfect, sounds good to me! |
|
OK, that commit should address your feedback. (I knew The tests should all still fail because the test cases need to be rewritten to account for the extra info. I'll do that and squash everything once you and I are happy with the main implementation. Here's the new result for Servo: Note the |
There was a problem hiding this comment.
This may want to just be removed[0] as that'll print out the git source this came from as well.
There was a problem hiding this comment.
Doing that makes the update line look like this:
Updating offscreen_gl_context v0.1.0 (https://github.com/ecoal95/rust-offscreen-rendering-context#9efc32eb) -> #9704865b
Which I don't think is better, personally.
There was a problem hiding this comment.
Hm yeah it can get long sometimes, but I think it's better than not printing it because there's real contextual information (e.g. foo from a git repo is different than foo from crates.io is different than foo from a path source)
There was a problem hiding this comment.
Very well, I see your point.
|
Ok, looks good to me, thanks @thirtythreeforty! There's some failing tests but with those fixed and a squash I think this is good to go |
|
Thanks for the review! Just squashed with all the tests fixed. |
Compare #1621. Like that pull request, this one solves #984. I have rewritten most of @pyfisch's logic to account for @alexcrichton's comments. Specifically, this code will correctly handle adding/removing multiple versions of one package, as well as several packages with different sources, but the same name. The output looks like this: ``` [georgev@desertvoice cargo]$ cargo update Updating registry `https://github.com/rust-lang/crates.io-index` Updating libc v0.1.8 -> v0.1.10 Updating memchr v0.1.3 -> v0.1.5 Updating num v0.1.26 -> v0.1.27 Updating rand v0.3.9 -> v0.3.10 Updating rustc-serialize v0.3.15 -> v0.3.16 ``` Comments welcome. r? @alexcrichton
|
☀️ Test successful - 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 |
|
Glad to help! |
Compare #1621. Like that pull request, this one solves #984.
I have rewritten most of @pyfisch's logic to account for @alexcrichton's comments. Specifically, this code will correctly handle adding/removing multiple versions of one package, as well as several packages with different sources, but the same name.
The output looks like this:
Comments welcome.
r? @alexcrichton