Compare commits

...
Author SHA1 Message Date
NwflowerandClaude Opus 5.5 2c64ad41aa windows-runtime: keep the patch queue empty
Leave the reims-vgpu performance patch and the QEMU prealloc patch out of
the series: their changes go to their own repositories as reviewed pull
requests, and the prebuilt kexts are rebuilt from reviewed sources. The
packer's handling of binary hunks and index modes stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 22:46:13 -07:00
sitxovski f13f143001 windows-runtime: pack patches with binary files and mode changes
- pack-runtime.ps1 reads a patch's paths from its "diff --git" headers,
  so binary files (prebuilt kexts) are declared too, and compares
  "index" lines without their file mode.
- series.txt: the local performance patch for reims-vgpu and the
  multithreaded Windows prealloc patch for vendor/qemu.
2026-12-04 16:58:34 +03:00
@@ -192,9 +192,11 @@ foreach ($e in $series) {
if ($usePatchList -and $e.Name -notin $Patches) { continue }
$file = Join-Path $patchesDir $e.Name
if (-not (Test-Path -LiteralPath $file)) { throw "Patch missing: $file" }
# Files the patch touches ("--- a/x" / "+++ b/x"), to scope the diff checks.
# Files the patch touches ("--- a/x" / "+++ b/x", and each "diff --git a/x b/y" header, which a
# binary patch has alone), to scope the diff checks.
$paths = @(Get-Content -LiteralPath $file | ForEach-Object {
if ($_ -match '^(?:---|\+\+\+) [ab]/(.+?)\s*$') { $Matches[1] }
elseif ($_ -match '^diff --git a/(.+?) b/(.+?)\s*$') { $Matches[1]; $Matches[2] }
} | Select-Object -Unique)
$patchSpecs += @{
Name = $e.Name
@@ -226,7 +228,12 @@ foreach ($targetName in $byTarget.Keys) {
# object count between the upstream clone and the single-commit verify repo.
$diffArgs = @('-C', $repo, '-c', 'core.autocrlf=false', 'diff', '--full-index')
if ($paths.Count) { $diffArgs += '--'; $diffArgs += $paths }
$treeDiff = (& git @diffArgs | Out-String).Replace("`r`n", "`n").TrimEnd()
# The mode on an "index" line is the file's, not the change's: the verify tree is extracted by
# tar on Windows, which keeps no executable bit, so a changed executable (a prebuilt kext) reads
# 100644 there and 100755 here. A change of mode has its own "old mode"/"new mode" lines, which
# stay compared.
$indexMode = '(?m)^(index [0-9a-f]+\.\.[0-9a-f]+) [0-7]{6}$'
$treeDiff = ((& git @diffArgs | Out-String).Replace("`r`n", "`n") -replace $indexMode, '$1').TrimEnd()
# Apply the declared patch stack to a clean temporary clone of HEAD and compare diffs byte-for-byte.
$verifyDir = Join-Path $TempRoot ("patch-verify-" + [guid]::NewGuid())
@@ -270,7 +277,7 @@ foreach ($targetName in $byTarget.Keys) {
Invoke-GitApply $verifyDir $patchText
Remove-Item -LiteralPath $patchLf -Force
}
$expectedDiff = (& git -C $verifyDir -c core.autocrlf=false diff --full-index | Out-String).Replace("`r`n", "`n").TrimEnd()
$expectedDiff = ((& git -C $verifyDir -c core.autocrlf=false diff --full-index | Out-String).Replace("`r`n", "`n") -replace $indexMode, '$1').TrimEnd()
if ($treeDiff -ne $expectedDiff) {
$treeStat = (& git -C $repo diff --stat -- @paths | Out-String).Trim()
$expStat = (& git -C $verifyDir diff --stat | Out-String).Trim()