[Windows] the npm package acceptance cannot run on Windows, and docs/installation.md says so

未關閉
#618 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
10/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
github-actions, node.js, typescript

研究方向

The issue describes changes across scripts/verify-cli-release.mjs, scripts/verify.mjs, and the Windows smoke and BYOK test runs; it also reports that an implementation already passes on a contributor branch. Read those scripts and the branch evidence first, then check which changes, if any, remain unmerged. Done means Windows package acceptance runs successfully and docs/installation.md reflects the verified behavior.

由索引模型根據 Issue 內容生成。

描述

Labels requested: ci, documentation, needs-triage

Product or interface

Source build or repository tooling — the npm package acceptance of the CLI release.

Version

  • Source: main @ 3c21163 (repository version 0.7.2), tag v0.7.2 = c6c7f28
  • Node.js v24.18.0, pnpm 9.12.0

Platform

Windows

OS version and architecture

Windows 11 x64 (build 26200)

Issue area

Build / CI / source distribution

What happens

docs/installation.md states, in the installation section:

validated on Linux and macOS; Windows package acceptance is currently not run

That gap is still open, and it is not only a documentation statement — the acceptance itself cannot run on Windows today. scripts/verify-cli-release.mjs refuses the platform outright, and the release validator assumes a POSIX installation layout.

Steps to reproduce

  1. scripts/verify-cli-release.mjs starts with a platform guard that throws for anything that is not Linux or macOS.
  2. The validator then assumes the POSIX npm layout (<prefix>/lib/node_modules/…), the POSIX launcher (<prefix>/bin/mcode), and runs npm as a command — which Node cannot start on Windows, where the executable is npm.cmd.
  3. The cleanup at the end of the run removes the temporary installation with a single rmSync without retries, which fails with EPERM on Windows while the freshly installed files are still closing.
  4. scripts/verify.mjs blocks the package profile on Windows a second time, independently of the validator.

Expected and actual behavior

  • Expected: the package acceptance runs on Windows like it runs on Linux and macOS, and the documentation line reflects what is actually verified.
  • Actual: the acceptance is Windows-incompatible in five places, and pnpm verify --profile package cannot be executed on a Windows host at all.

What I changed

Branch: ci/windows-package-acceptance (commits f5ef17b, b029b41, a8cf597, ade841c, f719a0a, based on main @ 3c21163)

  1. The platform guard allows win32 alongside linux and darwin; the POSIX behaviour is unchanged.
  2. npm is started without a command shell. The previous attempt built a cmd.exe /c command line, which is not safe to quote: cmd.exe has no backslash escape, so a path containing " would end the quoted section and the rest would be parsed as command syntax, and % would still expand. npm now runs through its JavaScript entry point with process.execPath, the same pattern the repository already uses in test/windows-contract.test.mjs.
  3. The installation layout and launcher are resolved for Windows (<prefix>/node_modules/@minimax-ai/code and mcode.cmd); the POSIX branch is byte-identical.
  4. The cleanup retries with a delay and warns instead of failing the acceptance when Windows still holds a lock on a just-closed file.
  5. The package profile is no longer blocked on Windows in scripts/verify.mjs.
The test step needed room on Windows

The acceptance ends with node --test test/smoke.test.mjs test/byok.test.mjs. On Windows those two files need substantially more time than the 240 s the wrapper allowed — measured on this host:

file duration of which
test/smoke.test.mjs 175 036 ms (20 pass / 0 fail) the proxy subtest alone 107 707 ms for eight children
test/byok.test.mjs 242 315 ms (2 pass / 0 fail) first test 235 394 ms
sum ~417 s against the previous 240 s budget

The reason is structural rather than incidental: test/smoke.test.mjs allows runtimeTimeoutMs = 30000 on Windows for each of the eight children in the proxy subtest, so 8 × 30 s = 240 s is already the entire outer budget before byok contributes anything. On Linux and macOS the per-child budget is 15 s, which still fits.

The wrapper's budget was raised accordingly, and the proxy subtest was brought down to 37 305 ms without weakening it: it still checks all eight variable names individually, and with the proxy handling in the child process broken, all eight cases fail (mutation evidence in the branch report).

Evidence

The acceptance passes on Windows with the branch applied:

MCODE_RELEASE_TAG=v0.7.2 \
MCODE_RELEASE_ARCHIVE=<...>/minimax-code-0.7.2.tar.gz \
MCODE_VERIFY_REPORT_DIR=<...> \
pnpm verify --profile package
→ test:release-package: PASS

The report the acceptance writes confirms the platform and the revision:

{
  "status": "PASS",
  "version": "0.7.2",
  "revision": "ade841c08eed06f6327dc767f5b87e95470c3dcd",
  "platform": "win32",
  "arch": "x64",
  "node": "v24.18.0"
}

The revision above is the commit before the documentation change, so the ordering is verifiable: the acceptance was green, and only then did docs/installation.md change. A second run on the earlier commit b029b41 is green as well, and a run on the final commit f719a0a takes 223.6 s.

The installed CLI itself is exercised by the acceptance — the npm global install, mcode.cmd --version, the SQLite binding, the bundled ripgrep, and the smoke and BYOK suites all run against the installed package, not against the source tree.

One caveat about the runtime

The acceptance is time-sensitive, and the eight proxy cases in the smoke suite now start their CLI children concurrently. On a machine that is already busy — for example when another acceptance run is in flight — those children compete for CPU and the step can fail intermittently. On an idle Windows host the step passes in ~224 s against the 600 s budget. If the step is ever added to a CI matrix, it should not run in parallel with other heavy jobs on the same runner.

What is deliberately not changed

The release matrix in scripts/lib/cli-release.mjs (cliReleaseTargets = ['ubuntu-latest', 'macos-latest']) and the workflow file are not touched — that is a release-pipeline decision. The four edits that would add a Windows job are prepared as a diff in the branch report and left for the maintainers:

  • scripts/lib/cli-release.mjs:30 — add windows-latest to cliReleaseTargets
  • .github/workflows/cli-release.yml — the install job matrix
  • scripts/publish-cli-release.mjs:24 and :49 — the publish targets

Before submitting

  • I have searched existing issues.
  • I have included my version and removed sensitive information.
主要語言
TypeScript
星號
2.3k
分支
315
平均合併
3 小時 54 分鐘
30 天內合併 PR
9

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

MiniMax-AI/minimax-code 的其他 Issue

查看 MiniMax-AI/minimax-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。