Skip to content

Fix Windows release builds on Rust 1.88 - #193

Merged
Shengyu Fu (shengyfu) merged 1 commit into
mainfrom
shengyfu-windows-compiler-compatibility
Oct 11, 2026
Merged

Shengyu Fu (shengyfu) merged 1 commit into
mainfrom
shengyfu-windows-compiler-compatibility

Conversation

@shengyfu

@shengyfu Shengyu Fu (shengyfu) commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Restore Windows release-build compatibility with Rust 1.88 without changing the Microsoft ms-stable installer/channel, OneBranch signing, hardening, packaging, checksums, publication, or release version 1.2.0.

The previous rusqlite Git pin used cfg_select!, which requires Rust 1.95. This advances the pin to the upstream development-line Rust 1.88 compatibility fix and replaces four workspace atomic try_update calls with equivalent checked fetch_update calls. Their orderings, overflow/budget checks and error handling are preserved. Call-local deprecation allowances let newer compilers accept the intentionally older API.

Declare rust-version = "1.88" in workspace metadata, inherit it in core/CLI, correct the contributor requirement, and add a bounded native Windows Rust 1.88 job. That job checks all targets, executes the existing native WAL and managed-lifecycle suites, builds the actual hardened x64 release executable, smoke-tests it and checks lockfile stability. Existing CI jobs/triggers and the Azure DevOps OneBranch YAML are unchanged.

Dependency choice and SQLite change

Item Before After
rusqlite Git revision 2a71e35d94b2a02f7dd4a0c4cfd59c339370e747 a1a23ea2a6a8a27bc07c8b10cbd363760287e1cc
rusqlite package version 0.40.1 0.40.1
libsqlite3-sys package version 0.38.1 0.38.1
Actual bundled SQLite 3.53.3 3.53.4

The selected revision is a descendant of the previous development-line pin and retains its native Windows WAL-lock correction. The published rusqlite 0.40.2 maintenance release was evaluated but rejected: its bundled SQLite 3.53.2 failed the unchanged native Windows WAL-reclamation regression. This is therefore an intentional SQLite patch upgrade, not a maintenance-branch downgrade or an assertion that the bundled database source is unchanged. Both selected SQLite versions include the SQLite 3.53.0 WAL-reset fix.

Cargo updated only the rusqlite/libsqlite3-sys Git sources in root and fuzz lockfiles; package versions and other dependency edges are unchanged. vendor/ignore/Cargo.lock is unchanged. Git-source retrieval remains required as before.

Validation

All build, Rayon and test concurrency was bounded to two. The final source passed the following CI-equivalent commands on native Windows x64 with ordinary NTFS temporary storage:

$env:CARGO_BUILD_JOBS = '2'
$env:RAYON_NUM_THREADS = '2'
$env:RUST_TEST_THREADS = '2'
$env:RUSTFLAGS = '-Ccontrol-flow-guard -Ctarget-feature=+crt-static -Clink-arg=/DYNAMICBASE -Clink-arg=/CETCOMPAT'

cargo +1.88.0 check --locked --workspace --all-targets --features tgrep-cli/managed-test-hooks
cargo +1.88.0 test --locked -p tgrep-core --features managed-test-hooks --test managed_catalog_windows --test managed_lifecycle -- --test-threads=2
cargo +1.88.0 build --release --locked -p tgrep-cli --bin tgrep --target x86_64-pc-windows-msvc --message-format=json

Results: workspace check passed; native WAL 3/3 and managed lifecycle 37/37 passed; the optimized hardened release build succeeded using upstream rustc 1.88.0 (6b00bc388 2025-06-23).

Additional focused commands, in separate shells using the repository's normal Windows target flags:

cargo +1.88.0 test --locked -p tgrep-core --features managed-test-hooks --lib managed:: -- --test-threads=2
cargo +1.88.0 test --locked -p tgrep-cli --features managed-test-hooks --test shared_daemon -- managed::live:: managed::faults:: managed::owner_fixture_ managed::v2_cli_ managed::offline_collection_ managed::multiline_count_matches_ --test-threads=2
cargo +1.99.0 clippy --locked --workspace --all-targets --features tgrep-cli/managed-test-hooks -- -D warnings
cargo +stable fmt --all -- --check
cargo +1.88.0 metadata --locked --offline --format-version 1
cargo +1.88.0 metadata --locked --offline --manifest-path fuzz\Cargo.toml --format-version 1

