fix(windows): Common-Controls-v6 manifest for aiui_lib test binaries (#141) - #147
Merged
Conversation
…-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
force-pushed
the
fix/issue-141-windows-test-crash
branch
from
August 1, 2026 09:49
f59c86d to
1436dde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behebt den STATUS_ENTRYPOINT_NOT_FOUND-Crash des
aiui_lib-Test-Binaries auf windows-latest: das Common-Controls-v6-Manifest wird viarustc-link-arg-testsnur in die Test-Harness-Binaries eingebettet (dokumentierte Tauri-Limitierung, tauri#13419). Der ausgelieferteaiui.exe-Pfad bleibt unberührt.run_testsder Windows-CI-Leg auf einem Draft-PR auftrueflippen 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.
mainrebased (Hotspots:mcp.rs,http.rs,skill.md,CHANGELOG.md,server.py).main; Merge via PR (AGENTS.md). CI baut/testet; interaktives Dialog-E2E nur am Mac verifizierbar.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.