Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reproducible builds due to how derives were populated #455

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

nick-mobilecoin
Copy link
Collaborator

@nick-mobilecoin nick-mobilecoin commented Dec 11, 2023

Previously HashSet was used to prevent duplicate entries in the
computed derive attributes for bindgen generated code. The default
hasher used in HashSet is randomly seeded on each process run to
prevent HashDos. This random seeding resulted in changing the ordering
of the resulted derive attributes. This changing order of the derive
attributes prevented reproducible builds as the derived implementations
would move around in the resultant binary. Now BtreeSet is used to
prevent duplicate derives during code generation. This provides a
consistent ordering of the derives.

@nick-mobilecoin
Copy link
Collaborator Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@meowblecoinbot meowblecoinbot requested a review from a team December 11, 2023 16:27
@github-actions github-actions bot added the size/M PRs with less than 250 lines of changes label Dec 11, 2023
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (5123503) 88.40% compared to head (46fde17) 88.90%.

Files Patch % Lines
core/build/src/lib.rs 85.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
+ Coverage   88.40%   88.90%   +0.49%     
==========================================
  Files          40       40              
  Lines        5667     5696      +29     
==========================================
+ Hits         5010     5064      +54     
+ Misses        657      632      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Previously `HashSet` was used to prevent duplicate entries in the
computed derive attributes for bindgen generated code. The default
hasher used in `HashSet` is randomly seeded on each process run to
prevent HashDos. This random seeding resulted in changing the ordering
of the resulted derive attributes. This changing order of the derive
attributes prevented reproducible builds as the derived implementations
would move around in the resultant binary. Now `BtreeSet` is used to
prevent duplicate derives during code generation. This provides a
consistent ordering of the derives.
@nick-mobilecoin nick-mobilecoin force-pushed the nick/fix-reproducible-builds branch from 415b389 to 46fde17 Compare December 11, 2023 16:34
@nick-mobilecoin nick-mobilecoin removed the request for review from a team December 11, 2023 16:35
@nick-mobilecoin nick-mobilecoin merged commit 9ee2d34 into main Dec 11, 2023
51 of 52 checks passed
@nick-mobilecoin nick-mobilecoin deleted the nick/fix-reproducible-builds branch December 11, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M PRs with less than 250 lines of changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants