Skip to content

build(windows): link static CRT and Z3 in Windows packages - #5654

Open
shailendra-nv wants to merge 8 commits into
windowsfrom
shailendra-nv/windows-static-runtime
Open

shailendra-nv wants to merge 8 commits into
windowsfrom
shailendra-nv/windows-static-runtime

Conversation

@shailendra-nv

@shailendra-nv shailendra-nv commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Build all four Windows OpenShell executables with the static CRT and embed Z3 in the gateway. The ZIP packages no longer require libz3.dll or the Visual C++ redistributable for these executables. Preserve Z3 5.1.0 so this changes linkage without upgrading the solver.

Related Issue

Closes #5653

The author has verified MAINTAIN access to NVIDIA/OpenShell; the issue does not have an acceptance label.

Changes

  • Scope crt-static to x64 and ARM64 MSVC targets. By default, compile checksum-pinned Z3 5.1.0 source through the existing vendored feature with /MT; alternatively, accept a target-compatible prebuilt static libz3.lib and matching headers through Z3_LIBRARY_PATH_OVERRIDE / Z3_SYS_Z3_HEADER, bypassing Z3 source compilation.
  • Keep native Z3 optimized in dev/test builds through a Windows-only dependency profile and Ninja. Forward that profile through Nextest and invalidate stale native archives through Cargo. Solver budgets and assertions are unchanged.
  • Verify architecture and normal/delayed PE imports of all four release binaries, rejecting Z3 and redistributable CRT DLL dependencies.
  • Remove DLL staging and remote/E2E packaging requirements; preserve the deprecated -Z3DllPath argument for existing command lines.
  • Add release-build verification to the opt-in GitHub-hosted x64 and ARM64 Windows lanes; update Windows build, runtime, and contributor guidance.

The static-only package contract intentionally changes the contributor build configuration: Z3_LIBRARY_PATH_OVERRIDE can no longer select shared Z3 for these packages. Overrides containing libz3.dll fall back to pinned source with a warning. Cold source builds require CMake, Ninja, and a C++ compiler. Offline builds can set Z3_SRC_SOURCE_DIR to Z3 5.1.0; custom libraries must be rebuilt as static libraries with /MT. CONTRIBUTING.md documents these migration settings. The compatibility bot marks this acknowledged migration as an advisory finding; the installed CLI, SDKs, policy, and persisted-state contracts are unchanged. Updating the embedded CRT or Z3 requires rebuilding the packages. MXC retains its separate prerequisites.

Size impact

Measured on N1x-Test ARM64, comparing base 28de5674 with final head 7fa8a776, using the same OpenShell Rust/MSVC toolchain. The baseline uses its original prebuilt Z3 5.1.0 DLL. Both official-style ZIPs were generated with the same external CI packaging script; baseline payload includes the DLL and the static payload contains only the four executables.

Artifact Baseline Static Change
CLI ZIP 9.574 MiB 9.662 MiB +0.92%
Gateway/supervisor/sandbox ZIP 42.503 MiB 42.475 MiB -0.07%
Both ZIPs 52.078 MiB 52.137 MiB +0.11%
Unpacked binary payload 130.466 MiB 130.028 MiB -0.34%

The two ZIPs together grow by 62,513 bytes (about 61 KiB).

