Prover package: strip the UTF-16 nulls from the WSL distro list so an installed Ubuntu is detected

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-04 08:28:39 +00:00
parent f8ab74df3e
commit f77e351706

View file

@ -20,7 +20,8 @@ if ($nv) { Write-Host 'NVIDIA driver on Windows:'; & nvidia-smi --query-gpu=name
# Is the distro already installed?
$installed = $false
try { $list = (& wsl.exe --list --quiet 2>$null) -join "`n"; if ($list -match 'Ubuntu-24\.04') { $installed = $true } } catch {}
try { $list = ((& wsl.exe --list --quiet 2>$null) -join "`n") -replace "`0", ""; if ($list -match "Ubuntu-24\.04") { $installed = $true } } catch {}
# (wsl.exe prints UTF-16; without the null strip PowerShell 5 never matches the name and step A repeats with ERROR_ALREADY_EXISTS.)
if (-not $installed) {
Write-Host "Step A: enabling WSL2 and installing $distro (download about 400 MB, approximate)."