Repository navigation
fix(tests): src-tauri's unit tests start on Windows - #390
Merged
emirhanyesilgul merged 1 commit intoOct 10, 2026
Merged
emirhanyesilgul merged 1 commit into
emirhanyesilgul merged 1 commit into
Conversation
The `--lib` test executable had no application manifest. tauri-build embeds one through the app's resource file, which Cargo links into bin targets only, so Windows loaded comctl32 v5 for the test binary. Tauri's dialog code imports TaskDialogIndirect, which only v6 exports, and the loader refused to start the process (0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND) before any test ran. On Windows (MSVC), embed the manifest with the linker for every target the package links, and tell tauri-build not to add a second copy to the app's resource file, which fails the link with CVT1100. Fixes pacifio#332
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
emirhanyesilgul
approved these changes
Oct 10, 2026
emirhanyesilgul
left a comment
Collaborator
There was a problem hiding this comment.
Approving from the Windows side. Tested on Windows 11 (MSVC, Rust 1.99), at 2e8d51f.
| Before (a 0.4.x test binary built 2026-10-05) | With this PR | |
|---|---|---|
cargo test -p atlas --lib |
exits 0xC0000139 before any test |
1011 tests run: 991 passed, 14 failed, 6 ignored |
| manifest in the test binary | none | exactly one, Common-Controls v6 |
manifest in atlas.exe (debug and release) |
— | exactly one, Common-Controls v6 |
- The 14 failures match your list exactly (12 in
commands::skills, plussave_guard::ordinary_save_targets_passandatlas_config::an_absolute_xdg_config_home_wins). windows-app-manifest.xmlis byte-for-byte tauri-build 2.6.1'ssrc/windows-app-manifest.xml.- Native window (
bun run dev:app, real frontend): the app starts. Add project → Open Folder and the channel composer's attach button both open the modern Windows 11 pickers, and cancel cleanly. - Release:
bun run build:app:winbuilds and bundlesAtlas_0.4.1_x64_en-US.msi; itsatlas.execarries exactly one manifest. I didn't install or run the release build. - CI is green on this run, including
app (src-tauri, Windows).
Two small notes, neither blocking:
- The embedded manifest isn't quite identical to before. The linker adds its default
<trustInfo>withrequestedExecutionLevel level="asInvoker", which the resource-file route (and 0.3.4'satlas.exe) didn't have. It's harmless: a 64-bit app runs as invoker either way. Worth a line in the description, or/MANIFESTUAC:NOif you want it identical. std::env::var("CARGO_MANIFEST_DIR")would say what's meant more directly thancurrent_dir(). It's the same directory for build scripts today.
Thanks for tracking this down. I'll pick up the 14 Windows failures it uncovered in a follow-up.
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.
What?
On Windows,
cargo test -p atlas --libnow starts and runssrc-tauri's unit tests. Before, the test executable exited with0xc0000139, STATUS_ENTRYPOINT_NOT_FOUNDbefore running anything.Why?
The guess in #332 is right, and I confirmed it on the failing binary:
TaskDialogIndirectfromcomctl32.dll(pulled in by Tauri's dialog code). Only comctl32 v6 exports it.RT_MANIFESTresource, so Windows bound it to comctl32 v5 and the loader refused to start the process.tauri-build does embed the manifest, but through the app's resource file, which is linked with
cargo:rustc-link-arg-bins. That reaches[[bin]]targets only, soatlas.exegot a manifest and the--libtest executable did not.How?
src-tauri/build.rs, onwindows+msvconly:cargo:rustc-link-arg=/MANIFEST:EMBEDand/MANIFESTINPUT:<src-tauri/windows-app-manifest.xml>.WindowsAttributes::new_without_app_manifest(), so tauri-build does not add a second copy to the app's resource file.windows-app-manifest.xmlhas the same content as tauri-build's default manifest (the Common-Controls v6 dependency), soatlas.exeends up with the same manifest it had before, just embedded by a different route. macOS, Linux andwindows-gnubuilds take the old path unchanged.Two things I tried first, in case they come up in review:
cargo:rustc-link-arg-testsis rejected for this package (does not have a test target). It covers integration tests, not the unit-test executable.cargo:rustc-link-argon its own, keeping tauri-build's manifest, makes the unit tests run but breaks the app link:CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST. That is why the two changes go together.Verification (Windows 11, MSVC, Rust 1.99.0, on top of
0.4.1)cargo test -p atlas --lib0xc0000139before any testcargo build -p atlas --bin atlasatlas.exeI also started the built
atlas.exeand it came up normally (it logged its agent host, memory server and notifier start-up). I did not use the UI beyond that, and the frontend was a stubdist/, so I have left the third checklist box unticked.The 14 failures are real Windows failures that were hidden because the binary never started. They are not caused by this change and I have not touched them here:
commands::skills(symlink handling)state::atlas_config(an_absolute_xdg_config_home_wins:/elsewhere/cfgis not an absolute path on Windows)commands::save_guard(ordinary_save_targets_pass)I can open a follow-up issue listing them if that is useful.
Not run:
bun run ci:localand the frontend checks; this PR only touchessrc-tauri/build.rsand adds the manifest file.cargo clippy -p atlas --all-targets -- -D warningsstops on Windows at an existing lint invendor/atlas-engine/utils/path-uri(chunks_exactwith a constant chunk size), with or without this change; plaincargo clippy -p atlas --libreports nothing forbuild.rs. I could not test macOS or Linux; the new code returns early there.Fixes #332
Checklist