Index of every page on this site: llms.txt
All skills
ai-openshell avatar

/build-openshell-mxc-windows

@9c3c92f
by OpenShellai-openshell/openshell22k stars
2,153
Run it yourself

Maintain and validate OpenShell's native Windows MSVC and MXC runtime lane for x64 and ARM64. Use when working on Windows compilation, `windows:*` mise tasks, the MXC supervisor/sandbox pairing, unsupported Windows compute-driver contracts, or Windows build reports. This skill does not implement Docker, Kubernetes, Podman, VM, MSI, or service support on Windows.

Use this Skill: https://skilld.dev/gh/ai-openshell/openshell/build-openshell-mxc-windows

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

reference.md

≈2.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Reference: Windows MSVC maintenance lane

Companion to SKILL.md. Use this file for quick lookup while maintaining the native Windows MSVC and MXC runtime lane on the windows development and release branch. Run the commands below from that branch or a branch based on it, including when reading this reference on main.

Lane Files

File Purpose
tasks/windows.toml Mise task definitions for windows:*.
tasks/scripts/windows-msvc.ps1 Visual Studio environment discovery, rustup target setup, Cargo invocation, logs, artifact report.
.github/workflows/windows-msvc.yml Opt-in PR lint and test plus windows branch cache seeding and dependent binary builds on native x64 and ARM64 runners.

Commands

Use --skip-tools for all Windows mise tasks:

mise run --skip-tools windows:check:x64
mise run --skip-tools windows:check:arm64
mise run --skip-tools windows:build:x64
mise run --skip-tools windows:build:arm64
mise run --skip-tools windows:test:x64
mise run --skip-tools windows:test:arm64
mise run --skip-tools windows:test:unsupported:x64
mise run --skip-tools windows:test:unsupported:arm64
mise run --skip-tools windows:ci

For host-native full validation, detect architecture first:

$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
if ($arch -eq [System.Runtime.InteropServices.Architecture]::Arm64) {
    mise run --skip-tools windows:check:arm64
    if ($LASTEXITCODE -ne 0) { throw "windows:check:arm64 failed." }
    mise run --skip-tools windows:build:arm64
    if ($LASTEXITCODE -ne 0) { throw "windows:build:arm64 failed." }
    mise run --skip-tools windows:test:arm64
    if ($LASTEXITCODE -ne 0) { throw "windows:test:arm64 failed." }
    mise run --skip-tools windows:test:unsupported:arm64
    if ($LASTEXITCODE -ne 0) { throw "windows:test:unsupported:arm64 failed." }
    mise run --skip-tools windows:test:mxc-real:arm64
    if ($LASTEXITCODE -ne 0) { throw "windows:test:mxc-real:arm64 failed." }
    mise run --skip-tools windows:artifacts
    if ($LASTEXITCODE -ne 0) { throw "windows:artifacts failed." }
    mise run --skip-tools windows:e2e:mxc
    if ($LASTEXITCODE -ne 0) { throw "MXC E2E validation failed or was incomplete." }
} else {
    mise run --skip-tools windows:ci
    if ($LASTEXITCODE -ne 0) { throw "windows:ci failed." }
    mise run --skip-tools windows:test:mxc-real:x64
    if ($LASTEXITCODE -ne 0) { throw "windows:test:mxc-real:x64 failed." }
    mise run --skip-tools windows:e2e:mxc
    if ($LASTEXITCODE -ne 0) { throw "MXC E2E validation failed or was incomplete." }
}

windows:ci does not include the real MXC runtime tests or E2E. Run the matching windows:test:mxc-real:* task and windows:e2e:mxc explicitly. These tasks can report SKIP when the executor or backend is unavailable; full validation requires an MXC-capable host. E2E exits nonzero when any required runtime scenario fails or skips.

The native test tasks reject a target that does not match the host architecture. Do not report x64 compatibility-under-emulation coverage from an ARM64 run.

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

On Windows, mise run pre-commit routes rust:check, rust:lint, and test:rust through this wrapper for the host-native target. The shared task definitions retain their existing Unix commands. Only tests for Linux glibc installer behavior, Linux build-environment shell helpers, and Linux service/RPM packaging assets skip on Windows. The Windows Clippy command excludes unsupported runtime packages as top-level targets and allows only unused imports, dead code, and unused async functions caused by cfg-gated Windows stubs; other warnings remain errors.

The wrapper limits Cargo to four jobs by default and serializes wrapper-owned Cargo commands with a host-local mutex. It does not set CL or _CL_ because clang-cl also consumes them and can parse a global /MP4 option as an input file.

For ARM64, verify the Visual Studio instance contains the ARM64 MSVC tools, ARM64 Spectre-mitigated libraries, Clang tools, CMake tools, and a Windows SDK. Clang supplies host-native libclang.dll for bindgen and clang-cl.exe for ARM64 crypto dependencies such as aws-lc-sys. Native and x64-to-ARM64 builds use the official prebuilt Z3 5.1.0 static library for the target architecture. An x64-to-ARM64 check/build discovers and adds host-native Ninja to PATH, while the crypto crates select clang-cl. Use a short CARGO_TARGET_DIR if Windows path-length limits are reached.

Unsupported Driver Rules

These Windows runtimes remain unsupported:

  • Docker
  • Kubernetes
  • Podman
  • VM

Rules:

  • Keep registration stubs in the gateway composition crate where the gateway needs them.
  • Return clear unsupported errors at runtime.
  • Do not build standalone Windows driver binaries.
  • Do not add Docker Desktop, WSL, Hyper-V, Podman machine, Podman Desktop, or VM-backed execution as part of this skill.

Current focused unsupported-contract tests:

windows_builtin_compute_drivers_report_unsupported

Run them with the architecture-specific focused task on the native host.

Cargo Excludes

The Windows wrapper intentionally excludes unsupported runtime packages as top-level workspace targets for check/test:

--exclude openshell-driver-docker
--exclude openshell-driver-kubernetes
--exclude openshell-driver-kubernetes-secrets
--exclude openshell-driver-podman
--exclude openshell-driver-vault
--exclude openshell-driver-vm
--exclude openshell-sandbox
--exclude openshell-vfio

The gateway keeps platform configuration and unsupported-operation contracts without depending on the Docker, Kubernetes, Podman, VM, or VFIO runtime crates. The MXC runtime compiles the supervisor, supervisor-process library, and sandbox boundary on Windows. The Kubernetes Secrets and Vault libraries still compile as gateway dependencies; only their standalone Unix-socket binaries and package-level tests are excluded as top-level targets.

The supervisor and supervisor-process packages now participate as top-level native check/test targets. Their portable session, attachment, and TCP readiness coverage does not enable a Windows isolation runtime.

Common Errors

Unix imports leak into Windows builds

Symptoms:

unresolved import std::os::unix
unresolved import tokio::net::UnixListener
unresolved import nix::...

Fix pattern:

#[cfg(unix)]
use tokio::net::{UnixListener, UnixStream};

Move Unix-only functions into Unix-only modules, or add a Windows stub that returns an unsupported error.

Linux-only dependency reaches Windows

Symptoms:

failed to run custom build command for libseccomp-sys
pkg-config could not find libsecret

Fix pattern:

[target.'cfg(target_os = "linux")'.dependencies]
libseccomp = "..."

Only gate the dependency if no Windows path should use it.

ARM64 check fails but x64 passes

Likely causes:

  • Native dependency does not support aarch64-pc-windows-msvc.
  • ARM64 MSVC or Spectre-mitigated libraries are missing.
  • Host-native clang-cl, Ninja, or CMake is missing during an x64-to-ARM64 build.
  • CL or _CL_ injects a global MSVC option such as /MP4 into clang-cl.
  • Build script assumes x64 tools.
  • Inline assembly or prebuilt artifact lacks ARM64 handling.

Do not skip ARM64 silently. Either fix the target handling or report the exact blocked dependency.

Focused tests report many filtered-out tests

This is expected for windows:test:unsupported:x64. Cargo runs one named test and filters the other openshell-gateway tests. Report these as filtered, not ignored.

Reporting Counts

Use the log summaries from:

Log Count source
test-x86_64-pc-windows-msvc.log Full x64 workspace test pass.
test-aarch64-pc-windows-msvc.log Full native ARM64 workspace test pass.
test-x86_64-pc-windows-msvc-unsupported-*.log Focused unsupported-contract re-runs and filtered counts.
test-aarch64-pc-windows-msvc-unsupported-*.log Focused native ARM64 re-runs and filtered counts.

Separate:

  • passed
  • failed
  • ignored
  • filtered out
  • cfg-gated zero-test targets
  • package-level excludes

Package-level excludes are not printed as ignored tests by Cargo.

Final Sanity Checks

Before committing Windows-lane changes, choose checks based on the host architecture:

cargo fmt --all
git diff --check
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
if ($arch -eq [System.Runtime.InteropServices.Architecture]::Arm64) {
    mise run --skip-tools windows:check:arm64
    mise run --skip-tools windows:build:arm64
    mise run --skip-tools windows:test:arm64
    mise run --skip-tools windows:test:unsupported:arm64
} else {
    mise run --skip-tools windows:check:x64
    mise run --skip-tools windows:check:arm64
    mise run --skip-tools windows:test:unsupported:x64
}

Run the full x64-host windows:ci lane when build or test behavior changed and the host can run that lane natively.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill provides instructions for maintaining and validating the Windows MSVC build lane for the OpenShell project. It utilizes standard development tools like Git, Cargo, and PowerShell to compile and test binaries for x64 and ARM64 architectures.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 9c3c92f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 days ago
metadata
{
  "internal": true
}

README badge

README badge for ai-openshell/openshell/build-openshell-mxc-windows