From 1e5b02973104e352df26bb0954030c4620696923 Mon Sep 17 00:00:00 2001 From: DuProcess <273172371+DuProcess@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:44:08 -0400 Subject: [PATCH] Speed up Windows source fallback installs --- install.ps1 | 10 ++++++++-- tests/release_scripts.rs | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index ea4034e..bc06155 100644 --- a/install.ps1 +++ b/install.ps1 @@ -427,10 +427,16 @@ function Install-FromSource { try { Push-Location $src - cargo build --release --bin dosh-client --bin dosh-bench + $buildArgs = @("build", "--release", "--bin", "dosh-client") + if ($Quiet) { + $buildArgs = @("build", "-q", "--release", "--bin", "dosh-client") + } + cargo @buildArgs Install-Binary "target\release\dosh-client.exe" (Join-Path $bindir "dosh-client.exe") Install-Binary "target\release\dosh-client.exe" (Join-Path $bindir "dosh.exe") - Install-Binary "target\release\dosh-bench.exe" (Join-Path $bindir "dosh-bench.exe") + if (Test-Path "target\release\dosh-bench.exe") { + Install-Binary "target\release\dosh-bench.exe" (Join-Path $bindir "dosh-bench.exe") + } } finally { Pop-Location diff --git a/tests/release_scripts.rs b/tests/release_scripts.rs index e67cba4..b824f02 100644 --- a/tests/release_scripts.rs +++ b/tests/release_scripts.rs @@ -209,6 +209,27 @@ fn windows_installer_honors_quiet_update_mode() { ); } +#[test] +fn windows_source_fallback_builds_client_only_like_unix() { + let install = include_str!("../install.sh"); + let ps1 = include_str!("../install.ps1"); + assert!(install.contains("cargo build -q --release --bin dosh-client")); + assert!(install.contains("cargo build --release --bin dosh-client")); + assert!(ps1.contains("$buildArgs = @(\"build\", \"--release\", \"--bin\", \"dosh-client\")")); + assert!( + ps1.contains( + "$buildArgs = @(\"build\", \"-q\", \"--release\", \"--bin\", \"dosh-client\")" + ), + "Windows quiet source fallback should use cargo -q like Unix" + ); + assert!(ps1.contains("cargo @buildArgs")); + assert!( + !ps1.contains("cargo build --release --bin dosh-client --bin dosh-bench"), + "Windows client source fallback must not compile dosh-bench on every update" + ); + assert!(ps1.contains("if (Test-Path \"target\\release\\dosh-bench.exe\")")); +} + #[test] fn windows_installer_adds_user_path_idempotently() { let ps1 = include_str!("../install.ps1");