Skip to content

rust - make proto file ordering determinist - #636

Merged
chrispsommers merged 1 commit into
p4lang:mainfrom
Devansh-567:fix-nondeterministic-proto-file-order
Oct 9, 2026
Merged

chrispsommers merged 1 commit into
p4lang:mainfrom
Devansh-567:fix-nondeterministic-proto-file-order

Conversation

@Devansh-567

Copy link
Copy Markdown
Contributor

Sort the .proto files discovered by WalkDir before compiling them in the Prost and Tonic build scripts.

WalkDir doesn't guarantee the order in which files are returned. That means the order passed to the protobuf compiler can depend on the filesystem or environment.

Sorting the list gives us a consistent order across machines and CI runs, making the generated output more reproducible.

Changes

  • Sort proto_files in rust/p4runtime-prost/build.rs
  • Sort proto_files in rust/p4runtime-tonic/build.rs

No other build logic or dependencies are changed.

Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@chrispsommers chrispsommers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@chrispsommers
chrispsommers merged commit 90e7e04 into p4lang:main Oct 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants