feat(runtime): support same-commit patch-revision alpha rebuilds

This commit is contained in:
Nwflower committed 2026-11-29 00:54:19 -07:00
1 parent d21ee22c80
commit 5000e00780
5 files changed
+131 -17

No files matched your search

+10 -6
View File
@@ -43,6 +43,9 @@ param(
[ValidateSet('alpha', 'stable')]
[string]$Channel = 'alpha',
[int]$ZstdLevel = 15,
# Release identifier for archive names and manifest.commit (defaults to short
# upstream commit; e.g. "3731afd-p2" for a patch-queue rebuild of 3731afd).
[string]$ReleaseId = '',
# Names from patches/series.txt actually applied. Not given: all of them.
# Given but empty: none (every patch already upstream).
[string[]]$Patches = @()
@@ -93,6 +96,7 @@ foreach ($p in @($ctlExe, $utilExe, $qemuExe)) {
$commit = (git -C $ReimsRepo rev-parse --short HEAD).Trim()
$fullCommit = (git -C $ReimsRepo rev-parse HEAD).Trim()
$id = if ($ReleaseId -and $ReleaseId.Trim()) { $ReleaseId.Trim() } else { $commit }
$qemuRepo = Join-Path $ReimsRepo 'vendor\qemu'
$qemuCommit = (git -C $qemuRepo rev-parse HEAD).Trim()
@@ -206,9 +210,9 @@ if ($otherCtl.Count -or $otherQemu.Count) {
throw "Undeclared changes in the build trees:`n$($otherCtl + $otherQemu -join "`n")"
}
$bundleName = "reims-runtime-win-x64-$commit"
$srcName = "reims-runtime-src-$commit"
$stageRoot = Join-Path $TempRoot "pack-$commit"
$bundleName = "reims-runtime-win-x64-$id"
$srcName = "reims-runtime-src-$id"
$stageRoot = Join-Path $TempRoot "pack-$id"
$bundleDir = Join-Path $stageRoot $bundleName
$srcDir = Join-Path $stageRoot $srcName
if (Test-Path -LiteralPath $stageRoot) { Remove-Item -Recurse -Force -LiteralPath $stageRoot }
@@ -260,7 +264,7 @@ $msysText = @"
# (pacman -Qo on the build machine, $(Get-Date -Format 'yyyy-MM-dd')).
#
# Sources: every package whose licence requires source (GPL / LGPL / MPL) is in
# reims-runtime-msys2-src-$commit.tar.zst, published beside this runtime.
# reims-runtime-msys2-src-$id.tar.zst, published beside this runtime.
# The same files are also at:
# https://repo.msys2.org/mingw/sources/ (<package>-<version>.src.tar.zst, by pkgbase)
# https://github.com/msys2/MINGW-packages (build recipes)
@@ -340,7 +344,7 @@ $manifest = [ordered]@{
name = $bundleName
platform = 'windows-x86_64'
upstream_repo = 'https://github.com/steelbrain/reims-vgpu'
commit = $commit
commit = $id
full_commit = $fullCommit
vendor_qemu_commit = $qemuCommit
util_commit = $utilCommit
@@ -372,7 +376,7 @@ Write-Utf8 "$runtimeArchive.sha256" "$rtHash $bundleName.tar.zst`n"
Write-Utf8 (Join-Path $OutDir 'SHA256SUMS.txt') "$rtHash $bundleName.tar.zst`n$srcHash $srcName.tar.zst`n"
# Sources of the copyleft MSYS2 packages, as their own asset (adds a line to SHA256SUMS.txt).
& (Join-Path $PSScriptRoot 'pack-msys2-sources.ps1') -PackagesFile (Join-Path $bundleDir 'MSYS2-PACKAGES.txt') -Commit $commit -OutDir $OutDir -Msys2 $Msys2 -TempRoot $TempRoot
& (Join-Path $PSScriptRoot 'pack-msys2-sources.ps1') -PackagesFile (Join-Path $bundleDir 'MSYS2-PACKAGES.txt') -Commit $id -OutDir $OutDir -Msys2 $Msys2 -TempRoot $TempRoot
Remove-Item -Recurse -Force -LiteralPath $stageRoot