Skip to content

Fix Windows CI cargo test crash (STATUS_ENTRYPOINT_NOT_FOUND) and optimize local date bucketing - #93

Merged
BrianWong05 merged 7 commits into
mainfrom
fix-windows-ci-test
Aug 10, 2026
Merged

Fix Windows CI cargo test crash (STATUS_ENTRYPOINT_NOT_FOUND) and optimize local date bucketing#93
BrianWong05 merged 7 commits into
mainfrom
fix-windows-ci-test

Conversation

@BrianWong05

Copy link
Copy Markdown
Owner

Fix Windows CI cargo test crash and optimize local date bucketing

Problem

The windows-latest leg of CI failed on every run:

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

The test executable died before running a single test.

Root cause

Known Tauri issue (tauri-apps/tauri#13419, #14580, originating in PR #4383):

  • tauri-plugin-dialog links entry points that only exist in Common-Controls v6, which Windows activates solely from the executable's application manifest.
  • tauri-build embeds that manifest into binaries only (rustc-link-arg-bins), never into test executables — so the test exe loads ComCtl32 v5 and fails import resolution at process start.
  • Tauri's own __TAURI_WORKSPACE__ workaround resolves the manifest relative to its own monorepo and cannot work downstream (the previous attempt in .cargo/config.toml had no effect).

Fix

  • Vendor tauri-build's windows-app-manifest.xml into src-tauri/ (byte-for-byte copy of the 2.6.3 default).
  • In build.rs (Windows MSVC only): suppress tauri-build's per-bin manifest via new_without_app_manifest(), then embed the vendored manifest into every link target — binaries and test executables alike — via cargo:rustc-link-arg=/MANIFEST:EMBED + /MANIFESTINPUT:. This mirrors what upstream does in its own workspace.
  • Remove the ineffective __TAURI_WORKSPACE__ env hack from .cargo/config.toml.
  • Non-MSVC targets (macOS, Linux, Windows-gnu) are untouched.

Also in this branch

  • Local date bucketing: replaces per-row strftime(..., 'localtime') with a cached tokenledger_local_bucket SQLite scalar function (chrono resolves offsets in memory instead of crossing into the OS per row), plus a release-mode performance standard (npm run perf, 100k-event budgets) and an equivalence test against SQLite's strftime reference. tokenledger_local_bucket never yields NULL — ambiguous readings take the earlier offset, unmappable instants fall back to UTC.
  • Test-only app_context mocking to avoid GUI resource loading under the mock runtime.
  • crate-type narrowed to ["lib"] (desktop-only app; no mobile targets).

Verification

  • CI green on all three platforms (macos-latest, windows-latest, ubuntu-22.04) — the Windows cargo test leg that this branch targets now runs the full suite.
  • Local suite: 372 + 6 tests passing.

tauri-build embeds the Windows app manifest into binaries only
(rustc-link-arg-bins), so the lib test executable loads Common-Controls
v5 and dies with STATUS_ENTRYPOINT_NOT_FOUND (0xc0000139) before running
any test (tauri-apps/tauri#13419). Tauri's own __TAURI_WORKSPACE__
workaround resolves the manifest relative to its monorepo and cannot
work downstream, so drop that env hack and do what upstream does:
suppress the per-bin manifest and embed the vendored one into every
link target via /MANIFEST:EMBED + /MANIFESTINPUT.
tokenledger_local_bucket no longer yields NULL when the local zone
cannot map an instant: ambiguous readings take the earlier offset and
unmappable ones fall back to UTC, preserving strftime's never-NULL
guarantee. Extract the duplicated hourly flag in queries and name the
synthetic-data epoch anchor (BASE_EPOCH) in the performance standard.
@BrianWong05
BrianWong05 merged commit 12bba51 into main Aug 10, 2026
6 checks passed
@BrianWong05
BrianWong05 deleted the fix-windows-ci-test branch August 10, 2026 04:35
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