Skip to content

Make the prebuild step work on Windows - #770

Open
aramfachan wants to merge 1 commit into
openai:mainfrom
aramfachan:pr/windows-prebuild
Open

aramfachan wants to merge 1 commit into
openai:mainfrom
aramfachan:pr/windows-prebuild

Conversation

@aramfachan

Copy link
Copy Markdown

Problem

npm runs package scripts with cmd.exe on Windows, and cmd.exe does not understand mkdir -p:

> mkdir -p plugins/codex/.generated/app-server-types && codex app-server generate-ts ...

creates a stray directory literally named -p next to the real one. CI only runs on ubuntu-latest, so this goes unnoticed.

Change

One line in package.json: prebuild creates the generated-types directory with

node -e "require('node:fs').mkdirSync('plugins/codex/.generated/app-server-types',{recursive:true})"

It behaves the same under cmd.exe and POSIX shells, and Node is already a requirement.

Verification

Windows 11, Node 24.18, codex-cli 0.155.0-alpha, starting from a deleted plugins/codex/.generated:

npm script shell npm run build stray -p dir
cmd.exe (npm default on Windows) exit 0, types generated, tsc OK no
Git Bash exit 0, types generated, tsc OK no

No behavior change on Linux/macOS.

Related Windows work already in flight (not duplicated here)

While checking for duplicates, I found these open PRs that already cover the other Windows issues I hit when running the suite on Windows 11 (es-ES):

With those fixes and this one applied locally, the suite gives 93 pass, 0 fail, 2 skipped on Windows 11 (es-ES), and the build succeeds.

🤖 Generated with Claude Code

npm runs package scripts with cmd.exe on Windows, where `mkdir -p` is
not a flag: `npm run build` created a directory literally named "-p"
next to the real one. Create the generated-types directory with
`node -e "require('node:fs').mkdirSync(..., {recursive: true})"`,
which behaves the same under cmd.exe and POSIX shells.

Verified on Windows 11 (cmd.exe as npm script shell, Node 24.18,
codex-cli 0.155.0-alpha): `npm run build` generates the app-server
types and `tsc -p tsconfig.app-server.json` succeeds, with no stray
"-p" directory. Also verified under Git Bash.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aramfachan
aramfachan requested a review from a team September 19, 2026 03:14
Edo771977 added a commit to Edo771977/codex-plugin-cc that referenced this pull request Sep 20, 2026
Import openai#770 so the build survives a second run on Windows
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.

1 participant