Repository navigation
build(release): actually ship winuxcmd-shim.exe, and refuse to index a file the archive lacks - #1225
Merged
Merged
Conversation
…file the archive lacks #1217 added `winuxcmd-shim.exe` and the wpm side that prefers it, but the release payload is assembled by CPack from the CMake install rules and the new target had none, so every published zip carried only `usr/bin/winuxcmd.exe`: the cheaper dispatch for `layout: shim` packages could never reach an installation, and nothing failed - the index was written, the release published, the install worked. - `install(TARGETS winuxcmd-shim RUNTIME DESTINATION usr/bin COMPONENT Runtime)` puts it in the payload (verified with the same rule CPack uses: `build-with-vs.ps1 -Target install` produces `install/usr/bin/winuxcmd-shim.exe`). - The index entry now maps `winuxcmd-shim.exe`, and `size` is measured from the archive instead of carrying whatever the first entry said - it has been wrong in every release (2,842,372 for a 4 MB archive). - `update-wpm-source-index.ps1` opens both zips and refuses to write an index that maps a file the archive does not carry. A stale mapping fails an install with "extracted path not found"; shipping a file nobody maps - this incident - silently does nothing. Both are now release failures. Verified with pwsh against the published 1.1.14 asset (refused, naming the missing file) and against fixtures carrying the shim (size 4,019,321 = the archive length, files = winuxcmd.exe + winuxcmd-shim.exe).
… landed via #1228; keep main's comment, this branch retains the index guard
This was referenced Oct 19, 2026
caomengxuan666
added a commit
to unixwin/codex
that referenced
this pull request
Oct 19, 2026
) * feat(release): publish @unixwin/codex, ship the wpm package, keep the index current Three things the org needs from this repository, in one place. **The npm scope moves to the org.** `@cmx666/codex` becomes `@unixwin/codex` (40 references across the workflow, both package scripts, `codex.js`'s platform map / install hints / self-detection path, `RELEASE.md` and the verifier). The `unixwin` npm org exists, so the next publish goes there; the old package stays published and gets deprecated pointing at the new name. **The canonical zip becomes a release asset.** `wpm` needs a versioned URL, not a workflow artifact (those need auth and expire), so the zip this job already builds is attached to a `codex-v<version>` pre-release. The index points at it, so the move and the rename have to land before the next publish. **The WPM index updates itself.** `scripts/niu/update-wpm-index.ps1` creates or rewrites the `codex` entry in unixwin/wpm-source - `layout: shim`, `commands: ["codex"]`, and a mapping that keeps `bin/codex.exe` beside `codex-resources/` and `codex-path/` so the executable resolves its helpers exactly as in the npm platform package. It refuses to write an index that maps a file the archive does not carry, which is the failure that let a package ship without its payload once already (unixwin/WinuxCmd#1225). The workflow step clones wpm-source, runs it, opens the PR and merges it; without `WPM_SOURCE_TOKEN` it warns and skips instead of failing a good npm release. Verified on the `unixwin` side too: wpm now resolves a shim payload from the artifact's `files` mapping when it is not at the `opt/<pkg>/<cmd>.exe` convention (unixwin/WinuxCmd#1252), which is what makes `bin/codex.exe` work. Fixtures: the script creates the entry on first run (real size and digest, urls on unixwin/codex), is idempotent, and refuses an archive missing a mapped directory. Workflow YAML parses; `codex.js`, `build_npm_package.py` and the verifier pass their syntax checks. * docs(npm): ship our README in the published package, keep the official one in the repo The npm package staged `README.md` from the repository root, so npmjs showed upstream's README - correct for the repository, misleading as the front page of an unofficial build. The stager now prefers `README-niu.md` when it exists, and that file says what this build is, how to install it (`@unixwin/codex`, or `wpm install codex` inside the niu stack), what differs, and that the official README still applies. Nothing in the repository's own README changes, so upstream merges stay clean. Verified by staging the meta package: `stage/README.md` is this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I shipped the forwarder's code in #1217 and not the forwarder: every release zip contained only
usr/bin/winuxcmd.exe, so the cheaper dispatch could never reach an installation. This closes that gap and adds the check that would have caught it.The miss
The release payload is produced by CPack (
Package with CPack (7Z + ZIP + TGZ)), so its contents come from the CMakeinstall()rules — and the new target had none. Nothing failed: the index entry was written, the release published, the install worked, and the feature was simply absent.The fix
install(TARGETS winuxcmd-shim RUNTIME DESTINATION usr/bin COMPONENT Runtime)— the shim now travels with the payload, next towinuxcmd.exeand the activation scripts. Verified locally with the same rule CPack uses:scripts/build-with-vs.ps1 -Target install→build-vs/install/usr/bin/winuxcmd-shim.exe(1,127,936 B).filesgainswinuxcmd-shim.exe, and — since this is the same script — thesizefield is finally measured from the archive instead of carrying whatever the first entry said. It has been wrong in every release so far (2,842,372 for a 4 MB archive); the recorded value is now the real one.wpm installfails with "extracted path not found" for a stale mapping, and the opposite mistake — shipping a file nobody maps — silently does nothing, which is exactly how this was missed. Both directions are now impossible to ship by accident.Verified
With
pwsh(what the workflow uses):Windows PowerShell 5.1 cannot run the script at all (
-Encoding utf8NoBOMis 7+ only) — unrelated to this change, noted because it makes the local dry run depend onpwsh.After this
The shim reaches users in the next release (1.1.15). On an existing installation,
wpm update winuxcmdinstalls it and the nextwpm links rebuild --force— which activation already runs — switches the shim packages over; the hop goes from a measured 24.5 ms to 12.1 ms forpython,node,curl,openssl,ssh*andgawk(#1207).