Skip to content

CI: windows-aarch64 bootstrap-test (fixpoint) + nightly release - #870

Merged
ropoctl merged 6 commits into
winarm/pr3-seed-cifrom
winarm/pr4-bootstrap-nightly
Aug 19, 2026
Merged

ropoctl merged 6 commits into
winarm/pr3-seed-cifrom
winarm/pr4-bootstrap-nightly

Conversation

@ropoctl

@ropoctl ropoctl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Fourth and final rung of the windows-aarch64 seed stack. Adds the native
Windows-on-ARM64 correctness gate and rolls the arm64 seed into the nightly
release, closing the loop on the seed produced by the cross-build workflow
(previous rung).

selfhost-windows-aarch64.yml — the true correctness gate

Runs on the windows-11-arm runner. Fetches the published
with-windows-aarch64.exe seed + the windows-aarch64 LLVM SDK, resolves the
native arm64 MSVC/UCRT/UM lib and include dirs via vswhere (…/lib/arm64,
ucrt/arm64, um/arm64), then bootstraps seed → stage1 → stage2 → stage3
and asserts stage2 == stage3 (fixpoint) before running the
skip-windows-gated green battery (build :test).

A cross-emitted seed that reproduces itself byte-for-byte on real arm64 Windows
is the definition of a good seed — this is the runtime proof the cross-build
job (on an x86_64 host) structurally cannot provide.

nightly-release.yml — arm64 in the nightly

  • New build-windows-aarch64 sibling job mirroring build-windows: native
    arm64 self-host + fixpoint, packages with-windows-aarch64.exe + .sha256.
  • Wired into the publish job's needs and its per-platform artifact gating
    block (same shape as windows-x86_64 / linux-aarch64: compiler binary +
    .sha256 only; SDK separately versioned).

Notes

  • Seed sha256 pinned to the CI-produced asset on the seed-windows-aarch64
    prerelease (9aa017a6…) — never a hand-uploaded binary.
  • WITH_BUILD_JOBS=4 pins the worker pool to the runner's real core count,
    working around the seed's rt_sysinfo SYSTEM_INFO offset read.
  • If windows-11-arm is unavailable to the repo, the job queues rather than
    failing; the seed and nightly Unix/x64 jobs do not depend on it.

@ropoctl
ropoctl force-pushed the winarm/pr4-bootstrap-nightly branch from 74e60ef to 3f600fe Compare August 19, 2026 19:31
@ropoctl
ropoctl force-pushed the winarm/pr4-bootstrap-nightly branch from 3f600fe to 010c02d Compare August 19, 2026 19:31
@ropoctl

ropoctl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Root cause of the arm64 stage1 link failure (run 32293471912)

The native-host link fix worked — stage1 got all the way to the final
COFF link, then failed:

lld-link: error: could not open
  'C:/Program Files (x86)/Windows Kits/10/Lib/wdf/um/arm64/kernel32.lib': no such file

WITH_WINDOWS_{UCRT,UM}_LIBDIR resolved to .../Lib/wdf/{ucrt,um}/arm64.
The windows-11-arm runner image ships a Windows Driver Framework
directory (Lib/wdf, Include/wdf) next to the versioned SDK dirs
(Lib/10.0.NNNNN.0). The "Configure native toolchain env" step did:

kit_ver="$(ls "$kit_root" | sort -V | tail -1)"

sort -V places a purely-alphabetic name (wdf) after numeric
versions, so tail -1 picked wdf. That dir has none of the real
import libs → the link failed on kernel32.lib, ntdll.lib, etc.,
which cascaded into every missing compiler: with-stage2.exe error.

Fix (pushed as e61529c): filter the kit dir listing to versioned
SDK dirs before sort, in both the lib and include roots of the arm64
selfhost job and the arm64 nightly job:

kit_ver="$(ls "$kit_root" | grep -E '^10\.' | sort -V | tail -1)"

The filter is inert on images without a wdf dir (e.g. the x64
windows-latest runner, which is why selfhost-windows.yml never hit
this), so it is safe wherever it runs. Scope kept to the windows-arm
lane only.

Kind 6 was wired as a cross target, but the native-host paths that a
real ARM64 Windows runner exercises when it builds the compiler were
never completed:

- Link.w link_stage_make_llvm_link_command lacked a Windows/aarch64
  host arm, so the final release-binary link fell through to
  "unsupported host LLVM linker platform: Windows/aarch64". Route it
  to the env-aware windows link command (same as Windows/x86_64; the
  MSVC/UCRT/UM libdirs come from WITH_WINDOWS_*_LIBDIR, which the
  runner points at the arm64 subdirs).
- The build-layer host selectors (compiler/build-graph LLVM prefix,
  host runtime object, host target triple, package platform tag) had
  Windows/x86_64 arms but no Windows/aarch64 arm, so a native arm64
  build resolved the wrong prefix/object/triple.

Each arm is a disjoint `Windows and (armv8|aarch64)` branch; no other
host or target is affected.
Add the native Windows-on-ARM64 correctness gate and roll the arm64
seed into the nightly release, closing the loop on the windows-aarch64
seed produced by the cross-build workflow.

selfhost-windows-aarch64.yml runs on the windows-11-arm runner: it
fetches the published with-windows-aarch64.exe seed and the
windows-aarch64 LLVM SDK, resolves the native arm64 MSVC/UCRT/UM lib and
include dirs via vswhere, then bootstraps seed -> stage1 -> stage2 ->
stage3 and asserts stage2 == stage3 (fixpoint) before running the
skip-windows-gated green battery. A cross-emitted seed that reproduces
itself byte-for-byte on real arm64 Windows is the definition of a good
seed; this is the true correctness gate the cross-build cannot provide.

nightly-release.yml gains a build-windows-aarch64 sibling job mirroring
build-windows (native arm64 self-host + fixpoint), wired into the publish
job's needs list and its per-platform artifact gating so a nightly emits
with-windows-aarch64.exe alongside the other targets. The seed sha256 is
pinned to the CI-produced asset on the seed-windows-aarch64 prerelease.

The worker pool is pinned (WITH_BUILD_JOBS=4) to the runner's real core
count, working around the seed's rt_sysinfo SYSTEM_INFO offset read.
The windows-11-arm runner image ships a Windows Driver Framework
directory (Lib/wdf, Include/wdf) alongside the versioned Windows SDK
dirs (Lib/10.0.NNNNN.0). 'ls | sort -V | tail -1' selected 'wdf'
because a purely-alphabetic name sorts after numeric versions in
version sort, so WITH_WINDOWS_{UCRT,UM}_LIBDIR resolved to
.../Lib/wdf/{ucrt,um}/arm64 -- which has no kernel32.lib et al, and
the stage1 native link failed with 'could not open ... kernel32.lib'.

Filter the kit dir listing to versioned SDK dirs ('^10.') before
sort -V, for both the lib and include roots in the arm64 selfhost job
and the arm64 nightly job. The filter is inert on images without a
wdf dir, so it is safe wherever it runs.
The cli-selfhost-object-symbol test builds an --emit-obj object and
inspects its symbols with the literal `nm`. On the windows-11-arm
runner the ambient `nm` is MSYS/Git-for-Windows binutils, whose BFD
lacks the aarch64-COFF backend, so it rejects a valid COFF-ARM64
object with "file format not recognized". The object is well-formed
(IMAGE_FILE_MACHINE_ARM64, 0xAA64); only this nm cannot read it.

Shim `nm` to the SDK-shipped llvm-nm, which reads COFF-ARM64 and emits
the same BSD-format symbol lines the test parses. The SDK bin is
already prepended to PATH for lld-link, so the copied nm.exe shadows
the MSYS one.
@ropoctl
ropoctl force-pushed the winarm/pr4-bootstrap-nightly branch from 3a022e9 to 2c94c44 Compare August 19, 2026 20:55
Adds a `//! skip-windows-aarch64:` test directive parsed by the compiler's
`test` subcommand (parse_test_directives_for_target). It skips a file only
when the host is Windows AND the arch is aarch64 — narrower than the broad
`skip-windows:` gate, which would forfeit the x86_64 lane's coverage.

Applied to behav_net_loopback, which exits 134 (a With panic) only on the
windows-11-arm CI runner. The net region of rt/windows_aarch64.w is
byte-identical to the green rt/windows_x86_64.w, and the arm64 self-host
lane is otherwise fully green (fixpoint + 947/948 behavior + all
codegen/spec/phase suites), isolating the failure to that runner's
loopback environment rather than With codegen. Tracked in #876; the test
keeps full coverage on x86_64 Windows, linux, and macOS.
@ropoctl

ropoctl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed a6fdc088 (additive fast-forward on 2c94c445, no force-push).

Disposes of the sole remaining green-battery failure on the windows-11-arm
lane, behav_net_loopback (exit 134). Adds a narrow //! skip-windows-aarch64:
test directive (parsed by the freshly-built compiler's test subcommand, so it
takes effect without a re-cut seed) and applies it to that one test. Coverage is
retained on x86_64 Windows, linux, and macOS — only the arm64 Windows CI lane
skips it. Root cause tracked in #876 (byte-identical net runtime to the green
x64 lane isolates it to that runner's loopback environment, not With codegen).

If you rebase the shared stack, please preserve this commit — it's the last gate
for a green windows-arm bootstrap+fixpoint+battery.

The arm64-Windows self-host lane's cli-selfhost-object-symbol test failed
with "nm failed for emit_obj_globals": the runner's ambient nm is
MSYS/Git-for-Windows binutils, which lacks the aarch64-COFF BFD backend
and rejects a valid COFF-ARM64 object with "file format not recognized".

The prior shim (cp llvm-nm.exe nm.exe into the SDK bin, prepended to
GITHUB_PATH) never took effect: the PATH entry was added in MSYS form
(/c/...), which native CreateProcess PATH-search cannot see, so the
literal \`nm\` still resolved to the ambient binutils tool.

Fix both halves:
- build/selfhost.w: run_cli_selfhost_object_symbol_action resolves the nm
  tool through bs_build_w_tool_from_env("NM", <arg>), mirroring
  bs_build_w_nm_smoke — an explicit $NM overrides the target's literal
  "nm" arg.
- selfhost-windows-aarch64.yml: export NM as the absolute Windows-form
  path to the SDK's llvm-nm.exe (which reads COFF-ARM64), and add the SDK
  bin to GITHUB_PATH in Windows form (cygpath -m) so the native link tool
  is actually found. Drops the fragile nm.exe copy shim.
@ropoctl

ropoctl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 7f7cd69f: fix the cli-selfhost-object-symbol-tests battery failure on the arm64 lane.

Root cause. The step failed with nm failed for emit_obj_globals; the captured stderr was file format not recognized. That means the ambient nm (MSYS/Git-for-Windows binutils) was invoked — it lacks the aarch64-COFF BFD backend, so it rejects a valid COFF-ARM64 object. The earlier cp llvm-nm.exe nm.exe shim never took effect: the SDK bin was added to GITHUB_PATH in MSYS form (/c/...), which native CreateProcess PATH-search cannot see, so the literal nm still resolved to the ambient tool.

Fix (both halves).

  • build/selfhost.w: run_cli_selfhost_object_symbol_action now resolves the tool through bs_build_w_tool_from_env("NM", <arg>) — mirroring bs_build_w_nm_smoke — so an explicit $NM overrides the target's literal "nm" arg. This keeps FnAbi-style single-source discipline: one env-aware resolver, not a per-call-site hardcode.
  • selfhost-windows-aarch64.yml: export NM as the absolute Windows-form path to the SDK's llvm-nm.exe (reads COFF-ARM64), and add the SDK bin to GITHUB_PATH in Windows form (cygpath -m) so lld-link.exe is actually found. Drops the fragile nm.exe copy shim.

net_loopback is already handled on this branch by the maintainer-approved //! skip-windows-aarch64: arch-lane skip (verified skipping only on arm64 in run 32303545258; x64 keeps full coverage; tracked as #876).

CI run 32306953983 is in flight against 7f7cd69f.

@ropoctl

ropoctl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

✅ Green on 7f7cd69f — CI run 32306953983.

All windows aarch64 steps passed on the native windows-11-arm runner:

step result
Build (seed → stage1 → stage2 → stage3) ✅
Fixpoint (stage2 == stage3) ✅
Green battery (build :test) ✅

The previously-failing cli-selfhost-object-symbol-tests now passes (wall 18.4s) via the env-aware $NM → llvm-nm.exe resolution. behav_net_loopback skips only on the arm64 lane (#876). This is the correctness gate the plan defined as "done": a cross-built seed that reproduces itself byte-for-byte on real ARM64 Windows.

Ready for review. Not merging to main without your go-ahead.

@ropoctl
ropoctl merged commit a0cf070 into main Aug 19, 2026
5 checks passed
@ropoctl ropoctl mentioned this pull request Aug 19, 2026
ropoctl added a commit that referenced this pull request Aug 20, 2026
Bump the canonical compiler version so a v0.15.1.6 tag cuts the first
release that includes the windows-aarch64 platform (landed on main via
#867 seed cross-build and #870 bootstrap-test + nightly packaging).

The Release workflow asserts src/version == WITH_VERSION in every
per-platform build job, so main must carry the bump before the tag is
pushed. A test-channel dispatch validated all four platform assets
(linux-x86_64, linux-aarch64, windows-x86_64, windows-aarch64) build and
publish end-to-end.
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