Repository navigation
fix(ci): make the Windows release target build and gate it in CI - #1811
Merged
Merged
Conversation
The v2.0.1 release failed on Windows: `session_lifecycle.rs` imported `process_tree_exists` unconditionally while the function is `#[cfg(unix)]`. v2.0.0 failed the same way on a different Windows-only import. The Rust CI job runs on macOS only, so a Windows `cfg` split is never compiled before the tag build. - Gate the import and route the probe through a per-platform helper. - Clear every Windows-only warning (unused imports/locals/helpers used only in macOS or Unix arms, needless returns in cfg tail blocks) so a warnings-denied Windows clippy run is green. - Add a `Rust (clippy, Windows)` CI job on windows-latest and a matching cache warmer under the `ci-windows` key. Pre-commit hook ran. Total eslint: 18, total circular: 0
Comment on lines
+127
to
+152
| name: Rust (warm cache, Windows) | ||
| needs: changes | ||
| if: needs.changes.outputs.rust_required == 'true' | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Rust stable | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Rust cache | ||
| uses: swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: "./src-tauri -> target" | ||
| shared-key: "ci-windows" | ||
| cache-on-failure: true | ||
|
|
||
| - name: Stage org2-pm sidecar | ||
| run: node scripts/tauri/prepare-sidecars.cjs --profile debug | ||
|
|
||
| # No `-D warnings`: a cache producer, not a gate (see the macOS job). | ||
| - name: cargo clippy (all targets) | ||
| working-directory: src-tauri | ||
| run: cargo clippy --workspace --all-targets |
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.
Problem
The v2.0.1 release (run 34867810344) failed in
Build & Release (Windows x64):process_tree_existsis#[cfg(unix)]inregistry.rs, but the newsession_lifecyclemodule imported it unconditionally. The v2.0.0 release failed the same way on a different Windows-only unresolved import (app_platform::CommandCreationFlagsExt, fixed in #1795).Root cause of the recurrence: the
Rust (clippy)CI job runs onmacos-latestonly. The compiler configures the#[cfg(windows)]arm out on macOS, so a Windows-onlycfgsplit is invisible to every PR check and surfaces for the first time on the release tag build.Solution
session_lifecycle.rsnow importsprocess_tree_existsunder#[cfg(unix)]and routes the per-platform probe through a smallshell_process_tree_gonehelper with a Unix and a Windows arm, so the call site carries no platform attributes.cfgmismatches (imports, locals, or helpers used only in a macOS/Unix arm):browsercookie sources,terminalagent-tool and process inspect,key-vaultcursor cache permissions,agent-coreMCP config,perf-utilsapp-memory (lib and tests),app-windowtraffic lights,orgtrack-corecopilot history tests,integrationsgh detection,system-servicesport scanner.Rust (clippy, Windows)CI job inci.yml(samerust_requiredgate,windows-latest,cargo clippy --workspace --all-targets -- -D warnings). Compile-only: the workspace test suite still runs on macOS; this job's purpose is to prove the release target builds before a tag is pushed.warm-rust-cache.ymlunder the matchingci-windowskey so PR runs start warm.Potential risks
Rust (clippy, Windows)to the required checks after this merges.cfggating changes are compile-time only and change no runtime behavior on any platform. macOS clippy was not run locally (Windows machine); the macOS CI job on this PR is the check for that.Verification
x86_64-pc-windows-msvc:cargo check --workspace --all-targetsondevelopreproduced the release error exactly (E0432 insession_lifecycle.rs).cargo clippy --workspace --all-targets -- -D warningsafter the fix: exit 0, no diagnostics (the same command the new CI job runs).cargo testfor the touched crates (app_window,perf_utils,orgtrack_core,system_services,integrations,key_vault,browser,terminal,agent_core):app_window,perf_utils,orgtrack_core,system_services,browser,terminal: all pass.integrations: 2 pre-existing Windows failures (computer_use_lock::tests::is_process_running_self,cli_binary_resolver::tests::preferred_paths_reuse_executable_validation_before_normal_resolution). Both reproduce identically on unmodifieddevelop; neither file is touched here.key_vault: 2 failures in untouched files (auto_detect::suggestions,commands::registry), both environment-dependent path/PATH lookups.agent_core: the test binary exits withSTATUS_ENTRYPOINT_NOT_FOUNDon this machine (a DLL loader error, not a test assertion). It cannot be compared againstdevelop, where the crate's test target does not compile on Windows at all. Clippy builds the same test target cleanly.cargo test --workspaceon Windows, macOS clippy and tests. The macOS CI job on this PR covers the latter.