Skip to content

rust - make proto file ordering determinist - #636

Open
Devansh-567 wants to merge 1 commit into
p4lang:mainfrom
Devansh-567:fix-nondeterministic-proto-file-order
Open

Devansh-567 wants to merge 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>
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.

1 participant