Make Windows prebuilt bench optional
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-16 21:49:03 -04:00
parent 79495b1ba9
commit 341245f632
2 changed files with 23 additions and 6 deletions
+8 -6
View File
@@ -379,12 +379,14 @@ function Install-Prebuilt {
Verify-ArchiveChecksum $url $zip
Expand-Archive -Force -Path $zip -DestinationPath $extract
Verify-ArchiveVersion $extract $url
foreach ($bin in @("dosh-client.exe", "dosh-bench.exe")) {
$found = Get-ChildItem -Path $extract -Recurse -File -Filter $bin | Select-Object -First 1
if (-not $found) {
throw "prebuilt archive missing $bin"
}
Install-Binary $found.FullName (Join-Path $bindir $bin)
$client = Get-ChildItem -Path $extract -Recurse -File -Filter "dosh-client.exe" | Select-Object -First 1
if (-not $client) {
throw "prebuilt archive missing dosh-client.exe"
}
Install-Binary $client.FullName (Join-Path $bindir "dosh-client.exe")
$bench = Get-ChildItem -Path $extract -Recurse -File -Filter "dosh-bench.exe" | Select-Object -First 1
if ($bench) {
Install-Binary $bench.FullName (Join-Path $bindir "dosh-bench.exe")
}
Install-Binary (Join-Path $bindir "dosh-client.exe") (Join-Path $bindir "dosh.exe")
return $true
+15
View File
@@ -230,6 +230,21 @@ fn windows_source_fallback_builds_client_only_like_unix() {
assert!(ps1.contains("if (Test-Path \"target\\release\\dosh-bench.exe\")"));
}
#[test]
fn windows_prebuilt_install_requires_client_but_not_bench() {
let install = include_str!("../install.sh");
let ps1 = include_str!("../install.ps1");
assert!(install.contains("install_extracted_binary \"$tmpdir/extract\" dosh-client"));
assert!(install.contains("if found_bench=\"$(find_extracted_binary"));
assert!(ps1.contains("throw \"prebuilt archive missing dosh-client.exe\""));
assert!(ps1.contains("-Filter \"dosh-bench.exe\""));
assert!(ps1.contains("if ($bench)"));
assert!(
!ps1.contains("throw \"prebuilt archive missing dosh-bench.exe\""),
"Windows prebuilt install should not fall back to source just because dosh-bench is absent"
);
}
#[test]
fn windows_installer_adds_user_path_idempotently() {
let ps1 = include_str!("../install.ps1");