fix(release): skip dist/node_modules when building standalone archives - #5878
Conversation
|
Thanks for the PR! Template looks good ✓ On direction: this is a straightforward fix for a broken nightly release pipeline — #5747 started staging On approach: minimal one-line guard with an explanatory comment — exactly right. The standalone packager already rebuilds a clean, per-target Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 方向:修复 nightly release 流水线中断——#5747 把 audio-capture 暂存到 方案:最小改动——加一个 skip 条件配解释性注释,完全正确。standalone 打包器已经通过 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
|
Code review: The fix matches exactly what I'd do independently — add No issues found. ✅ Real-scenario test: Simulated the release pipeline by creating Before (installed build / main)After (this PR)(The prebuild warning is expected — this test environment doesn't have real audio-capture prebuilds. The release pipeline downloads them before packaging. The key point is the packager no longer aborts on 中文说明代码审查: 这个修复和我独立想到的方案完全一致——在 未发现问题。✅ 真实场景测试: 模拟 release 流水线,创建 修复前:报错 — Qwen Code · qwen3.7-max |
|
Stepping back: this is a clean, well-understood fix for a real pipeline breakage. The motivation is unambiguous (nightly release is failing), the root cause is clear (#5747 added a new dist entry that the standalone packager didn't expect), and the fix is the minimum possible change — one skip condition with a comment that explains the reasoning. The before/after test confirms it works: the exact error from the failing CI run reproduces on main and disappears with the patch. No reservations. This is the kind of PR you want to see — tight scope, clear rationale, and it actually fixes what it says it fixes. Approving. ✅ 中文说明退一步看:这是一个干净、理解透彻的修复,解决了真实的流水线中断问题。动机明确(nightly release 报错)、根因清楚(#5747 新增了一个 standalone 打包器没预料到的 dist 条目)、修复是最小可能的改动——一个跳过条件配一个解释原因的注释。前后对比测试确认有效:CI 失败时的确切报错在 main 上复现,打补丁后消失。 没有顾虑。这就是理想中的 PR——范围紧凑、理由清晰、确实修了该修的问题。 批准。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No review findings. Downgraded from Approve to Comment: CI still running.
— qwen3.7-max via Qwen Code /review
doudouOUC
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
What this PR does
Makes the standalone-archive packaging step ignore a
dist/node_modulesdirectory if one is present, instead of treating it as an unexpected asset and aborting. The standalone packager already rebuilds a clean, target-trimmedlib/node_modulesitself (viacopyNativeAddon), so it simply skips the staged copy the same way it already skips.DS_Store.Why it's needed
The nightly Release run is failing at the "Build Standalone Archives" step with:
#5747(bundle audio capture for mirror installs) madeprepare-package.jsstage the@qwen-code/audio-capturenative addon intodist/node_modulesfor the npm/mirror package. Butcreate-standalone-package.jsvalidates every top-leveldist/entry against an allowlist and fails on anything it doesn't recognize — so the newly-addeddist/node_modulesaborts the build. Copying it into the standalone archive would also be wrong: it would drag in every platform's prebuild and collide with the clean per-targetlib/node_modulesthatcopyNativeAddonbuilds. Skipping it is the intended behavior.Reviewer Test Plan
How to verify
npm run bundle && npm run prepare:packagesodist/node_modules/@qwen-code/audio-captureexists.npm run package:standalone:release -- --version 0.0.0-test --out-dir dist/standalone.Unexpected dist asset: .../dist/node_modules.lib/node_modules/@qwen-code/audio-capture(the per-target copy fromcopyNativeAddon), not a verbatim copy ofdist/node_modules.Evidence (Before & After)
N/A (release-pipeline packaging script; not user-visible). Failing run: https://github.com/QwenLM/qwen-code/actions/runs/28208998731/job/83568730397
Tested on
Environment (optional)
N/A
Risk & Scope
dist/entry.node --check.Linked Issues
Closes #5877
中文说明
这个 PR 做了什么
让 standalone 归档打包步骤在
dist/node_modules目录存在时跳过它,而不是把它当成未知资产并报错中断。standalone 打包脚本本身已经会重建一份干净的、按 target 裁剪的lib/node_modules(通过copyNativeAddon),所以这里直接跳过这个已暂存的目录,处理方式和已有的跳过.DS_Store一致。为什么需要
nightly Release 在 "Build Standalone Archives" 步骤失败:
#5747(为镜像安装打包 audio capture)让prepare-package.js把@qwen-code/audio-capture原生插件暂存到dist/node_modules,用于 npm/镜像包。但create-standalone-package.js会用白名单校验dist/下每个顶层条目,遇到不认识的就中断——于是新加的dist/node_modules把构建打断了。把它拷进 standalone 归档也是错的:会把所有平台的 prebuild 都带进来,并和copyNativeAddon构建的、按 target 裁剪的lib/node_modules冲突。跳过它才是预期行为。如何验证
npm run bundle && npm run prepare:package,使dist/node_modules/@qwen-code/audio-capture存在。npm run package:standalone:release -- --version 0.0.0-test --out-dir dist/standalone。Unexpected dist asset: .../dist/node_modules。lib/node_modules/@qwen-code/audio-capture(来自copyNativeAddon的按 target 拷贝),而非原样拷贝的dist/node_modules。关联失败构建:https://github.com/QwenLM/qwen-code/actions/runs/28208998731/job/83568730397