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
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:
+8
-6
@@ -379,12 +379,14 @@ function Install-Prebuilt {
|
|||||||
Verify-ArchiveChecksum $url $zip
|
Verify-ArchiveChecksum $url $zip
|
||||||
Expand-Archive -Force -Path $zip -DestinationPath $extract
|
Expand-Archive -Force -Path $zip -DestinationPath $extract
|
||||||
Verify-ArchiveVersion $extract $url
|
Verify-ArchiveVersion $extract $url
|
||||||
foreach ($bin in @("dosh-client.exe", "dosh-bench.exe")) {
|
$client = Get-ChildItem -Path $extract -Recurse -File -Filter "dosh-client.exe" | Select-Object -First 1
|
||||||
$found = Get-ChildItem -Path $extract -Recurse -File -Filter $bin | Select-Object -First 1
|
if (-not $client) {
|
||||||
if (-not $found) {
|
throw "prebuilt archive missing dosh-client.exe"
|
||||||
throw "prebuilt archive missing $bin"
|
}
|
||||||
}
|
Install-Binary $client.FullName (Join-Path $bindir "dosh-client.exe")
|
||||||
Install-Binary $found.FullName (Join-Path $bindir $bin)
|
$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")
|
Install-Binary (Join-Path $bindir "dosh-client.exe") (Join-Path $bindir "dosh.exe")
|
||||||
return $true
|
return $true
|
||||||
|
|||||||
@@ -230,6 +230,21 @@ fn windows_source_fallback_builds_client_only_like_unix() {
|
|||||||
assert!(ps1.contains("if (Test-Path \"target\\release\\dosh-bench.exe\")"));
|
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]
|
#[test]
|
||||||
fn windows_installer_adds_user_path_idempotently() {
|
fn windows_installer_adds_user_path_idempotently() {
|
||||||
let ps1 = include_str!("../install.ps1");
|
let ps1 = include_str!("../install.ps1");
|
||||||
|
|||||||
Reference in New Issue
Block a user