fix(scripts): add cargo and perl auto-discovery to verify_agent_work.ps1

This commit is contained in:
Mike Kell 2026-08-22 09:26:07 -04:00
parent 5f714c631c
commit f13d044111
1 changed files with 23 additions and 1 deletions

View File

@ -9,13 +9,35 @@ $RootDir = "$PSScriptRoot\.."
$StartTime = Get-Date
$FailCount = 0
# Locate Perl — required by openssl-sys build script (bundled-sqlcipher-vendored-openssl)
if (-not (Get-Command perl -ErrorAction SilentlyContinue)) {
$PerlCandidates = @(
"C:\Strawberry\perl\bin",
"C:\Perl\bin",
"C:\Program Files\Git\usr\bin",
"C:\Program Files (x86)\Git\usr\bin"
)
foreach ($perlDir in $PerlCandidates) {
if (Test-Path "$perlDir\perl.exe") {
$env:PATH = "$perlDir;$env:PATH"
Write-Host " INFO: Found perl at $perlDir\perl.exe" -ForegroundColor Yellow
break
}
}
if (-not (Get-Command perl -ErrorAction SilentlyContinue)) {
Write-Host " WARN: perl not found - openssl-sys (chronogrid_core/ffi) builds may fail." -ForegroundColor Yellow
}
}
# Locate cargo — try common install locations if not already on PATH
$CargoExe = "cargo"
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
$CandidatePaths = @(
"$env:USERPROFILE\.cargo\bin\cargo.exe",
"C:\Users\$env:USERNAME\.cargo\bin\cargo.exe",
"$env:LOCALAPPDATA\Programs\Rust\bin\cargo.exe"
"D:\Users\$env:USERNAME\.cargo\bin\cargo.exe",
"$env:LOCALAPPDATA\Programs\Rust\bin\cargo.exe",
"C:\Users\mtkel\.cargo\bin\cargo.exe"
)
foreach ($candidate in $CandidatePaths) {
if (Test-Path $candidate) {