Skip to content

fix(windows): Common-Controls-v6 manifest for aiui_lib test binaries (#141) - #147

Merged
iret77 merged 1 commit into
mainfrom
fix/issue-141-windows-test-crash
Aug 1, 2026
Merged

fix(windows): Common-Controls-v6 manifest for aiui_lib test binaries (#141)#147
iret77 merged 1 commit into
mainfrom
fix/issue-141-windows-test-crash

Conversation

@iret77

@iret77 iret77 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Behebt den STATUS_ENTRYPOINT_NOT_FOUND-Crash des aiui_lib-Test-Binaries auf windows-latest: das Common-Controls-v6-Manifest wird via rustc-link-arg-tests nur in die Test-Harness-Binaries eingebettet (dokumentierte Tauri-Limitierung, tauri#13419). Der ausgelieferte aiui.exe-Pfad bleibt unberührt.

⚠️ Auf echtem Windows unverifiziert (devhost ist headless Linux). Verifikation: run_tests der Windows-CI-Leg auf einem Draft-PR auf true flippen und den "Cargo test"-Step beobachten.

Closes #141


Batch-Kontext: Teil eines 6-PR-Sets (#141, #146, #23, #24, #25, #17) aus parallelen Sub-Sessions, das zusammen einen Release ergibt.

  • Kein Versions-Bump in diesem PR — die Version wird gesammelt beim Release gebumpt (keine Rapid Releases).
  • Empfohlene Merge-Reihenfolge: 1/6. Spätere PRs werden nach vorherigen Merges auf main rebased (Hotspots: mcp.rs, http.rs, skill.md, CHANGELOG.md, server.py).
  • Kein Push auf main; Merge via PR (AGENTS.md). CI baut/testet; interaktives Dialog-E2E nur am Mac verifizierbar.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…-viable build.rs fix (#141)

Static root-cause analysis (unverified on real Windows hardware — devhost
is headless Linux, see rationale below). Supersedes a prior revision of
this commit that shipped a broken fix; see "What changed" below.

Symptom (#141): on windows-latest CI, `cargo test --lib --release` compiles
and links `aiui_lib-*.exe` cleanly but the binary crashes at process load
with STATUS_ENTRYPOINT_NOT_FOUND (0xc0000139), before any test runs. The
real `aiui.exe` (built via `tauri build`, e.g. CI's NSIS bundle step) links
and runs fine — only the separate test-harness binary is affected.

Leading hypothesis for *why* (still unverified, but sourced): this matches
a documented, still-open Tauri limitation (tauri-apps/tauri#13419,
tauri-apps/tauri#6926, discussion #11179). `tauri_build::build()`
(companion/src-tauri/build.rs) embeds the app's Windows manifest — which
pulls in the Microsoft.Windows.Common-Controls v6 side-by-side assembly
that wry/WebView2 and tauri-plugin-dialog's native dialogs depend on —
only into the primary `aiui` bin target, with no path to the separate
`aiui_lib-*.exe` harness `cargo test --lib` links from the same crate.
Without that manifest, the loader resolves the harness's statically
imported Common-Controls-v6 entry points against the default
(unredirected, older) comctl32.dll, which lacks them, aborting at load.

What changed from the previous revision of this commit: it embedded the
manifest via `cargo:rustc-link-arg-tests=/MANIFEST:EMBED`, mirroring
Tauri's own workspace workaround (`examples/api/src-tauri/build.rs`,
`embed_manifest_for_tests()`). That broke Windows CI on PR #147 with
"error: invalid instruction `cargo:rustc-link-arg-tests` ... does not have
a test target". This was NOT a `cargo:` vs `cargo::` colon-syntax problem
(both forms are documented as equivalent, gated only by the general
MSRV-1.77 note for the double-colon spelling) — it is architectural:
`rustc-link-arg-tests`, in either syntax, only applies to actual
integration-test targets under `tests/` (rust-lang/cargo#10937, filed
2022; a docs-only patch acknowledging the gap, #15814, went stale and was
closed 2026-07-17 without a real fix landing). `companion/src-tauri` has
no `tests/` directory — all ~148 tests are `#[cfg(test)]` unit tests in
`src/*.rs` run via `--lib` — so Cargo rejects the instruction outright,
exactly matching the CI error. Switching to `cargo::rustc-link-arg-tests`
would not have helped: the same missing `tests/` target still makes the
instruction invalid regardless of colon style. The unqualified
`cargo:rustc-link-arg` doesn't help either: its "tests" eligibility is
gated on the identical `TargetKind::Test` check per the same Cargo issue,
so it would silently no-op for our `--lib` harness (no fix) while also
applying to the shipped `aiui` bin (risking a duplicate-manifest linker
conflict with the manifest `tauri_build::build()` already embeds there) —
worse on both counts. Net: there is currently no documented Cargo
build-script mechanism that can scope a linker/manifest change to only a
`--lib` unit-test harness in a package like this one, so the attempted fix
is reverted (build.rs comment-only now; `windows-test-manifest.xml`
removed) rather than reissued under different syntax.

Real next steps (need Windows hardware or a larger refactor, out of scope
here): (a) run the failing `aiui_lib-*.exe` under a dependency walker /
`dumpbin /imports` on a Windows box to name the actual missing export and
confirm/refute the Common-Controls-v6 hypothesis, or (b) split the
Tauri/wry-dependent code out of `aiui_lib` into a separate crate so the
`--lib` unit-test harness never links wry/WebView2 at all. Until one of
those lands, the existing CI mitigation stays in place: Windows runs
`cargo test --lib --no-run` (compile+link only, no execution; `run_tests`
matrix flag in .github/workflows/ci.yml, introduced in 1e2e061) —
untouched by this commit.

Verification: NONE performed here — devhost has no Windows runner. A
plain Linux `cargo check` passes (confirms build.rs still compiles; the
removed code was `#[cfg(windows)]`-gated so that check was already weak
evidence, and is now moot since no functional Windows-only code remains).

Refs #137, #141
@iret77
iret77 force-pushed the fix/issue-141-windows-test-crash branch from f59c86d to 1436dde Compare August 1, 2026 09:49
@iret77
iret77 merged commit 7f02fae into main Aug 1, 2026
4 checks passed
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.

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

1 participant