Generate one file per XDR type#520
Merged
leighmcculloch merged 9 commits intomainfrom Mar 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the build/cleanup wiring to support splitting XDR-generated Rust output into multiple files (instead of a single large generated.rs), improving formatting coverage and cleanup behavior.
Changes:
- Run
rustfmtover both the legacy target and the new per-type generated.rsfiles. - Extend
make cleanto remove the generated output directory.
Comments suppressed due to low confidence (1)
Makefile:51
xdr-jsonstill depends onsrc/generated.rs, but the PR description says generation is moving away from a singlegenerated.rsfile. This dependency should be updated to depend on the new artifact that represents a completed generation step (e.g., asrc/generated/mod.rsentrypoint, or a dedicated stamp file likesrc/generated/.stampthat the generator touches at the end). Otherwisemake xdr-jsonmay not rebuild when per-type outputs change, or may fail ifsrc/generated.rsis no longer produced.
xdr-json: src/generated.rs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 73b3da3.
dmkozh
approved these changes
Mar 27, 2026
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.
What
Change the XDR Rust code generator to output one
.rsfile per type definition instead of a singlegenerated.rsfile.Why
A single 74k-line
generated.rsis unwieldy for navigation, IDE indexing, and incremental compilation. Splitting into per-type files makes it easier to find types, improves compile-time caching when only a subset of types change, and aligns with how hand-written Rust crates organize modules.There is no issue driving this improvement, however the following changes have really made it easier to make this change now: