fix: create consistent output across architectures #69
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.
thanks to architecture specific optimizations in the default deflate compression strategies, we end up with inconsistent output between arm64 and x86_64.
this change forces the compression strategy to one that appears to give more consistent results. they are larger, but since they're just temp files that feels like an acceptable trade off in the name of consistency.
for posterity's sake i'll mention here that Z_HUFFMAN_ONLY also provides a consistent end result, though i found better performance and compression with Z_RLE in some brief testing of a handful of npm related repositories.
note: i updated the CI matrix to match that of https://github.com/npm/cli
yes, the windows tests fail. however, i felt it was important to test the updated compression strategy for consistency in windows as well as linux and osx. i can fix the rest of the tests for windows before this lands, or we can land it as-is with a follow up PR to fix the tests for windows
edit: the node 10.1 test failures were a surprise, though appear to be unrelated to these changes
References
Closes npm/cli#2846