-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Don't rewrite dep-info files if they don't change #5181
Don't rewrite dep-info files if they don't change #5181
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) |
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.
LGTM, though it might be worth to consider extracting deinfo-related stuff into a separate struct
previous[0].1 == deps { | ||
continue | ||
} | ||
} |
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.
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.
@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 |
📌 Commit f605676 has been approved by |
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
☀️ Test successful - status-appveyor, status-travis |
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