From cc78c8775d719a08d338c665c19fbafd60df87aa Mon Sep 17 00:00:00 2001 From: greepar Date: Thu, 23 Jul 2026 16:21:12 +0800 Subject: [PATCH] Make win-x86 Skia patch idempotent --- scripts/build-windows-static-graphics.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build-windows-static-graphics.ps1 b/scripts/build-windows-static-graphics.ps1 index d39cb51..96c557b 100644 --- a/scripts/build-windows-static-graphics.ps1 +++ b/scripts/build-windows-static-graphics.ps1 @@ -363,6 +363,9 @@ function Patch-WinX86SkiaLinker($SkiaDir) { $pattern = '(?m)^ skjson::ObjectValue\* a = nullptr;\r?\n auto r = \(\*a\)\["tmp"\]\.getType\(\);\r?$' $patched = [regex]::Replace($text, $pattern, ' int r = 0;') if ($patched -eq $text) { + if ($text -match '(?m)^ int r = 0;\r?$') { + return + } throw "Unable to patch win-x86 sk_linker JSON keep-alive references." } Set-Content -Path $linkerPath -Value $patched -NoNewline -Encoding UTF8