env: Replace extract-zip with adm-zip to fix hang on Node 24.16#78828
Conversation
[email protected] depends on [email protected] / [email protected]. On Node 24.16.0 (libuv 1.52.1), the fd-slicer read stream piped into zlib.InflateRaw stalls under backpressure and never emits 'end', leaving the extractZip() promise unresolved. With nothing left on the event loop, Node exits 0 silently before Docker starts. Replace with adm-zip (already used in @wordpress/scripts, zero deps, pure-JS) which is unaffected by the libuv change. Fixes #78762 Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 8.21 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 23d0f38. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/26679041164
|
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@t-hamano Is this something in your list for review. I'm also facing an issue in node 24.16 |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for working on this. I was able to reproduce the issue in my local environment and have confirmed that this PR resolves it.
I believe this issue stems from yauzl being v2, but unfortunately, extract-zip does not yet support yauzl v3. For now, using adm-zip seems to be the simplest solution.
|
@t-hamano Do you know when new package get release? |
I believe the npm packages will be released at the same time as the RC1 of the Gutenberg plugin. The next release of the Gutenberg plugin RC1 should be next Wednesday. |
wp-env <=11.8.0 silently exits 0 without booting Docker on Node 24.16+ (zip extraction hangs in extract-zip/fd-slicer), so plugin-check fails with "Environment not initialized" on the new ubuntu-24.04 runner image. Pre-seed Node 24.15.0 and drop newer 24.x from the toolcache so the action's `node-version: '24'` resolves to the last working version. Temporary: revert once @wordpress/env ships the adm-zip fix (WordPress/gutenberg#78828, WordPress/plugin-check-action#579).
) * Clear language preference server-side when switching back to source Selecting the source language in the switcher kept redirecting visitors to the last translated language. The preference cookie was set server-side (with COOKIEPATH/COOKIE_DOMAIN) but cleared only by a client-side click handler hardcoding path=/ and no domain — so the deletion missed the cookie on subdirectory/multisite installs, never ran for new-tab clicks, and raced WP 6.8+ speculative loading. The switcher's source-language link now carries an explicit ?universally_switch=source marker. On unprefixed GETs the server clears the cookie with the exact attributes it was set with, then 302s to the clean URL (marker stripped, remaining query preserved byte-for-byte). The JS deletion stays as an instant local effect but is no longer load-bearing. * Add 1.0.5 changelog entry for source-language switch fix * Remove Awesome Motive references from readme * CI: pin Node 24.15.0 for plugin-check-action (wp-env boot hang) wp-env <=11.8.0 silently exits 0 without booting Docker on Node 24.16+ (zip extraction hangs in extract-zip/fd-slicer), so plugin-check fails with "Environment not initialized" on the new ubuntu-24.04 runner image. Pre-seed Node 24.15.0 and drop newer 24.x from the toolcache so the action's `node-version: '24'` resolves to the last working version. Temporary: revert once @wordpress/env ships the adm-zip fix (WordPress/gutenberg#78828, WordPress/plugin-check-action#579). * CI: skip composer audit with zero deps; pin Node in ship workflow too composer audit hard-errors ("No installed packages found") when there is nothing to audit — the plugin's composer.json only declares the PSR-4 autoloader. Guard the job to skip until a real dependency exists, and run composer install before auditing once one does. Also apply the Node 24.15.0 pin for plugin-check-action to ship-to-wp-org.yml (same wp-env boot hang as validate-pr.yml). --------- Co-authored-by: Andrei Surdu <[email protected]>
What?
Closes #78762
Replace
extract-zipwithadm-zipin@wordpress/envto fix a silent hang on Node 24.16.Why?
wp-env startsilently exits with code 0 on Node 24.16.0 (libuv 1.52.1) when.wp-env.jsoncontains URL-based zip sources (coreorpluginspointing to.zipURLs). Docker never starts and no error is shown.Root cause:
[email protected]→[email protected]→[email protected]. On Node 24.16, thefd-slicerread stream piped intozlib.InflateRawstalls under backpressure and never emitsend, leavingawait extractZip(...)unresolved. With nothing left on the event loop, Node drains it and exits0cleanly. Leftover*.zip+*.tempfiles in~/.wp-env/<hash>/confirm extraction stops mid-way.The issue only affects zips large enough to require multiple reads and backpressure (WordPress core,
plugin-check). Small zips complete before backpressure occurs.How?
Replace
extract-zipwithadm-zip, which is already a dependency of@wordpress/scripts, has zero transitive dependencies, and is pure-JS (nofd-slicer/yauzl). UseextractAllToAsyncto keep the async/non-blocking behaviour.Net change to
package-lock.json: removesextract-zip,yauzl,fd-slicerand their sub-deps (−26 lines).Testing Instructions
.wp-env.jsonto include URL-based sources:{ "core": "https://wordpress.org/latest.zip", "plugins": [ "https://downloads.wordpress.org/plugin/plugin-check.zip" ] }wp-env start.WordPress development site startedwithout silently exiting.*.zipor*.tempresidue is left in~/.wp-env/<hash>/.Testing Instructions for Keyboard
N/A — CLI tool, no UI changes.
Screenshots or screencast
N/A
Use of AI Tools
Investigated and implemented with Claude Code (Claude Opus 4.8). The root cause analysis, reproduction, and fix were reviewed and verified manually.