Use BTreeMap instead of HashMap for source bundle manifest #489
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.
I noticed this when reimplementing some of sentry-cli's upload-difs portions, basically the exact same input objects (in our case wasm binaries + source bundles) would always say there were missing chunks on the server, The cause of which was the use of a HashMap to store the files in the source bundle manifest, which will give non-deterministic output with the same input due to the default HashMap hash randomization. Changing to use a BTreeMap gives deterministic ordering so that the same input object will always give the same output source bundle.
Also just want to note, the only reason that this is the case is that PR #470 changed the zip crate to remove default features, one of which is
time
, which when not present will always use1980-01-01
for the timestamp.