Don't rewrite dep-info files if they don't change#5181
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 14, 2018
Merged
Conversation
Similar to how we treat lock files, read the contents, compare, and if they're the same don't actually write the file. Closes rust-lang#5172
|
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
matklad
reviewed
Mar 14, 2018
Contributor
matklad
left a comment
There was a problem hiding this comment.
LGTM, though it might be worth to consider extracting deinfo-related stuff into a separate struct
| previous[0].1 == deps { | ||
| continue | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Perhaps it's time to add a
#[derive(Eq)]
struct DepInfo { ... }
impl DepInfo {
fn parse(r: Read) -> CargoResult<Self>;
fn print(w: Write) -> CargoResult<Self>;
}it would be nice to have printing and the corresponding parsing code alongside each other.
Member
Author
|
@bors: r=matklad Makes sense! I don't think we'll be doing this too often though so I'm gonna go ahead and land for now, and we can follow up w/ an abstraction if we get more ambitious |
Contributor
|
📌 Commit f605676 has been approved by |
Contributor
bors
added a commit
that referenced
this pull request
Mar 14, 2018
Don't rewrite dep-info files if they don't change Similar to how we treat lock files, read the contents, compare, and if they're the same don't actually write the file. Closes #5172
Contributor
|
☀️ Test successful - status-appveyor, status-travis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Similar to how we treat lock files, read the contents, compare, and if they're
the same don't actually write the file.
Closes #5172