Skip to content

build: isolate gnullvm Windows Rust exec toolchain - #572

Draft
GraciousGazelles wants to merge 12 commits into
mainfrom
fix/native-windows-health-and-cache-20260801
Draft

build: isolate gnullvm Windows Rust exec toolchain#572
GraciousGazelles wants to merge 12 commits into
mainfrom
fix/native-windows-health-and-cache-20260801

Conversation

@GraciousGazelles

@GraciousGazelles GraciousGazelles commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Why

Native Windows Bazel builds compile gnullvm proc-macro DLLs. rules_rs v0.0.96 only registers a generic Windows execution toolchain, so toolchain resolution can select an MSVC-hosted Rust runtime for those DLLs. That ABI mismatch makes otherwise materialized proc macros unloadable and is reported by rustc as missing crates (E0463).

//:local_windows inherits the runner CPU. Registering only the x86_64 gnullvm compiler execution triple therefore leaves ARM64 Windows hosts without a full-ABI-compatible Rust action toolchain. The fallback must be an ARM64 gnullvm toolchain, not an MSVC toolchain.

The native Windows health run at 9da40763eda9731d23d60216f566280c7ac394f8 also found an OTLP HTTP current-thread Tokio shutdown timeout. Explicit OtelProvider::shutdown() was followed by Drop, which repeated the exporter shutdown path before the test runtime could report completion.

What changed

  • Add a narrowly scoped rules_rs patch that registers x86_64-pc-windows-gnullvm and aarch64-pc-windows-gnullvm as distinct Rust compiler-tools execution ABIs.
  • Keep Miri and the module extension's selected host Cargo/rustc repositories on their existing native MSVC execution set; Rust compiler, Clippy, rustfmt, and rust-analyzer action toolchains gain both gnullvm entries.
  • Gate both Miri SHA resolution and Miri repository creation to the legacy MSVC execution triples, retaining the existing generic Windows Miri repository name and ensuring no gnullvm Miri artifact is requested.
  • Give Windows Rust toolchains ABI-aware repository names and full-triple execution constraints, so x86_64 and ARM64 gnullvm builds select matching compiler runtimes rather than an MSVC fallback.
  • Regenerate the five ARM64-gnullvm compiler-tool download facts in MODULE.bazel.lock through Bzlmod.
  • Add an Ubuntu, no-action bazel aquery job to the native health workflow. It parses the text-format result into clearly delimited action blocks and verifies exactly one Rustc action for //codex-rs/otel:otel: that same action must report the ARM64 gnullvm execution platform and gnullvm rustc/Cargo inputs, and must not report ARM64 MSVC inputs.
  • Add verifier fixtures that prove unrelated gnullvm text cannot satisfy the selected action, ARM64 MSVC text in the selected action fails, and a similarly named target cannot substitute for the exact target.
  • Route the analysis through the cache-aware Bazel wrapper, use a dedicated ARM64 cache key, and save that key only under the existing trusted post-merge push policy. The native x86 health job remains the sole writer for its stable native cache key.
  • Correct the rules_rs unified-diff hunk metadata and add structural coverage that validates every patch hunk's declared old/new line counts.
  • Restore the standalone native health workflow to its gnullvm target and host shape while preserving fail-fast bazel test //..., diagnostics, cache isolation, and serialization.
  • Stabilize the file-watcher debounce batching regression with Tokio's paused clock, preserving the batching assertion without relying on Windows wall-clock scheduler timing.
  • Make OtelProvider::shutdown() idempotent and let tracer-provider shutdown perform its own flush, preventing a second flush/shutdown after explicit shutdown and Drop.
  • Add regression coverage for explicit shutdown-plus-drop and drop-only shutdown.
  • Pin the corresponding gnullvm Rust artifact hashes in MODULE.bazel.lock and cover the workflow and patch contract in planner tests.

Validation

  • Applied the patch with patch --dry-run --fuzz=0 against the released rules_rs v0.0.96 archive.
  • python3 -m unittest discover -s .github/scripts -p test_ci_planners.py
  • python3 .github/scripts/test_run_bazel_with_buildbuddy.py
  • python3 .github/scripts/check_workflow_policy.py
  • just bazel-lock-update and just bazel-lock-check
  • cargo metadata --manifest-path codex-rs/Cargo.toml --locked --no-deps --format-version 1
  • rustfmt --check --edition 2024 codex-rs/file-watcher/src/file_watcher_tests.rs
  • bazel query //codex-rs/file-watcher:file-watcher-unit-tests
  • bazel build --nobuild //codex-rs/file-watcher:file-watcher-unit-tests
  • For the OTEL follow-up: git diff --check, rustfmt --edition 2024 --check codex-rs/otel/src/provider.rs codex-rs/otel/src/provider_shutdown_tests.rs, cargo metadata --manifest-path codex-rs/otel/Cargo.toml --no-deps --format-version 1, and bazel query //codex-rs/otel:otel-tests-test-windows-cross.
  • For the ARM64 execution-toolchain follow-up: just bazel-lock-update, just bazel-lock-check, python3 -m unittest discover -s .github/scripts -p test_ci_planners.py, and git diff --check.
  • For the action-scoped ARM64 selection proof: python3 .github/scripts/test_verify_arm64_gnullvm_aquery.py -v, python3 -m unittest discover -s .github/scripts -p 'test_*.py' (275 tests), python3 .github/scripts/check_workflow_policy.py, python3 -m py_compile .github/scripts/verify_arm64_gnullvm_aquery.py .github/scripts/test_verify_arm64_gnullvm_aquery.py, and git diff --check.
  • For the cache and patch-metadata repair: python3 -m unittest discover -s .github/scripts -p 'test_*.py' (276 tests), python3 .github/scripts/check_workflow_policy.py, python3 -m py_compile .github/scripts/test_ci_planners.py .github/scripts/test_run_bazel_with_buildbuddy.py, and git diff --check.
  • YAML parse and git diff --check

Hosted Native Windows Bazel health acceptance is pending for the exact updated PR head.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@GraciousGazelles GraciousGazelles changed the title ci: run native Windows Bazel health with MSVC build: isolate gnullvm Windows Rust exec toolchain Aug 1, 2026
@GraciousGazelles
GraciousGazelles force-pushed the fix/native-windows-health-and-cache-20260801 branch 2 times, most recently from d8f26e8 to 9da4076 Compare August 1, 2026 08:49
@GraciousGazelles
GraciousGazelles force-pushed the fix/native-windows-health-and-cache-20260801 branch from 6a0047f to 9c7184f Compare August 2, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant