Skip to content

Commit 20809f0

Browse files
committed
measure-693 round 4: a non-ASCII MCPP_HOME, the shape of a non-ASCII Windows user name
1 parent e2b9113 commit 20809f0

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

‎.github/measure-693/measure.ps1‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,5 +401,40 @@ if ($Patched) {
401401
}
402402
}
403403

404+
# ---------------------------------------------------------------------------
405+
# 5. Round 4: a non-ASCII MCPP_HOME in an ASCII project, which is the shape of
406+
# a Windows account whose user name is not ASCII (%USERPROFILE%\.mcpp).
407+
# Real directories, not junctions: a canonicalising reader would resolve a
408+
# junction back to the ASCII target and measure nothing.
409+
# ---------------------------------------------------------------------------
410+
$Homes = [ordered]@{ latin1 = "C:\mh-caf$e"; nonacp = "C:\mh-$cjk" }
411+
foreach ($hk in $Homes.Keys) {
412+
New-Item -ItemType Directory -Force -Path $Homes[$hk] | Out-Null
413+
foreach ($bk in 'release', 'patched') {
414+
if ($bk -eq 'patched' -and -not $Patched) { continue }
415+
$bin = if ($bk -eq 'release') { $Rel } else { $Patched }
416+
$proj = Join-Path 'C:\w\ascii' "home-$hk-$bk"
417+
Copy-Item -LiteralPath (Join-Path $FixturesDir 'plain') -Destination $proj -Recurse -Force
418+
$toml = "[package]`nname = `"probe`"`nversion = `"0.1.0`"`n`n[toolchain]`ndefault = `"llvm@20.1.7`"`n"
419+
Set-Content -LiteralPath (Join-Path $proj 'mcpp.toml') -Value $toml -Encoding ascii -NoNewline
420+
$envx = @{ MCPP_HOME = $Homes[$hk]; MCPP_VENDORED_XLINGS = $VendXl }
421+
$cfgr = Run $bin @('self', 'config', '--mirror', 'GLOBAL') $proj 300 $envx
422+
$sw = [System.Diagnostics.Stopwatch]::StartNew()
423+
$r = Run $bin @('build') $proj 2400 $envx
424+
$secs = [int]$sw.Elapsed.TotalSeconds
425+
$id = "q5.home-$hk.$bk"
426+
if ($r.startError) { Reading $id "PROBE DEFECT: did not start: $($r.startError)"; continue }
427+
$exeOut = ''
428+
$exe = Get-ChildItem -LiteralPath (Join-Path $proj 'target') -Recurse -Filter probe.exe -ErrorAction SilentlyContinue |
429+
Where-Object { $_.FullName -match '\\bin\\' } | Select-Object -First 1
430+
if ($exe) {
431+
$x = Run $exe.FullName @() $proj 60
432+
$exeOut = " run: exit=$(Hex32 $x.code) $(OneLine ($x.out + $x.err))"
433+
}
434+
Reading $id "config exit=$(Hex32 $cfgr.code); build exit=$(Hex32 $r.code) time=${secs}s$exeOut"
435+
if ($r.code -ne 0 -or $r.timedOut) { Reading "$id.tail" (Tail ($r.out + $r.err) 12) }
436+
}
437+
}
438+
404439
Write-Host 'measurement complete'
405440
exit 0

0 commit comments

Comments
 (0)