Skip to content

fix: zip inflate with yauzl on node v24.16.0#318682

Merged
deepak1556 merged 1 commit into
mainfrom
robo/bump_yauzl
May 29, 2026
Merged

fix: zip inflate with yauzl on node v24.16.0#318682
deepak1556 merged 1 commit into
mainfrom
robo/bump_yauzl

Conversation

@deepak1556

Copy link
Copy Markdown
Collaborator

Followup to #316661

Node.js v24.16.0 made Readable.prototype.pause()/resume() a no-op once the stream is marked destroyed (nodejs/node#62557). yauzl fd-slicer sets self.destroyed = true before self.push(null) at end-of-range, so once Node 24.16 sees the destroyed flag, zlib never flushes its tail and never emits 'end'.

npm run electron (build/lib/electron.ts → @vscode/gulp-electron → gulp-vinyl-zip → yauzl) silently produces a
broken .build/electron containing only a handful of files: the first large compressed entry hangs forever, and the
build exits with a corrupt Electron bundle.

The fix landed upstream in yauzl 3.3.1 (thejoshwolfe/yauzl#170), which rewrites the vendored fd-slicer to use the proper _destroy(cb) contract.

Audit of yauzl consumers in the repo (by copilot)

Direct callers:

  • src/vs/base/node/zip.ts
    Uses: open(path, { lazyEntries }, cb), Entry, ZipFile types, zipfile.openReadStream(entry, cb), zipfile.readEntry(), events 'entry'/'close'/'error'. All present and unchanged in v3.
  • build/azure-pipelines/common/publish.ts
  • build/azure-pipelines/common/downloadCopilotVsix.ts
    Both use: yauzl.open(zipPath, { lazyEntries: true, autoClose: true }, cb) and zipfile.openReadStream(entry, cb). Both unchanged in v3.

Indirect callers (node_modules):

  • @vscode/ripgrep/lib/download.js — yauzl.open(...openReadStream...)
  • extract-zip/index.js — yauzl.open(...openReadStream...)
  • gulp-vinyl-zip/lib/src/index.js — yauzl.fromBuffer/open + openReadStream
  • @vscode/vsce/out/zip.js — yauzl.open(...openReadStream...)

API contract: v2 -> v3 is safe for every caller above

yauzl 3.x removed only legacy stuff that no caller in this repo relies on:

  • Drops support for Node <12.
  • Removes the external fd-slicer dependency; vendors a small internal one. None of our callers touch fd-slicer directly.
  • decodeStrings: false is no longer auto-enabled when strictFileNames is true; our callers do not pass either option, so default behavior is unchanged.
  • The public surface used by every caller above —
    open(path, options?, cb),
    fromBuffer(buffer, options?, cb),
    dosDateTimeToDate(date, time),
    ZipFile: readEntry(), openReadStream(entry, options?, cb),
    events 'entry'/'end'/'close'/'error',
    Entry: fileName, compressionMethod, compressedSize, uncompressedSize, relativeOffsetOfLocalHeader,
    getLastModDate(), lazyEntries, autoClose options is identical between 2.x and 3.x.
  • @types/yauzl stays compatible: v3 did not remove or rename any exported type used by src/vs/base/node/zip.ts.

@deepak1556 deepak1556 added this to the 1.123.0 milestone May 28, 2026
@deepak1556 deepak1556 self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 04:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates yauzl to ^3.3.1 across the root, build/, and remote/ package manifests (with matching overrides) to pick up the upstream fix that makes the vendored fd-slicer use the proper _destroy(cb) contract. This unblocks npm run electron and any zip extraction path on Node v24.16.0+, where Readable.pause()/resume() becomes a no-op once a stream is marked destroyed, causing yauzl 2.x to hang mid-inflate.

Changes:

  • Bump yauzl from ^3.0.0/^2.10.0 to ^3.3.1 in root, build/, and remote/ package.json, including adding yauzl to each overrides block so nested consumers (e.g. gulp-vinyl-zip, extract-zip, @vscode/ripgrep, @vscode/vsce) all resolve to 3.3.1.
  • Regenerate lockfiles to resolve top-level yauzl@3.3.1 and remove the previously-nested old yauzl/fd-slicer copies.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Bumps yauzl dep to ^3.3.1 and adds matching root override.
package-lock.json Resolves top-level yauzl@3.3.1; removes nested old yauzl and fd-slicer entries from @vscode/ripgrep, extract-zip, and gulp-vinyl-zip.
build/package.json Bumps build yauzl dep from ^2.10.0 to ^3.3.1 and adds override.
build/package-lock.json Updates yauzl to 3.3.1 and drops the fd-slicer transitive dep.
remote/package.json Bumps yauzl to ^3.3.1 and adds override (keeps versions aligned with root for hygiene check).
remote/package-lock.json Resolves yauzl@3.3.1 at the top level.
Files not reviewed (2)
  • build/package-lock.json: Language not supported
  • remote/package-lock.json: Language not supported

@deepak1556 deepak1556 marked this pull request as ready for review May 29, 2026 07:00
@deepak1556 deepak1556 enabled auto-merge (squash) May 29, 2026 07:00
@deepak1556 deepak1556 merged commit b0bdc05 into main May 29, 2026
80 of 82 checks passed
@deepak1556 deepak1556 deleted the robo/bump_yauzl branch May 29, 2026 07:01
deepak1556 added a commit that referenced this pull request Jun 28, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.
deepak1556 added a commit that referenced this pull request Jun 29, 2026
* chore: bump electron@42.4.0

* chore: apply temp dir workaround for short paths

* chore: use 24.15.x for CI node

* chore: update nodejs build

* chore: bump electron@42.5.0

* fix: unblock playwright install on node 24.17

Node 24.16+ made Readable pause()/resume() a no-op on destroyed streams
which makes yauzl 2.x / extract-zip 2.x and older playwright extraction
hang forever.

- extensions/copilot: add "yauzl": "^3.3.1" override (was missed by #318682)
  so electron and @vscode/vsce no longer resolve the broken yauzl 2.10, fixing the
  hung `npm ci` in the Copilot and Extract chat-lib pipelines.
- extensions/copilot: bump electron ^39.8.5 -> ^42.5.0 so its install
  script uses the native @electron-internal/extract-zip instead of extract-zip.
- bump @playwright/test ^1.56.1 -> ^1.61.1 so `playwright install`
  uses the fixed extractor, unblocking the "Download Electron and
  Playwright" step in all electron test pipelines.

* chore: update build

* agentHost: fix macOS sandbox smoke sentinel parsing

On macOS CI, the AgentHost sandbox smoke test resolves the shell to
/bin/sh, which uses the sentinel-based completion path. In that path, the
parser could consume the echoed sentinel command text
(`<<<COPILOT_SENTINEL_..._EXIT_$?>>>`) before the real numeric marker
arrived, causing a false `Exit code: -1` failure even though the command
later completed successfully.

Harden the sentinel parser to ignore echoed/non-numeric sentinel text
and use the latest complete numeric marker instead. Also force the
macOS AgentHost sandbox smoke test to use /bin/sh and assert that in the
suite log so local runs exercise the same path as CI.

Adds a regression test for echoed sentinel command text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: update screenshot baseline after playwright bump

* chore: bump distro

* chore: fix typecheck

* chore: bump distro

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants