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: force gzip compression level to 9 #71

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/util/tar-create-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ const tarCreateOptions = manifest => ({
cwd: manifest._resolved,
prefix: 'package/',
portable: true,
gzip: true,
gzip: {
// forcing the level to 9 seems to avoid some
// platform specific optimizations that cause
// integrity mismatch errors due to differing
// end results after compression
level: 9
},

// ensure that package bins are always executable
// Note that npm-packlist is already filtering out
Expand Down
10 changes: 5 additions & 5 deletions tap-snapshots/test-dir.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
exports[`test/dir.js TAP basic > extract 1`] = `
Object {
"from": "file:test/fixtures/abbrev",
"integrity": "sha512-Ict4yhLfiPOkcX+yjBRSI2QUetKt+A08AXMyLeQbKGYg/OGI/1k47Hu9tWZOx1l4j+M1z07Zxt3IL41TmLkbDw==",
"integrity": "sha512-OCm45DHz7n9f1SEllmg3Bf1zBCzsiOYxMuodMZ5ux+HMoupmkzOftyOCKH07DhAcoyfUlos2VGmYkPHDxH92yg==",
"resolved": "\${CWD}/test/fixtures/abbrev",
}
`
Expand Down Expand Up @@ -176,15 +176,15 @@ Object {
exports[`test/dir.js TAP make bins executable > results of unpack 1`] = `
Object {
"from": "file:test/fixtures/bin-object",
"integrity": "sha512-rlE32nBV7XgKCm0I7YqAewyVPbaRJWUQMZUFLlngGK3imG+som3Hin7d/zPTikWg64tHIxb8VXeeq6u0IRRfmQ==",
"integrity": "sha512-hvYyDtqhAkxg/NF7eOjCpDcIs7ksaZjk9vrBkktxTJ0liITA/FsnEgmbP9l8h3rp+zN1QIvKAUvyTCYRpyCqZQ==",
"resolved": "\${CWD}/test/fixtures/bin-object",
}
`

exports[`test/dir.js TAP responds to foregroundScripts: true > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-HTzPAt8wmXNchUdisnGDSCuUgrFee5v8F6GsLc5mQd29VXiNzv4PGz71jjLSIF1wWQSB+UjLTmSJSGznF/s/Lw==",
"integrity": "sha512-+bTA3RvkXgLMM1PIzfcwXkiiSYzCBHT6Jrqo8yt3owZtMhOnBomH1Dc0949tVurdyPk7WcrKitvsRnXRPCD4sQ==",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down Expand Up @@ -250,7 +250,7 @@ Object {
exports[`test/dir.js TAP responds to foregroundScripts: true and log:{level: silent} > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-HTzPAt8wmXNchUdisnGDSCuUgrFee5v8F6GsLc5mQd29VXiNzv4PGz71jjLSIF1wWQSB+UjLTmSJSGznF/s/Lw==",
"integrity": "sha512-+bTA3RvkXgLMM1PIzfcwXkiiSYzCBHT6Jrqo8yt3owZtMhOnBomH1Dc0949tVurdyPk7WcrKitvsRnXRPCD4sQ==",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down Expand Up @@ -316,7 +316,7 @@ Object {
exports[`test/dir.js TAP with prepare script > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-HTzPAt8wmXNchUdisnGDSCuUgrFee5v8F6GsLc5mQd29VXiNzv4PGz71jjLSIF1wWQSB+UjLTmSJSGznF/s/Lw==",
"integrity": "sha512-+bTA3RvkXgLMM1PIzfcwXkiiSYzCBHT6Jrqo8yt3owZtMhOnBomH1Dc0949tVurdyPk7WcrKitvsRnXRPCD4sQ==",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down
4 changes: 3 additions & 1 deletion test/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ t.test('exposes tarCreateOptions method', async t => {
cwd: '/home/foo',
prefix: 'package/',
portable: true,
gzip: true,
gzip: {
level: 9
},
mtime: new Date('1985-10-26T08:15:00.000Z'),
},
'should return standard options'
Expand Down
4 changes: 3 additions & 1 deletion test/util/tar-create-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ t.match(
cwd: '/home/foo',
prefix: 'package/',
portable: true,
gzip: true,
gzip: {
level: 9
},
mtime: new Date('1985-10-26T08:15:00.000Z'),
},
'should return standard options'
Expand Down