Skip to content

Use write-if-changed pattern in buffa-build to avoid unnecessary recompilation#17

Merged
iainmcgin merged 1 commit intoanthropics:mainfrom
fanyang89:main
Mar 30, 2026
Merged

Use write-if-changed pattern in buffa-build to avoid unnecessary recompilation#17
iainmcgin merged 1 commit intoanthropics:mainfrom
fanyang89:main

Conversation

@fanyang89
Copy link
Copy Markdown
Contributor

Skip writing output files when their content is identical to what's already on disk, preventing timestamp changes that trigger needless downstream rebuilds.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@fanyang89
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 30, 2026
Copy link
Copy Markdown
Collaborator

@iainmcgin iainmcgin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@iainmcgin iainmcgin enabled auto-merge (squash) March 30, 2026 18:50
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.
@iainmcgin iainmcgin disabled auto-merge March 30, 2026 19:15
…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>
@iainmcgin iainmcgin merged commit 52e40a3 into anthropics:main Mar 30, 2026
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants