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

Aberta
#618 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
10/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
github-actions, node.js, typescript
Domínio
build-system, ci-cd, cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
TypeScript
Estrelas
2.3k
Forks
315
Merge médio
3h 54min
PRs com merge (30d)
9

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de MiniMax-AI/minimax-code

Todas as issues de MiniMax-AI/minimax-code

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.