diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d991bac7..781cbfff 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -116,10 +116,8 @@ jobs: include: - os: ubuntu-24.04 updates: updates-appimage - - os: windows-latest - updates: updates-velopack runs-on: ${{ matrix.os }} - timeout-minutes: ${{ matrix.os == 'windows-latest' && 90 || 60 }} + timeout-minutes: 60 env: RUST_BACKTRACE: "1" steps: @@ -271,6 +269,156 @@ jobs: if: ${{ always() }} run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }} + windows-smoke: + needs: gate + runs-on: windows-latest + timeout-minutes: 60 + env: + RUST_BACKTRACE: "1" + steps: + - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@1.98.0 + with: + components: rustfmt, clippy + - uses: ilammy/msvc-dev-cmd@v1 + if: runner.os == 'Windows' + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: v3-rake-ci-windows-split + cache-all-crates: false + cache-workspace-crates: false + shared-key: desktop-windows-smoke + cache-targets: true + save-if: ${{ github.ref == 'refs/heads/main' }} + # tauri-bundler 2.10.4: dirs::cache_dir()/tauri (no local_tools_directory). + - name: Cache Windows bundler tools + if: runner.os == 'Windows' + id: bundler-tools + uses: actions/cache@v5 + with: + path: | + ~/AppData/Local/tauri/WixTools314 + ~/AppData/Local/tauri/NSIS + key: windows-tauri-bundler-2.10.4-v1 + - name: Prepare Windows bundler tools + if: runner.os == 'Windows' && steps.bundler-tools.outputs.cache-hit != 'true' + shell: pwsh + run: .github/workflows/prepare-bundler-tools.ps1 + - name: Windows private files and native endpoints + if: runner.os == 'Windows' + run: | + cargo test -p rake-client --locked + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + cargo test -p rake-app --no-default-features --test local_control --locked + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Windows supervisor and terminal output + if: runner.os == 'Windows' + run: | + cargo test -p rake-app-cli --bin rake project_build:: --locked + - name: Default desktop lints + run: >- + cargo clippy -p rake-app -p rake-desktop-example -p rake-notes + -p rake-kit-example -p rake-ui -p rake-view -p rake-files + -p rake-tray -p rake-autostart --all-targets --locked -- -D warnings + # Surface graphics failures before the longer workspace/trybuild suites. + - name: Build real desktop smoke app + id: smoke-build + if: ${{ !cancelled() }} + run: cargo build -p rake-desktop-example --features native-smoke --locked + - name: Render a GPUI frame on Windows (D3D11) + if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }} + timeout-minutes: 2 + run: python scripts/desktop-smoke.py target/debug/rake-desktop-example.exe + - name: Build Windows inspection fixtures + if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }} + run: | + cargo build -p rake-app-cli -p rake-desktop-example --features rake-desktop-example/native-smoke,rake-desktop-example/devtools --locked + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Inspect a real Windows GUI and open source outside owned Jobs + if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }} + timeout-minutes: 12 + run: | + node --test scripts/test-embedded-devtools.mjs + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + python scripts/windows-inspection-smoke.py target/debug/rake.exe + - uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: desktop-smoke-windows-latest + path: target/desktop-smoke.log + if-no-files-found: warn + retention-days: 7 + - name: Estimate dependency cache size + if: ${{ always() }} + run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }} + + windows-tests: + needs: gate + runs-on: windows-latest + timeout-minutes: 60 + env: + RUST_BACKTRACE: "1" + steps: + - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@1.98.0 + with: + components: rustfmt, clippy + - uses: ilammy/msvc-dev-cmd@v1 + if: runner.os == 'Windows' + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: v3-rake-ci-windows-split + cache-all-crates: false + cache-workspace-crates: false + shared-key: desktop-windows-tests + cache-targets: true + save-if: ${{ github.ref == 'refs/heads/main' }} + # tauri-bundler 2.10.4: dirs::cache_dir()/tauri (no local_tools_directory). + - name: Cache Windows bundler tools + if: runner.os == 'Windows' + id: bundler-tools + uses: actions/cache@v5 + with: + path: | + ~/AppData/Local/tauri/WixTools314 + ~/AppData/Local/tauri/NSIS + key: windows-tauri-bundler-2.10.4-v1 + - name: Prepare Windows bundler tools + if: runner.os == 'Windows' && steps.bundler-tools.outputs.cache-hit != 'true' + shell: pwsh + run: .github/workflows/prepare-bundler-tools.ps1 + - name: Workspace tests (default native GPUI) + if: ${{ !cancelled() }} + run: cargo test --workspace --locked --no-fail-fast + - name: View tests without devtools or kit + if: ${{ !cancelled() }} + run: >- + cargo test -p rake-app -p rake-ui -p rake-view -p rake-notes + --features rake-app/view-test-support,rake-view/view-test-support,rake-notes/view-test-support + --locked --no-fail-fast + - name: Devtools view tests without kit + if: ${{ !cancelled() }} + run: >- + cargo test -p rake-app --features view-test-support,devtools + --lib --test view_state --test element_inspection --locked --no-fail-fast + - name: Estimate dependency cache size + if: ${{ always() }} + run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }} + + windows-desktop: + # Preserve the existing required-check name across both parallel Windows jobs. + name: desktop (windows-latest) + if: ${{ always() }} + needs: [windows-smoke, windows-tests] + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Require both Windows desktop jobs + env: + SMOKE_RESULT: ${{ needs.windows-smoke.result }} + TESTS_RESULT: ${{ needs.windows-tests.result }} + run: test "$SMOKE_RESULT" = success && test "$TESTS_RESULT" = success + windows-features: needs: gate runs-on: windows-latest diff --git a/crates/rake-cli/src/distribution.rs b/crates/rake-cli/src/distribution.rs index d525c856..cd4179d4 100644 --- a/crates/rake-cli/src/distribution.rs +++ b/crates/rake-cli/src/distribution.rs @@ -312,6 +312,7 @@ pub(crate) fn run(arguments: &[String]) -> Result Result, @@ -301,6 +302,7 @@ impl From<&BundleRequest> for JobOptions { fn from(r: &BundleRequest) -> Self { Self { platform: r.platform, + host_build: r.compatibility && r.target.is_none(), output: r.output.clone(), release: r.release, features: r.features.clone(), @@ -481,6 +483,7 @@ pub fn execute_source_worker( let options = JobOptions { platform: request.platform, + host_build: false, output: resolved.output, release: request.release, features, @@ -687,7 +690,11 @@ fn execute_job( build( selected, binary, - target, + if request.host_build && target == host_target()? { + None + } else { + Some(target) + }, request.release, item, selected @@ -1512,7 +1519,7 @@ pub(crate) fn native_platform() -> Result { fn build( selected: &crate::Package, binary: &str, - target: &str, + target: Option<&str>, release: bool, package_plan: &rake_dist_core::PackagePlan, facade: Option<&str>, @@ -1536,7 +1543,12 @@ fn build( "--manifest-path", ]) .arg(manifest) - .args(["--package", package, "--bin", binary, "--target", target]); + .args(["--package", package, "--bin", binary]); + + // Native dev compatibility builds share Cargo's host-default dependency graph. + if let Some(target) = target { + command.args(["--target", target]); + } if !context.features.is_empty() { command.arg("--features").arg(context.features.join(",")); diff --git a/scripts/windows-inspection-smoke.py b/scripts/windows-inspection-smoke.py index d3c8a999..c595f7da 100644 --- a/scripts/windows-inspection-smoke.py +++ b/scripts/windows-inspection-smoke.py @@ -167,13 +167,15 @@ def main(): app_log, cdp_log = root / "app.log", root / "cdp.log" with app_log.open("w", encoding="utf-8") as app_output, cdp_log.open("w", encoding="utf-8") as cdp_output: try: - # Native dev bundles use an explicit target triple; warm that graph before readiness. + # Warm native dev packaging before readiness using the host-default build. subprocess.run( [str(rake), "bundle", "--native", "--compat", "--json", "--manifest-path", "examples/desktop/Cargo.toml", "--package", "rake-desktop-example", "--bin", "rake-desktop-example", "--output", str(root / "warm"), "--debug", "--features", "native-smoke,devtools"], env=env, stdout=app_output, stderr=subprocess.STDOUT, timeout=420, check=True, ) + assert Path("target/debug/rake-desktop-example.exe").is_file() + assert not Path("target/x86_64-pc-windows-msvc/debug/rake-desktop-example.exe").exists(), "Native dev rebuilt the explicit-target graph" application = subprocess.Popen( [str(rake), "dev", "--compiler", "cargo", "--manifest-path", "examples/desktop/Cargo.toml", "--package", "rake-desktop-example", "--features", "native-smoke", "--cdp", "--no-open", @@ -293,6 +295,7 @@ def ready(): assert not list(control.glob("*.json")), "GUI discovery survived shutdown" for handle in observed: assert kernel.WaitForSingleObject(handle, 5000) == 0, "A supervised Windows process survived shutdown" + assert not Path("target/x86_64-pc-windows-msvc/debug/rake-desktop-example.exe").exists(), "Native dev rebuilt the explicit-target graph" assert "RAKE_DESKTOP_SMOKE_FRAME" in app_log.read_text(errors="replace") assert kernel.WaitForSingleObject(editor_handle, 100) == 258, "Stopping dev killed the source editor" print("Windows desktop dev/CDP, real GUI inspect, reload, shutdown and editor Job survival passed")