Testing

  • N1x-Test, supplied-static-library mode: copied the existing /MT ARM64 Z3 archive and headers to a separate override directory, set Z3_SRC_SOURCE_DIR to a nonexistent directory, and successfully rebuilt all four release executables. All PE audits and isolated --version smokes pass; the native Z3 archive was not rebuilt.
  • Local pre-commit checks: workspace/example Clippy, formatting, lockfiles, Markdown, Python, TypeScript lint, protobuf lint, and Helm checks.
  • N1x-Test, final head: ARM64 check, release and fixture builds, and all four PE import/architecture audits. The fresh optimized release build took 8m52s.
  • N1x-Test: 26 static-runtime/source/cache regression checks and 10 remote-helper cases, including real binding of the deprecated parameter.
  • N1x-Test, final head: all 6,662 workspace tests pass; 43 existing platform/ignored skips. All unsupported-driver contracts and four selective gateway feature combinations pass.
  • N1x-Test, final head: real-MXC integration task succeeds (14 reported passes; iso_lifecycle_round_trip conditionally skips because the optional isolation-session backend is unavailable).
  • N1x-Test, final head: all seven default real MXC E2E scenarios plus HTTPS CA pass, with zero E2E skips.
  • N1x-Test, final head: all four packaged executables pass --version from an otherwise empty package directory; the exact external CI ZIP packager extracts both archives and smoke-tests every executable without shipping any DLL.
  • Branch Checks: all 27 jobs pass, including Linux and macOS.
  • GitHub-hosted Windows x64 and ARM64: both complete jobs pass, including lint, all 6,662 tests per architecture (43 skips), helper regressions, release builds, and all four static-runtime/architecture audits.
  • /windows-ci: complete pipeline passes, including native ARM64 check, release build, all four PE audits, all 6,662 workspace tests (43 skips; no flaky retries reported), unsupported-driver/feature-matrix tests, and both ZIP extraction/version smoke tests. Artifacts were uploaded without a Z3 DLL.

Passing these checks does not qualify the existing unverified MXC enforcement guarantees.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Windows build/runtime documentation and contributor skill updated

Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv shailendra-nv added the test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors label Nov 17, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test bb8c4f9

@sam-india-007

sam-india-007 commented Nov 17, 2026 •

Copy link
Copy Markdown

Windows ARM64 CI: ✅ passed

Commit 7fa8a77, requested by @shailendra-nv, 2h 39m, full log

Step Result Duration
if ($env:PR_NUMBER) { Import-Module .\scripts\pr-ci\OpenShellPrCi.psm1; Assert-PrCiVariables -PrN... ✅ passed 0s
& .\scripts\setup-windows-arm64-runner.ps1 -VerifyOnly ✅ passed 1s
$env:PATH = "$(Split-Path -Parent $env:RUSTC_WRAPPER);$env:PATH"; $found = (Get-Command sccache -... ✅ passed 0s
New-Item -ItemType Directory -Force (Split-Path -Parent $env:SCCACHE_ERROR_LOG) | Out-Null; & $en... ✅ passed 2s
& $env:RUSTC_WRAPPER --zero-stats ✅ passed 0s
& .\scripts\checkout-openshell.ps1 -Ref $env:OPENSHELL_REF ✅ passed 4s
& .\scripts\set-openshell-version.ps1 -Version $env:OPENSHELL_VERSION ✅ passed 0s
Set-Location $env:OPENSHELL_CHECKOUT_DIR ✅ passed 0s
mise run --skip-tools windows:check:arm64 ✅ passed 39m 03s
mise run --skip-tools windows:build:arm64 ✅ passed 1h 04m
mise run --skip-tools windows:test:arm64 ✅ passed 27m 14s
mise run --skip-tools windows:test:unsupported:arm64 ✅ passed 27m 26s
mise run --skip-tools windows:artifacts ✅ passed 2s
& "$env:CI_PROJECT_DIR\scripts\package-windows-release.ps1" ✅ passed 38s

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

Unaddressed breaking changes

Windows remote-test invocations using -Z3DllPath now fail because the parameter was removed. Windows builds using a previously supported dynamic Z3 override now fail static-runtime verification.

1. cli — NOT ACKED

test-mxc-remote.ps1 -Z3DllPath was removed; the script no longer accepts that documented parameter.

  • Impact: Existing remote MXC test automation passing -Z3DllPath fails PowerShell parameter binding before testing starts.
  • Action: Retain -Z3DllPath as a deprecated compatibility parameter or restore its behavior until a break-allowing train provides migration guidance.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654

2. configuration — NOT ACKED

Z3_LIBRARY_PATH_OVERRIDE previously accepted a target-compatible Windows Z3 library but now requires a static libz3.lib built with /MT.

  • Impact: Existing windows:build:* configurations pointing to the documented prebuilt Z3 DLL import library fail the new static dependency check.
  • Action: Continue accepting the prior dynamic Z3 override or move the restriction to a break-allowing train with explicit static-library migration steps.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654
Review details
  • Execution: complete
  • Candidate: PR #5654 (8ee45773dfdae1893f95fd272d0c074d641e43b1)
  • Baseline: 28de5674feb1702290f746a70c3e6aba884a6f85 (28de5674feb1702290f746a70c3e6aba884a6f85)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test ed4d29d

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 7200fce

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

Unaddressed breaking changes

Existing Windows MXC automation using -Z3DllPath now fails during parameter binding. Documented dynamic Z3 overrides are also ignored or rejected by the Windows build workflow.

1. cli — NOT ACKED

test-mxc-remote.ps1 -Z3DllPath was removed; the script no longer accepts the documented parameter.

  • Impact: Existing remote MXC test automation passing -Z3DllPath fails PowerShell parameter binding before testing starts.
  • Action: Retain -Z3DllPath as a deprecated compatibility parameter or restore it until a break-allowing train provides removal guidance.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654

2. configuration — NOT ACKED

Z3_LIBRARY_PATH_OVERRIDE previously accepted a target-compatible Windows Z3 import library but now requires static libz3.lib built with /MT.

  • Impact: Existing windows:build:* configurations using the documented dynamic Z3 override are ignored in favor of a source build or fail static-runtime verification.
  • Action: Continue accepting the previous dynamic Z3 override or defer the static-only requirement to a break-allowing train with explicit rebuild and configuration migration steps.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654
Review details
  • Execution: complete
  • Candidate: PR #5654 (eba95db233746c97309bc1077cfb2a39a4d8399f)
  • Baseline: 28de5674feb1702290f746a70c3e6aba884a6f85 (28de5674feb1702290f746a70c3e6aba884a6f85)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@shailendra-nv shailendra-nv linked an issue Nov 17, 2026 that may be closed by this pull request
5 tasks
Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 27de545

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

Addressed the compatibility review in 27de545:

  • Restored -Z3DllPath as a deprecated, ignored parameter. Existing remote-test command lines still bind, with a native PowerShell regression covering the real parameter block (10 remote-helper cases pass).
  • Acknowledged the intentional build-configuration change in the PR description and added explicit migration settings to CONTRIBUTING.md. Windows packages now require static CRT/Z3 linkage. Documented prebuilt overrides containing libz3.dll remain accepted as inputs and fall back to checksum-pinned source with a warning. Offline builds can provide Z3 5.1.0 source; custom libraries can be rebuilt with static linkage and /MT. Import libraries without an adjacent DLL fail the release dependency check, as documented.

The static-only package contract implements the requested removal of the Z3 DLL and Visual C++ redistributable requirements. The real MXC suite passed all seven default scenarios plus HTTPS CA, with zero skips, before this argument/documentation-only follow-up. Windows CI is being refreshed for the new head.

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

Unaddressed breaking changes

The documented Windows Z3 override no longer selects shared Z3, so existing offline or CMake-free build automation can fail. SDKs, runtime APIs, CLI, Helm, policy, and persisted state are unchanged.

1. configuration — ACKED

Z3_LIBRARY_PATH_OVERRIDE changed from selecting a target-compatible shared Z3 installation to ignoring directories containing libz3.dll and building pinned static source.

  • Impact: Existing Windows builds using the documented shared-Z3 override can now require CMake and network access or fail when run offline.
  • Action: Restore shared-Z3 override support for this non-breaking train, or defer the static-only requirement to a train that permits breaks while retaining the supplied migration guidance.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654
Review details
  • Execution: complete
  • Candidate: PR #5654 (629b92ee364bc3c7b654c2d33718d56ebece0dd2)
  • Baseline: 28de5674feb1702290f746a70c3e6aba884a6f85 (28de5674feb1702290f746a70c3e6aba884a6f85)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

The latest review confirms that -Z3DllPath compatibility is restored and marks the static-Z3 migration ACKED. The remaining finding concerns the repository's Windows package-construction workflow, rather than installed OpenShell CLI/SDK behavior or user-authored gateway configuration.

Baseline context:

  • The Windows build lane is a contributor workflow in a skill explicitly marked metadata.internal: true: https://github.com/NVIDIA/OpenShell/blob/28de5674feb1702290f746a70c3e6aba884a6f85/.agents/skills/build-openshell-mxc-windows/SKILL.md
  • That baseline already lists Visual C++ CMake tools as a Windows build prerequisite. The default prebuilt-Z3 path already requires a first-use download; the affected special case is custom/offline shared-Z3 package construction.
  • The raw Cargo Z3 feature flags and z3-sys library override support are unchanged. This change makes the maintainer windows:* package-validation lane produce and verify the requested static artifacts.

The package-construction change is intentional: embedding CRT and Z3 removes the destination machine's redistributable and Z3-DLL requirements. CONTRIBUTING.md now documents local-source/offline builds and rebuilding custom static libraries with /MT. This does not change an installed SDK, CLI, TOML, policy, Helm, or persisted-state contract. The explicit migration notice is retained for contributor automation affected by the new package requirements.

Signed-off-by: shailendras <shailendras@nvidia.com>
Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 10b5a55

Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 5a3ff56

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

Unaddressed breaking changes

Windows Z3_LIBRARY_PATH_OVERRIDE no longer selects a documented shared Z3 library, so existing custom and offline build automation can fail or silently build pinned source instead. The PR explicitly acknowledges the change and provides migration guidance, but this train allows no Stable breaks.

1. configuration — ACKED

Z3_LIBRARY_PATH_OVERRIDE previously selected a shared libz3.dll build, but shared overrides are now ignored and replaced with a static source build.

  • Impact: Windows automation using a custom shared Z3 may require newly installed CMake and C++ tools, lose its selected library, or fail in offline environments.
  • Action: Preserve shared Z3_LIBRARY_PATH_OVERRIDE support on this no-break train, or defer the static-only requirement to a train that permits the documented migration.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654
Review details
  • Execution: complete
  • Candidate: PR #5654 (d81b5d8661525fc762394b1b4cddd17df99cfc2f)
  • Baseline: 28de5674feb1702290f746a70c3e6aba884a6f85 (28de5674feb1702290f746a70c3e6aba884a6f85)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

Signed-off-by: shailendras <shailendras@nvidia.com>
@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 7fa8a77

@shailendra-nv

Copy link
Copy Markdown
Collaborator Author

/windows-ci

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

Unaddressed breaking changes

Windows windows:* builds no longer accept documented shared-Z3 overrides and may now require CMake, Ninja, a C++ compiler, and source access. The break is explicitly acknowledged and documented, but the supplied train permits no Stable compatibility breaks.

1. configuration — ACKED

Z3_LIBRARY_PATH_OVERRIDE previously selected a documented shared Z3 library for windows:* tasks, but shared overrides are now ignored and only static /MT libraries or pinned source builds are accepted.

  • Impact: Existing Windows build automation using libz3.dll may fail offline or on hosts without CMake, Ninja, and a C++ compiler.
  • Action: Preserve shared-Z3 override behavior for this train or defer the static-only requirement to a break-allowing train while retaining the supplied static-library and Z3_SRC_SOURCE_DIR migration guidance.
  • PR: build(windows): link static CRT and Z3 in Windows packages #5654
Review details
  • Execution: complete
  • Candidate: PR #5654 (9ae70c222e80186c523a6b35199a1a8f7f3d6bf2)
  • Baseline: 28de5674feb1702290f746a70c3e6aba884a6f85 (28de5674feb1702290f746a70c3e6aba884a6f85)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@shailendra-nv
shailendra-nv marked this pull request as ready for review November 17, 2026 23:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:19:59.546532Z 7fa8a77 Draft marked ready
🔒 Security Review ❌ Failed 2026-11-17T23:19:11.536679Z
We couldn’t complete this review. Comment @codex security review to try again.
7fa8a77 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:accepted A maintainer decided OpenShell should pursue this issue test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(windows): distribute static CRT and Z3 packages

2 participants