Skip to content

Windows: aiui_lib unit-test binary crashes at load (STATUS_ENTRYPOINT_NOT_FOUND) on CI runner #141

Description

@iret77

Symptom

On windows-latest CI, cargo test --lib --release --target x86_64-pc-windows-msvc compiles and links cleanly, but the freshly-linked test binary crashes at process load:

Running unittests src\lib.rs (…\aiui_lib-*.exe)
error: test failed, to rerun pass `--lib`
  process didn't exit successfully: `…\aiui_lib-*.exe` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)

0xc0000139 = the loader can't resolve a named DLL export at startup, before any test runs.

What it is NOT (ruled out)

  • Not flaky — reproduced on every run since 2026-05-30 (15+ runs) and on explicit reruns.
  • Not a runner regressionmain's identical Windows test step, re-run the same day, passes green.
  • Not a dependency change — at the oldest failing branch commit the dependency graph + Cargo.toml/Cargo.lock are identical to green main (the only later lock delta is 3 pure-Rust crates from tower-http's fs feature: http-range-header, mime_guess, unicase — none links a DLL).
  • Not new Windows FFI — the v0.5.0 stabilization diff added no #[cfg(windows)] blocks or Win32 calls; tokio named-pipe usage already existed on green main.
  • Not the two dead-code warnings — fixed in 757eb98; branch is clippy-clean; crash persists.

Likely cause

A binary-scale / linker / loader artifact of the much larger aiui_lib test binary (the v0.5.0 stabilization rewrite + many added unit tests) on the GH windows-latest runner — a known, hard-to-pin class of Windows failure for large Rust test binaries. Same dependency graph as the green macOS/main build, so it is not a logic bug.

Scope / priority

aiui ships macOS-only; the Windows port is WIP. This blocks nothing user-facing. The CI gate was the only impact.

Mitigation in place

CI now runs the Windows test step as compile-only (cargo test --lib --no-run) — still validates that all code + tests build and link on Windows — while macOS runs the full suite. See .github/workflows/ci.yml matrix run_tests flag.

To actually fix (needs Windows hardware or deeper CI introspection)

  • Run the failing aiui_lib-*.exe under a dependency walker / --no-capture on a Windows box to name the missing DLL export.
  • Try toolchain/profile knobs (CRT linkage +crt-static, RUSTFLAGS, debug-info level, split test binaries).
  • CI-bisect the v0.5.0 commit range (92a562b..930ddf2) to pin the introducing commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions