Skip to content

perf(release): build the NAPI addon on its own runners - #14138

Merged
zkochan merged 2 commits into
mainfrom
optimize-publish
Aug 24, 2026
Merged

zkochan merged 2 commits into
mainfrom
optimize-publish

Conversation

@zkochan

@zkochan zkochan commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Summary

The Rust release built the CLI binary and the NAPI addon back to back in one matrix leg per target. The two are compiled under different Cargo profiles — release for the CLI, napi-release for the addon (which must keep panic = "unwind") — so Cargo gives them separate target directories and they share not one compiled dependency. Every leg paid for the whole dependency graph twice, in series.

This splits the addon into its own build-rust-napi matrix over the same eight targets. Per-leg build time measured on the v12.0.0-rc.9 release run:

target CLI build addon build leg total
win32-arm64 508s 369s 17m09s
win32-x64 495s 363s 15m06s
darwin-arm64 477s 241s 12m30s
darwin-x64 461s 235s 12m10s
linux-* 322–351s 217–238s ~10m

The stage is bounded by its slowest leg, so taking the addon out of win32-arm64 moves the critical path from ~17 to ~11 minutes, and the whole release run from ~25m30s to roughly 19 minutes. The addon legs run alongside and gate nothing.

Nothing downstream needed changing: the new job uploads to binaries-rust-napi-<code-target>, which the binaries-rust-* download pattern that the verify, publish and draft-release jobs already use picks up and merges into the same directory. It also drops the build-node-gyp-payload dependency, since only the CLI archives ship dist/.

The toolchain prelude the two jobs share — installing cross, the clang-cl/ARM64 Visual Studio components, the rustup target, and the guard that the committed PNPM_VERSION matches the tag — moves into a rust-release-target composite action instead of being duplicated.

One thing worth a reviewer's eye: zizmor reports github-env (high) against that composite action's writes to GITHUB_ENV/GITHUB_PATH. It is a false positive of the move — the same script in release.yml was not flagged, because there zizmor can see the workflow only triggers on tag pushes, whereas a composite action cannot see who calls it. The values come from the Visual Studio installation the step just made and from vcvarsall, and the only caller is a release job running on a maintainer-signed tag. It is suppressed on that step with that justification. Verified with zizmor 1.29.0: .github/workflows/release.yml and the new action both report no findings.

Not verifiable end to end before merge — the workflow only runs on a version tag. The YAML and job graph were validated locally; the first release after this lands is the real test, and a failure is resumable by rerunning the tag (the plan job skips what is already published).

Squash Commit Body

The Rust release built the CLI binary and the NAPI addon back to back in
one matrix leg per target. The two are compiled under different Cargo
profiles — `release` for the CLI, `napi-release` for the addon, which
must keep `panic = "unwind"` so a panic reaching the FFI boundary becomes
a JS exception instead of aborting the host node process. Different
profile means a different target directory, so the two builds shared not
one compiled dependency: every leg paid for the whole graph twice, in
series.

Split the addon into its own `build-rust-napi` matrix over the same eight
targets. Measured on the 12.0.0-rc.9 release run, per-leg build time was:

  target             CLI     addon    leg
  win32-arm64        508s    369s     17m09s
  win32-x64          495s    363s     15m06s
  darwin-arm64       477s    241s     12m30s
  darwin-x64         461s    235s     12m10s
  linux-*        322-351s  217-238s   ~10m

The stage is bounded by its slowest leg, so dropping the addon out of
win32-arm64 takes the critical path from ~17 to ~11 minutes and the whole
release run from ~25m30s to roughly 19 minutes. The addon legs run
alongside and gate nothing.

Downstream needs no changes: the new job uploads to
`binaries-rust-napi-<code-target>`, which the `binaries-rust-*` download
pattern the verify, publish and draft-release jobs already use picks up
and merges into the same directory. It is also free of the node-gyp
payload dependency, since only the CLI archives ship `dist/`.

The toolchain prelude the two jobs share — installing cross, the
clang-cl/ARM64 Visual Studio components, the rustup target, and the guard
that the committed PNPM_VERSION matches the tag — moves into a
`rust-release-target` composite action rather than being duplicated.
zizmor flags that action's writes to GITHUB_ENV/GITHUB_PATH because a
composite action cannot see who calls it; the values come from the
Visual Studio install and `vcvarsall`, and the only caller is a release
job running on a maintainer-signed tag, so the audit is suppressed on
that step with that justification.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Written by an agent (Claude Code, claude-opus-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Added support for building and releasing platform-specific native addons independently from the Rust CLI.
    • Added cross-build support for Windows ARM64 releases.
    • Release artifacts now include separately verified CLI binaries and native addons.
  • Improvements

    • Release publishing is performed in parallel where possible, helping streamline delivery.
    • Added validation to ensure published packages match the intended release version.

The Rust release built the CLI binary and the NAPI addon back to back in
one matrix leg per target. The two are compiled under different Cargo
profiles — `release` for the CLI, `napi-release` for the addon, which
must keep `panic = "unwind"` so a panic reaching the FFI boundary becomes
a JS exception instead of aborting the host node process. Different
profile means a different target directory, so the two builds shared not
one compiled dependency: every leg paid for the whole graph twice, in
series.

Split the addon into its own `build-rust-napi` matrix over the same eight
targets. Measured on the 12.0.0-rc.9 release run, per-leg build time was:

  target             CLI     addon    leg
  win32-arm64        508s    369s     17m09s
  win32-x64          495s    363s     15m06s
  darwin-arm64       477s    241s     12m30s
  darwin-x64         461s    235s     12m10s
  linux-*        322-351s  217-238s   ~10m

The stage is bounded by its slowest leg, so dropping the addon out of
win32-arm64 takes the critical path from ~17 to ~11 minutes and the whole
release run from ~25m30s to roughly 19 minutes. The addon legs run
alongside and gate nothing.

Downstream needs no changes: the new job uploads to
`binaries-rust-napi-<code-target>`, which the `binaries-rust-*` download
pattern the verify, publish and draft-release jobs already use picks up
and merges into the same directory. It is also free of the node-gyp
payload dependency, since only the CLI archives ship `dist/`.

The toolchain prelude the two jobs share — installing cross, the
clang-cl/ARM64 Visual Studio components, the rustup target, and the guard
that the committed PNPM_VERSION matches the tag — moves into a
`rust-release-target` composite action rather than being duplicated.
zizmor flags that action's writes to GITHUB_ENV/GITHUB_PATH because a
composite action cannot see who calls it; the values come from the
Visual Studio install and `vcvarsall`, and the only caller is a release
job running on a maintainer-signed tag, so the audit is suppressed on
that step with that justification.
Copilot AI lite review requested due to automatic review settings August 24, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Split Rust release to build NAPI addon on separate runners

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Build the Rust CLI and NAPI addon in separate parallel matrices to cut release critical path.
• Factor shared toolchain/target preparation into a reusable composite action.
• Keep downstream publish/verify flow unchanged by uploading NAPI artifacts under existing patterns.
Diagram

graph TD
  P["plan job"] --> BR["build-rust (CLI)"] --> ART[("binaries-rust-* artifacts")] --> D["verify/publish/draft"]
  P --> BN["build-rust-napi (addon)"] --> ART
  BR --> ACT[["rust-release-target action"]]
  BN --> ACT
  BR -- "downloads" --> NGP[("node-gyp payload")]

  subgraph Legend
    direction LR
    _job["Job"] ~~~ _action[["Composite action"]] ~~~ _artifact[("Artifact")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Unify Cargo profiles to share build artifacts
  • ➕ Could avoid the extra matrix job and keep a single per-target leg
  • ➕ Might allow dependency reuse if both artifacts share identical profile settings
  • ➖ Conflicts with the addon requirement to keep panic=unwind while CLI likely prefers abort/other settings
  • ➖ Risky semantic change to release binaries; harder to justify than workflow-level parallelism
2. Introduce compiler caching (e.g., sccache/GHA cache)
  • ➕ Can reduce rebuild times without changing job graph
  • ➕ Benefits other workflows as well
  • ➖ For release binaries, cache poisoning is a real supply-chain risk (the workflow explicitly avoids caches)
  • ➖ More operational complexity (cache invalidation, storage, and provenance concerns)
3. Keep single job but split into two independent steps via reusable workflow calls
  • ➕ Preserves a single top-level job name while logically separating responsibilities
  • ➕ Could reduce YAML duplication similarly to a composite action
  • ➖ Doesn’t address the core critical-path issue unless the steps run on separate runners
  • ➖ Reusable workflows add indirection and can complicate secret/permissions scoping

Recommendation: The PR’s approach—splitting the NAPI addon into its own matrix running on separate runners while reusing a shared target-prep composite action—is the best tradeoff. It reduces the release critical path without changing build semantics (profiles remain distinct) and keeps downstream artifact consumption stable via the existing binaries-rust-* download pattern.

Files changed (2) +202 / -92

Other (2) +202 / -92
action.ymlAdd composite action for Rust release target preparation +83/-0

Add composite action for Rust release target preparation

• Introduces a composite action that installs cross, configures clang-cl and MSVC ARM64 environment on Windows ARM64, adds the requested rustup target, and verifies the tagged version matches the committed PNPM_VERSION constant. Includes a documented zizmor suppression for github-env writes justified by tag-only release usage.

.github/actions/rust-release-target/action.yml

release.ymlSplit CLI and NAPI builds into separate matrices and reuse composite prep +119/-92

Split CLI and NAPI builds into separate matrices and reuse composite prep

• Refactors the existing build-rust job to call the new rust-release-target action and removes the back-to-back NAPI build from that matrix. Adds a new build-rust-napi matrix over the same targets to build/attest/upload the .node addon artifacts under binaries-rust-napi-<code-target>, and updates downstream jobs to wait for both build matrices; also removes *.node from the CLI artifact upload and narrows CLI provenance attestation subject paths accordingly.

.github/workflows/release.yml

@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bb75571-99e6-419b-b448-ca3aa2a80090

📥 Commits

Reviewing files that changed from the base of the PR and between 8affe77 and fd5d0d0.

📒 Files selected for processing (2)
  • .github/actions/rust-release-target/action.yml
  • .github/workflows/release.yml

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The release workflow adds a shared Rust target action, separates CLI and NAPI builds into parallel matrix jobs, uploads target-specific NAPI addons, and makes verification, publishing, and GitHub release jobs wait for addon builds.

Changes

Rust release pipeline

Layer / File(s) Summary
Shared Rust target preparation
.github/actions/rust-release-target/action.yml
The composite action installs cross, configures Windows ARM64 tooling, adds the requested Rust target, and validates PNPM_VERSION.
CLI build integration
.github/workflows/release.yml
The Rust CLI matrix uses the shared action. Binary provenance attestation covers only CLI archives.
Dedicated NAPI addon pipeline
.github/workflows/release.yml
The build-rust-napi matrix builds, attests, and uploads target-specific addons. Verification, npm publishing, and GitHub release jobs wait for this matrix.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to fd5d0

This PR reorganizes release builds and shared setup without any identified merge-blocking correctness, security, availability, or deployment risk; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant RustReleaseTarget
  participant CLIBuild
  participant NAPIBuild
  participant ReleaseJobs

  ReleaseWorkflow->>RustReleaseTarget: Prepare target and validate version
  RustReleaseTarget->>CLIBuild: Configure Rust CLI build
  RustReleaseTarget->>NAPIBuild: Configure NAPI addon build
  CLIBuild->>ReleaseJobs: Upload CLI archives
  NAPIBuild->>ReleaseJobs: Attest and upload target-specific addons
  ReleaseJobs->>ReleaseJobs: Verify, publish, and create GitHub release
Loading

Suggested labels: product: pacquet

Suggested reviewers: yeshyungseok

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize-publish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "fix(release): wait on the Visual Studio ..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 24, 2026
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 24, 2026
@qodo-code-review

qodo-code-review Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. VS installer race risk ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new rust-release-target composite action runs setup.exe modify without --wait, relying on
process polling that can miss installer subprocesses and intermittently break Windows ARM64 release
builds. This risk now affects both build-rust and build-rust-napi jobs since they share the
composite action.
Code

.github/actions/rust-release-target/action.yml[R32-34]

+        $installPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
+        & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" modify --installPath "$installPath" --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --quiet --norestart
+        if ($LASTEXITCODE -ne 0) { throw "Visual Studio installer exited with $LASTEXITCODE" }
Relevance

●●● Strong

PR #13052 accepted this exact installer race and required setup.exe to wait for completion.

PR-#13052

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The composite action installs VS components via setup.exe modify without --wait and then
proceeds with a best-effort polling loop; this is a known flaky pattern in this repo’s release
workflows and is now used by both Rust build matrices.

.github/actions/rust-release-target/action.yml[31-46]
.github/workflows/release.yml[613-617]
.github/workflows/release.yml[726-731]
PR-#13052

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Windows ARM64 toolchain install step invokes Visual Studio `setup.exe modify` without an explicit wait flag, which can return before installation is fully complete. Even with the current polling loop, this can be flaky if the installer work continues in processes not covered by the polling logic.

### Issue Context
This logic was moved into a composite action and is now used by both `build-rust` and `build-rust-napi`, increasing the blast radius of any intermittent failure.

### Fix Focus Areas
- .github/actions/rust-release-target/action.yml[31-46]

### Recommended fix
- Add `--wait` (and optionally `--norestart`) to the `setup.exe modify` invocation so the command blocks until completion.
- With `--wait`, you can likely simplify or shorten the polling loop to just validate `clang-cl.exe` exists (defense-in-depth).
- Keep the existing `LASTEXITCODE` check and `clang-cl` existence checks.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Historical build comment in release.yml ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The added workflow comment explains the previous build structure and past timing results (e.g.,
building both in one job and the old critical path time) instead of only describing the current
behavior/rationale. This violates the guideline to avoid historical implementation notes in inline
comments.
Code

.github/workflows/release.yml[R559-561]

+  # directories and they share not one compiled dependency. Building both in
+  # one job paid for the whole dependency graph twice in series, which put the
+  # slowest leg — win32-arm64 — at ~17 minutes instead of ~11.
Relevance

●●● Strong

Recent precedent accepted rewriting historical workflow comments to describe current
behavior/rationale instead of past implementations.

PR-#13072
PR-#13559

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The compliance rule forbids comments that describe past behavior/implementations. The added comment
explicitly contrasts the new matrix split with the previous single-job approach and cites past build
times, which is historical context embedded in source comments.

Rule 772199: Comments must describe current behavior, not historical implementations
.github/workflows/release.yml[555-561]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A newly added comment in the workflow describes the prior implementation and historical performance numbers. Inline comments should describe current behavior and current rationale without referencing the old approach.

## Issue Context
Compliance requires comments to avoid historical phrasing/implementation notes (move that context to PR description, commit message, or a design doc if needed).

## Fix Focus Areas
- .github/workflows/release.yml[555-561]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Unsafe GITHUB_ENV/PATH writes 🐞 Bug ⛨ Security
Description
The composite action suppresses github-env warnings but still writes toolchain-derived values
directly into $GITHUB_ENV/$GITHUB_PATH without newline/marker sanitization, preserving a
potential env-file injection primitive if any value ever becomes attacker-influenced. Because it is
a reusable composite action, this risk can be reintroduced by future callers even if today’s release
workflow is tightly scoped.
Code

.github/actions/rust-release-target/action.yml[R52-55]

+        "CC_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
+        "CXX_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
+        $clangDir >> $env:GITHUB_PATH
+        $vcvarsall = Join-Path $installPath 'VC\Auxiliary\Build\vcvarsall.bat'
Relevance

●● Moderate

Security hardening on GITHUB_ENV writes is often accepted, but no close precedent for this specific
trusted composite-action case.

PR-#13072

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The action explicitly suppresses github-env and appends values into $GITHUB_ENV/$GITHUB_PATH,
including values parsed from the output of vcvarsall and VS install discovery, without any
newline/control-character checks.

.github/actions/rust-release-target/action.yml[25-33]
.github/actions/rust-release-target/action.yml[52-63]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The action appends values into `$GITHUB_ENV` and `$GITHUB_PATH` using plain string writes and suppresses the `github-env` warning. GitHub env/path files are line-oriented; if any written value contains newline/control markers, it can inject additional variables/paths.

### Issue Context
Even if current release-tag callers are trusted, this is a reusable composite action and the suppression makes future unsafe use harder to detect.

### Fix Focus Areas
- .github/actions/rust-release-target/action.yml[30-63]

### Recommended fix
- Remove the suppression by making writes safe:
 - Validate each value does not contain `\r` or `\n` before writing (hard-fail if present).
 - Prefer `Add-Content -Encoding utf8` (or explicit UTF-8) instead of `>>`.
 - For complex values, use GitHub’s multiline env syntax (`NAME<<EOF` … `EOF`) to avoid accidental parsing.
- Apply the same sanitization to the `$clangDir` write to `$GITHUB_PATH` and to each `INCLUDE/LIB/LIBPATH/PATH` line imported from `vcvarsall`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Overbroad .node upload glob ✓ Resolved 🐞 Bug ⛨ Security
Description
build-rust-napi uploads artifacts using path: "*.node", which can unintentionally publish
additional .node files if any appear in the workspace root (now or in future workflow edits). This
can cause incorrect release contents or accidental data exposure via artifacts.
Code

.github/workflows/release.yml[R770-774]

+          if-no-files-found: error
+          # Downloaded by the same `binaries-rust-*` pattern the CLI archives
+          # are, so both land in one directory for the jobs downstream.
+          name: binaries-rust-napi-${{ matrix.code-target }}
+          path: "*.node"
Relevance

●●● Strong

Artifact/release payload scoping fixes are routinely accepted; narrowing overbroad glob matches this
pattern.

PR-#13045

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow creates a single target-qualified .node file but uploads all .node files in the
workspace root via a wildcard, increasing the chance of unintentionally publishing extra files.

.github/workflows/release.yml[752-761]
.github/workflows/release.yml[767-774]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The NAPI upload step uses a wildcard glob that can match unintended files.

### Issue Context
The workflow explicitly creates a single file named `pnpm-napi.${{ matrix.code-target }}.node`.

### Fix Focus Areas
- .github/workflows/release.yml[767-774]

### Recommended fix
- Change the upload `path` from `"*.node"` to the explicit filename:
 - `path: pnpm-napi.${{ matrix.code-target }}.node`
- (Optional) Similarly, keep `if-no-files-found: error` to preserve fail-fast behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 18 rules
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Review follow-ups on the NAPI build split.

`setup.exe modify` returned as soon as it had handed the work off, so the
exit code checked right after it reported the launch rather than the
install, and the polling loop below was the only thing standing between a
half-installed toolchain and a release build. Pass `--wait` so the exit
code means something, and accept 3010 alongside 0 — that is the
installer's "succeeded, wants a reboot", which is exactly what
`--norestart` asks for and does not stop the components from being used.
The polling loop stays: the installer spawns work in processes it does
not always account for. The split doubles how often this runs per
release, once for each Windows ARM64 leg, so it is worth hardening now.

Upload the addon by its exact filename instead of a `*.node` glob, so the
artifact carries the one file the attestation step names and nothing else
that happens to be sitting in the workspace root.

Drop the before-and-after timings from the comment on the build jobs; the
measurements belong in the commit message and the current rationale reads
on its own.
Copilot AI review requested due to automatic review settings August 24, 2026 19:07
@greptile-apps
greptile-apps Bot dismissed their stale review August 24, 2026 19:08

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zkochan

zkochan commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Thanks — three of the four findings are addressed in fd5d0d0, and one I'm pushing back on.

1. VS installer race risk — fixed. Replied on the thread. --wait plus accepting exit code 3010 (succeeded, wants a reboot) alongside 0; the polling loop stays as defense in depth. Worth doing here rather than deferring, because the split runs this step twice per release instead of once.

2. Historical build comment — fixed. Fair call against the repo's comment convention. The comment now states why the two matrices are separate (distinct Cargo profiles, so separate target directories, so nothing shared) without the before-and-after timings. Those live in the commit message and the PR description.

4. Overbroad .node upload glob — fixed. The upload now names pnpm-napi.<code-target>.node exactly, matching the attestation subject, so the artifact can't pick up anything else in the workspace root.

3. Unsafe GITHUB_ENV/GITHUB_PATH writes — not changing. The concern is newline/control-character injection into the environment files, and the parsing shape already rules it out: cmd.exe /c "... && set" is captured by PowerShell as an array of lines, and each element is matched individually against '^(INCLUDE|LIB|LIBPATH|PATH)=(.*)$'. .* cannot span a newline, so $matches[2] is by construction a single line — there is no value that can smuggle a second KEY= line into $GITHUB_ENV. The other two writes are Join-Path results derived from vswhere's reported install path. None of it is reachable by anything outside the Visual Studio installation this step just performed, and the only caller is a release job gated on a maintainer-signed tag.

That is also why the github-env suppression is there, and I'd rather it stay narrow and documented than paper over it with a sanitizer that cannot fire.

Verified after the changes: zizmor 1.29.0 reports no findings on release.yml or the new action, and both parse.


Written by an agent (Claude Code, claude-opus-5).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit fd5d0d0

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 05129e1 into main Aug 24, 2026
28 checks passed
@zkochan
zkochan deleted the optimize-publish branch August 24, 2026 19:16
zkochan added a commit that referenced this pull request Aug 24, 2026
…staller call (#14144)

The 12.0.0-rc.11 release failed on both win32-arm64 legs with "clang-cl
was not installed under ...\VC\Tools\Llvm", five minutes after the
Visual Studio installer was asked to add the LLVM and ARM64 components.

`--wait` had been added to that `setup.exe modify` call. Microsoft
documents it as bootstrapper-only: "The --wait parameter can only be
passed into the bootstrapper; the installer (setup.exe) doesn't support
it." We invoke the installer at
`C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe`, so
it rejected the command line and installed nothing. The logs show the
call returning in under a second and no installer process alive for the
whole polling window.

The exit-code check could not catch that. `setup.exe` is a
GUI-subsystem binary, so PowerShell's call operator does not wait for it
and never sets $LASTEXITCODE from it — the value tested was still
vswhere's. Check vswhere's own result instead, where the variable
actually means something, and leave the poll loop as the sole
confirmation that the components landed, which is what it was written
for.

Regressed in #14138; the split into separate CLI and NAPI
matrices is unaffected, it only doubled the number of legs running the
step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants