-
Notifications
You must be signed in to change notification settings - Fork 13
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
DeflateCRC32Stream is broken with NodeJS 15.6.0 #31
Comments
Looking at the changelog for Node v15.6.0, I noticed nodejs/node#36618, which seems potentially related. |
Probably the end function was calling the write (overloaded in DeflateCRC32Stream) but now end is not calling this write function anymore causing the problem. |
EDIT: @xfournet has the same idea in #31 (comment) Minimized even further: const {DeflateRaw} = require('zlib');
class MyStream extends DeflateRaw {
constructor(options) {
super(options);
}
write(chunk, enc, cb) {
console.log("Write: " + chunk + " " + enc + " " + cb);
}
}
console.log("Running");
const s = new MyStream();
s.end(Buffer.from('hello world')); On Node v15.5.0, this prints:
On Node v15.6.0, this prints:
|
Opened nodejs/node#37027 |
In meantime I wrote this patch (a bit ugly) to use with patch-package. It works with NodeJS 15.5.1 & 15.6.0 File
|
Fix in PR #32 |
* Update `compress-commons` for Node 15 support Right now we're producing ZIP files with incorrect CRC32s on Node 15+. This has a few of effects: - macOS Finder gets confused and doesn't detect the ZIP file as password protected. Instead, it unzips everything as a 0 byte file - Running `unzip` from the command line succeeds but warns about incorrect CRC32 - Our unit tests (correctly) fail This is ultimately due to archiverjs/node-crc32-stream#31 To pull in the fix for that we need `crc32-stream@4.0.2`. That requires updating both `compress-commons` and `zip-stream` to their latest versions. The version bumps look scary here but they're mostly due to dropping support for old Node versions. They now require Node 10+; this should be fine considering our Travis config only tests 12+. * Update `package-lock.json`
Starting with NodeJS 15.6.0, calling
end(chunk)
on aDeflateCRC32Stream
instance, the checksum is no more updated. This cause this bug archiverjs/node-archiver#491The text was updated successfully, but these errors were encountered: