Skip to content

Commit ddc8bba

Browse files
authored
ci(windows): add Windows MSVC CI jobs (#2738)
* fix(ci): preserve Windows Rust build cache Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): invalidate empty Windows caches Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * perf(ci): cache Windows builds with sccache Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): restore target directory caching Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * perf(ci): use prebuilt Z3 on Windows Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * perf(ci): layer sccache on Windows target cache Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): split PR checks from main validation Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): separate checks builds and cache seeding Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): simplify Windows build dependency Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): rely on Windows job dependency status Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): use valid opt-in Windows ARM runner Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): keep ARM64 validation local Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): install Clippy for Windows validation Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): focus platform lint coverage Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * docs(licenses): explain bzip2 allowance Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): simplify workflow name Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(windows): allow async platform stub Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(network): make file fingerprints portable Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): lint supported deliverables Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): allow platform-gated lint Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * chore(ci): align Windows cache action with main Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): align Windows validation with prerequisites Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): pin Rust toolchain action Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): use enterprise-approved Windows actions Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(windows): restore strict MSVC validation Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): run Rust tests with nextest Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): normalize nextest lock provenance Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): add native arm64 validation Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): lock nextest for Windows ARM64 Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(windows): resolve duplicate MXC authentication method Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * test(conformance): use native absolute paths on Windows Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * docs(windows): address MSVC review feedback Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): simplify cache key names Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): isolate Windows Rust toolchains for stable caches Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(ci): configure Rustup home in runner setup Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): surface sccache server write diagnostics Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): remove temporary cache diagnostics Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * ci(windows): address review feedback Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(windows): reconcile merged driver capabilities Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(deps): preserve AWS-LC-only lockfile Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * chore(deps): allow z3 prebuilt TLS wrapper Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> --------- Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent ce25acc commit ddc8bba

17 files changed

Lines changed: 526 additions & 262 deletions

File tree

‎.agents/skills/build-openshell-mxc-windows/SKILL.md‎

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The Windows build lane is implemented by these tracked files:
3030
| `tasks/windows.toml` | Mise task entry points for `windows:*` commands. |
3131
| `tasks/rust.toml`, `tasks/test.toml`, and `tasks/markdown.toml` | Windows routing for compiler-bearing checks, explicit Unix-only test skips, and Markdown dependency setup. |
3232
| `tasks/scripts/windows-msvc.ps1` | PowerShell wrapper that enters the Visual Studio developer environment and invokes Cargo. |
33-
| `.github/workflows/windows-msvc.yml` | Manually dispatched GitHub Actions jobs with architecture-specific Rust caches for x64 and future ARM64 Windows validation. |
33+
| `.github/workflows/windows-msvc.yml` | PR/merge-queue lint and test plus main/manual cache seeding and dependent binary builds on native x64 and ARM64 runners. |
3434
| `architecture/windows-msvc-build.md` | Design notes and validation contract. |
3535
| `.agents/skills/build-openshell-mxc-windows/` | This skill and companion reference material. |
3636

@@ -114,8 +114,8 @@ The lane targets a Windows host with Visual Studio Build Tools and rustup.
114114
| Visual Studio 2022 or newer | `where.exe cl.exe` from a Developer PowerShell | Build Tools, Community, Professional, and Enterprise editions work when the target C++ components are installed. The wrapper discovers `VsDevCmd.bat` through `OPENSHELL_VSDEVCMD`, `vswhere`, or installed release directories such as `18` and `2022`. |
115115
| Visual C++ ARM64 tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 -property installationPath` | Required for native ARM64 check, build, and tests and for x64-to-ARM64 check/build. Tests always require a native runner. |
116116
| Visual C++ ARM64 Spectre-mitigated libraries | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre -property installationPath` | Required by `regorus` through `msvc_spectre_libs`; the build fails when the selected MSVC toolset lacks `lib\spectre\arm64`. |
117-
| Visual C++ Clang tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath` | Provides host-native `libclang.dll` for `bindgen` and `clang-cl.exe` for ARM64 crypto dependencies such as `ring` and `aws-lc-sys`. On ARM64, the wrapper uses `VC\Tools\Llvm\Arm64\bin`. |
118-
| Visual C++ CMake tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.CMake.Project -property installationPath` | Provides CMake and Ninja. The x64-to-ARM64 path adds Ninja to `PATH` for native dependencies but keeps bundled Z3 on CMake's Visual Studio ARM64 generator with native MSVC `cl.exe`. |
117+
| Visual C++ Clang tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath` | Provides host-native `libclang.dll` for `bindgen` and `clang-cl.exe` for ARM64 crypto dependencies such as `aws-lc-sys`. On ARM64, the wrapper uses `VC\Tools\Llvm\Arm64\bin`. |
118+
| Visual C++ CMake tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.CMake.Project -property installationPath` | Provides CMake and Ninja for native dependencies. The x64-to-ARM64 path adds Ninja to `PATH`; Z3 uses an architecture-specific prebuilt release. |
119119
| Windows SDK | `where.exe rc.exe` from a Developer PowerShell | Install an SDK containing target libraries and ARM64 tools. |
120120
| Rust via rustup | `rustc --version` | Add each target being validated: `x86_64-pc-windows-msvc` and/or `aarch64-pc-windows-msvc`. The wrapper also adds the selected target. |
121121
| mise | `mise --version` | Used as a task runner only. |
@@ -135,8 +135,9 @@ from this skill.
135135
| `CARGO_TARGET_DIR` | `target` under repo root | Override Cargo output location. Use a short absolute path when x64-to-ARM64 builds approach Windows path-length limits. |
136136
| `Z3_LIBRARY_PATH_OVERRIDE` | unset | Directory containing an x64 system `libz3.lib`; not valid for ARM64. |
137137
| `Z3_SYS_Z3_HEADER` | unset | Full `z3.h` path required with a system Z3 library. |
138-
| `Z3_SYS_BUNDLED_DIR_OVERRIDE` | pinned source cached under `CARGO_TARGET_DIR` when explicit, otherwise `%LOCALAPPDATA%\OpenShell\cache\z3` | Use an existing Z3 source tree containing `src/api/z3.h`; otherwise the wrapper fetches the pinned revision through Git and sets this automatically. |
139-
| `RUSTC_WRAPPER` | cleared by wrapper | The wrapper clears inherited values because `--skip-tools` does not provision `sccache`. |
138+
| `Z3_SYS_Z3_VERSION` | `4.16.0` | Pinned official prebuilt Z3 release selected by the wrapper. |
139+
| `READ_ONLY_GITHUB_TOKEN` | unset | Optional token for the Z3 release lookup; GitHub Actions supplies `github.token`. |
140+
| `RUSTC_WRAPPER` | inherited | The wrapper resolves an available command to an absolute path. If it is unavailable, the wrapper warns and continues without compiler caching. |
140141

141142
Legacy fork variables such as `OPENSHELL_UPSTREAM`,
142143
`OPENSHELL_MXC_FORK_DIR`, and `OPENSHELL_MXC_FORK_BRANCH` are no longer part
@@ -189,17 +190,19 @@ order:
189190
6. Focused unsupported-driver contract tests.
190191
7. Artifact reporting.
191192

192-
The GitHub Actions jobs use architecture-specific `Swatinem/rust-cache`
193-
entries for the Cargo registry and dependency target artifacts. Failed runs
194-
also save their usable dependency artifacts. The workflow remains manually
195-
dispatched until cache-hit runtimes justify restoring automatic triggers.
193+
The GitHub Actions jobs layer architecture-specific `Swatinem/rust-cache`
194+
entries for Cargo registry and dependency target artifacts with sccache's GHA
195+
backend for cacheable Rust compiler outputs. Failed runs also save their usable
196+
dependency artifacts. Pull-request mirrors and merge queues run Clippy for the
197+
Windows-supported workspace and e2e crates plus Rust tests. Pushes to `main` and
198+
manual dispatches run the same lint and test commands in a cache-seed job,
199+
followed by a dependent release-binary build job. The seed and PR jobs use the
200+
same cache namespaces. The binaries are not uploaded or published.
196201

197202
The ARM64 check/build steps in this x64-host contract are cross-builds. The
198203
wrapper discovers and adds host-native LLVM and Ninja to `PATH`, requires the
199204
ARM64 compiler and Spectre-mitigated libraries, lets ARM64 crypto crates select
200-
`clang-cl`, and keeps bundled Z3 on native MSVC `cl.exe` with CMake's Visual
201-
Studio ARM64 generator. Z3 does not use Ninja because `z3-sys 0.10.9` passes
202-
the MSBuild-only `-m` argument.
205+
`clang-cl`, and downloads the official prebuilt ARM64 Z3 static library.
203206

204207
On ARM64 hosts, validate the native ARM64 check, build, and test path. The
205208
wrapper rejects test targets that do not match the host architecture, so x64
@@ -209,7 +212,8 @@ commands above on an ARM64 host.
209212

210213
The repository-wide `mise run pre-commit` task is also supported on Windows.
211214
Its Rust check, Clippy, and test dependencies enter the same MSVC environment
212-
for the native host target and clear inherited `RUSTC_WRAPPER`. Linux glibc
215+
for the native host target and use an inherited compiler wrapper when it is
216+
available. Linux glibc
213217
installer tests and Linux service/RPM packaging-asset tests skip explicitly;
214218
the Linux build-environment shell-helper test also skips; cross-platform checks
215219
continue to run. The blocking Windows Clippy pass excludes unsupported
@@ -261,9 +265,9 @@ The focused contract tasks for either native architecture run:
261265
windows_builtin_compute_drivers_report_unsupported
262266
```
263267

264-
These tests are also included in the full x64 workspace test run; the focused
265-
task intentionally re-runs them so unsupported Windows behavior is visible in
266-
the CI report.
268+
These tests are also included in the full x64 workspace test run. The focused
269+
task is available for local diagnosis; GitHub Actions does not re-run it after
270+
the full suite.
267271

268272
## Test Accounting Guidance
269273

@@ -293,19 +297,13 @@ Useful log files:
293297
| `test-x86_64-pc-windows-msvc-unsupported-*.log` | Focused unsupported-driver contract output. |
294298
| `test-aarch64-pc-windows-msvc-unsupported-*.log` | Focused native ARM64 contract output. |
295299

296-
The first bundled-Z3 check or test can spend several minutes in CMake/MSBuild
297-
without much console output because Cargo output is redirected to the log. Look
298-
for native `MSBuild.exe` workers before treating the process as stalled. The
299-
wrapper fetches the pinned Z3 source through Git before Cargo starts. It caches
300-
under an explicitly configured `CARGO_TARGET_DIR`, or under the current user's
301-
local application data directory when Cargo uses its default target tree.
302-
Concurrent commands publish the validated source through an atomic directory
303-
rename, so x64 and ARM64 validation can share the cache safely. The wrapper does
304-
not rely on the rate-limited GitHub Contents API used by `z3-sys`. A failed
305-
fetch reports the partial checkout path for diagnosis. The artifact report
306-
computes SHA256 through .NET directly and does not rely on the
307-
`Get-FileHash` module being available inside the mise-launched Windows
308-
PowerShell process.
300+
The first check downloads the pinned official Z3 archive for the target
301+
architecture through `z3-sys`. GitHub Actions authenticates the lookup with its
302+
read-only workflow token; local users can set `READ_ONLY_GITHUB_TOKEN` if an
303+
unauthenticated lookup is rate-limited. Cargo stores the extracted library in
304+
its target tree, so the Windows target cache reuses it. The artifact report
305+
computes SHA256 through .NET directly and does not rely on the `Get-FileHash`
306+
module being available inside the mise-launched Windows PowerShell process.
309307

310308
## Common Fix Patterns
311309

‎.agents/skills/build-openshell-mxc-windows/reference.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintaining the existing build-only Windows MSVC lane.
99
|---|---|
1010
| `tasks/windows.toml` | Mise task definitions for `windows:*`. |
1111
| `tasks/scripts/windows-msvc.ps1` | Visual Studio environment discovery, rustup target setup, Cargo invocation, logs, artifact report. |
12-
| `.github/workflows/windows-msvc.yml` | Manual GitHub Actions x64 job and disabled ARM64 scaffold, each with an architecture-specific Rust dependency cache. |
12+
| `.github/workflows/windows-msvc.yml` | PR/merge-queue lint and test plus main/manual cache seeding and dependent binary builds on native x64 and ARM64 runners. |
1313
| `architecture/windows-msvc-build.md` | Human-readable design contract. |
1414

1515
## Commands
@@ -46,8 +46,9 @@ if ($arch -eq [System.Runtime.InteropServices.Architecture]::Arm64) {
4646
The native test tasks reject a target that does not match the host architecture.
4747
Do not report x64 compatibility-under-emulation coverage from an ARM64 run.
4848

49-
The wrapper adds missing rustup targets and clears inherited
50-
`RUSTC_WRAPPER`. It does not install Visual Studio, Rust, Docker, Kubernetes,
49+
The wrapper adds missing rustup targets and preserves an inherited
50+
`RUSTC_WRAPPER` when the command is available. Otherwise, it warns and clears
51+
the setting. It does not install Visual Studio, Rust, Docker, Kubernetes,
5152
Podman, WSL, Hyper-V, or VM tooling.
5253

5354
On Windows, `mise run pre-commit` routes `rust:check`, `rust:lint`, and
@@ -67,11 +68,10 @@ file.
6768
For ARM64, verify the Visual Studio instance contains the ARM64 MSVC tools,
6869
ARM64 Spectre-mitigated libraries, Clang tools, CMake tools, and a Windows SDK.
6970
Clang supplies host-native `libclang.dll` for `bindgen` and `clang-cl.exe` for
70-
ARM64 crypto dependencies such as `ring` and `aws-lc-sys`. Native ARM64 uses
71-
the normal bundled-Z3 CMake path. An x64-to-ARM64 check/build discovers and
72-
adds host-native Ninja to `PATH`, while the crypto crates select `clang-cl`.
73-
Bundled Z3 uses CMake's Visual Studio ARM64 generator with native MSVC `cl.exe`
74-
because `z3-sys 0.10.9` passes the MSBuild-only `-m` argument. Use a short
71+
ARM64 crypto dependencies such as `aws-lc-sys`. Native and
72+
x64-to-ARM64 builds use the official prebuilt Z3 4.16.0 static library for the
73+
target architecture. An x64-to-ARM64 check/build discovers and adds host-native
74+
Ninja to `PATH`, while the crypto crates select `clang-cl`. Use a short
7575
`CARGO_TARGET_DIR` if Windows path-length limits are reached.
7676

7777
## Unsupported Driver Rules

0 commit comments

Comments
 (0)