Use write-if-changed pattern in buffa-build to avoid unnecessary recompilation#17
Merged
iainmcgin merged 1 commit intoanthropics:mainfrom Mar 30, 2026
Merged
Use write-if-changed pattern in buffa-build to avoid unnecessary recompilation#17iainmcgin merged 1 commit intoanthropics:mainfrom
iainmcgin merged 1 commit intoanthropics:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
iainmcgin
approved these changes
Mar 30, 2026
Collaborator
iainmcgin
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
iainmcgin
added a commit
to anthropics/connect-rust
that referenced
this pull request
Mar 30, 2026
Skip writing output files when content is already identical, preserving mtime so Cargo doesn't spuriously recompile downstream crates. Cargo's rebuild decision for include!-ed files is mtime-based (rustc dep-info lists the file, Cargo compares mtime vs fingerprint). Before this change, touching any single .proto file re-ran the build script and unconditionally rewrote every output .rs, bumping all their mtimes and cascading into a full recompile even when N-1 of N files were byte-identical. Mirrors anthropics/buffa#17 and prost-build's write_file_if_changed.
…mpilation Skip writing output files when their content is identical to what's already on disk, preventing timestamp changes that trigger needless downstream rebuilds. Co-authored-by: fanyang89 <fanyang89@outlook.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Skip writing output files when their content is identical to what's already on disk, preventing timestamp changes that trigger needless downstream rebuilds.