Results: core managed unit tests 89/89; selected CLI shared-managed regressions 23/23; strict Clippy, formatting and both complete locked dependency graphs passed. All three lockfile SHA256 values remained unchanged through validation. Structural YAML comparison confirmed existing CI configuration and OneBranch hardening were preserved.

The exact release executable was copied into an immutable unsigned artifact. --version returned tgrep 1.2.0; JSON search returned exactly the expected workspace-package match, and the CI quiet-search smoke passed:

& $binary --version
& $binary --json --no-index -F -- '[workspace.package]' Cargo.toml
& $binary --no-index -F -q -- '[workspace.package]' Cargo.toml

Independent final-artifact checks also passed: read/write/restart of a catalog produced with SQLite 3.53.3, preservation of exact header/allocation state, and subsequent read-back by the old executable. A separate native NTFS fixture freshly published a managed generation and checkpoint, served a verified shared-v2 JSON query identical to a verified no-index scan, then detached/drained and shut down cleanly. These checks used the final hook-free artifact, with unchanged executable hashes and no cleanup errors.

Source commit: c937c062a035a2145240e5abe41a279a05f8a363.
Unsigned executable SHA256: C55E4E9C48B7733833CAF457B4F4F4D0303C6D99C7E83F57C65DDCC072D2ADE1.

Limits and observed intermittence

Initial Rust 1.88 NTFS lifecycle runs failed intermittently with producer-member-modified and ChangeTime-only inventory drift. Subsequent uninstrumented runs of the unchanged lifecycle/authentication code passed all 37 cases, including the final exact-hardening run. No diagnostic, speculative handle-lifetime change, authentication relaxation, retry wrapper, TEMP redirection or weakened assertion is included. This PR does not claim to fix that intermittent issue. Unchanged main with its original dependency and Rust 1.99 passed 37/37, as did the new pin on Rust 1.99; no current-main failure was established by those controls. Exact-head CI remains important.

Local upstream-Rust results do not qualify the Microsoft compiler/feed, official OneBranch execution, signing, BinSkim or release publication. No ARM64 build/native execution or full legacy-control/native OS matrix is claimed; existing CI provides broader qualification. No release was queued or published, and no existing tag was changed.

Exact-head CI follow-up

At unchanged head c937c062a035a2145240e5abe41a279a05f8a363, CI run 38179834688, attempt 2 and the single Ubuntu rerun succeeded, including indexed_hidden 11/11. The original Ubuntu job failed its indexed-backend assertion when missing meta.json caused a filesystem scan; exactly one unchanged-head job rerun was requested, without source or assertion edits. Bounded native Linux/ext4 controls on Rust 1.98.1 also passed the full 11-test suite plus five focused repetitions for each of this head and unchanged main 669e832bda5a87df05c330a3e32754f6201ac534. No failure was reproduced on either control, and these results do not establish a fix or baseline reproduction of the intermittent publication/discovery issue. Original and rerun evidence are retained; human approval remains required.

Advance the rusqlite Git pin to the compatible development-line revision while retaining native Windows WAL fixes and upgrading bundled SQLite to 3.53.4. Declare and exercise the workspace MSRV, use compatible atomic updates, and preserve OneBranch release hardening and publication behavior.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The Windows-specific release path and development-line database pin warrant final human review with exact-head CI results.

0 open findings

What changed in this PR

Restores Rust 1.88 compatibility for Windows release builds while preserving release hardening and packaging behavior.

Changes:

  • Replaces unavailable atomic try_update calls with compatible fetch_update.
  • Advances the pinned rusqlite revision and synchronizes lockfiles.
  • Declares Rust 1.88 as the workspace minimum and adds Windows MSRV CI coverage.
File Description
Cargo.toml Declares MSRV and updates rusqlite pin.
Cargo.lock Records updated Git sources.
fuzz/​Cargo.lock Synchronizes fuzz dependencies.
tgrep-core/​Cargo.toml Inherits workspace MSRV.
tgrep-cli/​Cargo.toml Inherits workspace MSRV.
tgrep-core/​src/​managed/​work.rs Uses Rust 1.88-compatible atomic updates.
tgrep-core/​src/​managed/​views.rs Uses compatible epoch updates.
.github/​workflows/​ci.yml Adds bounded Windows Rust 1.88 qualification.
CONTRIBUTING.md Documents MSRV, CI, and dependency changes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@shengyfu
Shengyu Fu (shengyfu) merged commit 3ba6ee0 into main Oct 11, 2026
24 of 25 checks passed
@shengyfu
Shengyu Fu (shengyfu) deleted the shengyfu-windows-compiler-compatibility branch October 11, 2026 22:49
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.

2 participants