From ef96db63b881bdb8c618aef26bbc29bfd480cef5 Mon Sep 17 00:00:00 2001 From: greepar Date: Tue, 21 Jul 2026 16:08:24 +0800 Subject: [PATCH] Release StaticLink.Avalonia 3.119.4-7922.1 --- .../nuget-static-graphics-repack.yml | 2 +- .github/workflows/nuget-static-graphics.yml | 40 ++++- ...m-7151.patch => angle-chromium-7922.patch} | 34 ++-- NuGet/StaticGraphics/README.md | 2 +- .../StaticGraphics/StaticLink.Avalonia.csproj | 4 +- README.md | 4 +- Smoke/AvaloniaStaticLinkSmoke/App.axaml | 7 + Smoke/AvaloniaStaticLinkSmoke/App.axaml.cs | 23 +++ .../AvaloniaStaticLinkSmoke.csproj | 26 +++ .../AvaloniaStaticLinkSmoke/MainWindow.axaml | 13 ++ .../MainWindow.axaml.cs | 11 ++ Smoke/AvaloniaStaticLinkSmoke/Program.cs | 54 +++++++ scripts/build-linux-static-graphics.sh | 8 +- scripts/build-macos-static-graphics.sh | 6 +- scripts/build-windows-static-graphics.ps1 | 4 +- scripts/create-avalonia-smoke.ps1 | 148 +++--------------- 16 files changed, 223 insertions(+), 163 deletions(-) rename External/NativeStatic/patches/{angle-chromium-7151.patch => angle-chromium-7922.patch} (63%) create mode 100644 Smoke/AvaloniaStaticLinkSmoke/App.axaml create mode 100644 Smoke/AvaloniaStaticLinkSmoke/App.axaml.cs create mode 100644 Smoke/AvaloniaStaticLinkSmoke/AvaloniaStaticLinkSmoke.csproj create mode 100644 Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml create mode 100644 Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml.cs create mode 100644 Smoke/AvaloniaStaticLinkSmoke/Program.cs diff --git a/.github/workflows/nuget-static-graphics-repack.yml b/.github/workflows/nuget-static-graphics-repack.yml index 22e0c1f..3a46b1b 100644 --- a/.github/workflows/nuget-static-graphics-repack.yml +++ b/.github/workflows/nuget-static-graphics-repack.yml @@ -6,7 +6,7 @@ on: source_version: description: Existing package version containing the static libraries required: true - default: 3.119.2-7151.11 + default: 3.119.4-7922.1 type: string publish_to_nuget: description: Publish package to nuget.org diff --git a/.github/workflows/nuget-static-graphics.yml b/.github/workflows/nuget-static-graphics.yml index 4ecb7a4..bb21112 100644 --- a/.github/workflows/nuget-static-graphics.yml +++ b/.github/workflows/nuget-static-graphics.yml @@ -18,8 +18,8 @@ on: - "staticlink-avalonia-v*" env: - SKIASHARP_VERSION: "3.119.2" - ANGLE_BRANCH: "7151" + SKIASHARP_VERSION: "3.119.4" + ANGLE_BRANCH: "7922" DOTNET_ALPINE_IMAGE: mcr.microsoft.com/dotnet/sdk:10.0-alpine jobs: @@ -339,7 +339,7 @@ jobs: if: ${{ startsWith(matrix.rid, 'linux-') && !startsWith(matrix.rid, 'linux-musl-') }} run: | sudo apt-get update - sudo apt-get install -y clang lld zlib1g-dev libfontconfig1-dev + sudo apt-get install -y clang lld xvfb zlib1g-dev libfontconfig1-dev libfreetype6 libgl1 libice6 libsm6 libx11-6 libxcb1 libxcursor1 libxext6 libxfixes3 libxinerama1 libxrandr2 libxrender1 libxi6 - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -405,6 +405,40 @@ jobs: } Get-ChildItem -Path $publishDir -Recurse -File | ForEach-Object { $_.FullName } + - name: Run Windows Avalonia smoke app + if: ${{ startsWith(matrix.rid, 'win-') }} + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $publishDir = Join-Path $PWD "artifacts/smoke-${{ matrix.rid }}" + $app = Join-Path $publishDir "AvaloniaStaticLinkSmoke.exe" + $process = Start-Process -FilePath $app -WorkingDirectory $publishDir -PassThru + if ($process.WaitForExit(15000)) { + if ($process.ExitCode -eq 0) { + Write-Host "Avalonia Windows smoke app exited normally." + exit 0 + } + throw "Avalonia Windows smoke app failed with exit code $($process.ExitCode)." + } + + Stop-Process -Id $process.Id -Force + Write-Host "Avalonia Windows smoke app stayed alive for 15 seconds." + + - name: Run Linux Avalonia smoke app + if: ${{ startsWith(matrix.rid, 'linux-') && !startsWith(matrix.rid, 'linux-musl-') }} + shell: bash + run: | + set +e + cd "artifacts/smoke-${{ matrix.rid }}" + chmod +x ./AvaloniaStaticLinkSmoke + timeout 15s xvfb-run -a ./AvaloniaStaticLinkSmoke + code=$? + if [ "$code" = 124 ] || [ "$code" = 143 ]; then + echo "Avalonia Linux smoke app stayed alive for 15 seconds." + exit 0 + fi + exit "$code" + - name: Verify musl ELF dependencies if: ${{ startsWith(matrix.rid, 'linux-musl-') }} shell: bash diff --git a/External/NativeStatic/patches/angle-chromium-7151.patch b/External/NativeStatic/patches/angle-chromium-7922.patch similarity index 63% rename from External/NativeStatic/patches/angle-chromium-7151.patch rename to External/NativeStatic/patches/angle-chromium-7922.patch index b99971c..5e05a5a 100644 --- a/External/NativeStatic/patches/angle-chromium-7151.patch +++ b/External/NativeStatic/patches/angle-chromium-7922.patch @@ -1,9 +1,9 @@ diff --git a/DEPS b/DEPS -index 9085ba513e..565840a832 100644 +index 8ba99a6..1a5e1a5 100644 --- a/DEPS +++ b/DEPS -@@ -696,11 +696,6 @@ deps = { - 'dep_type': 'cipd', +@@ -767,11 +767,6 @@ deps = { + 'condition': 'not build_with_chromium', }, - 'third_party/catapult': { @@ -14,44 +14,42 @@ index 9085ba513e..565840a832 100644 # Cherry is a dEQP/VK-GL-CTS management GUI written in Go. We use it for viewing test results. 'third_party/cherry': { 'url': Var('android_git') + '/platform/external/cherry@4f8fb08d33ca5ff05a1c638f04c85bbb8d8b52cc', -@@ -722,12 +717,6 @@ deps = { - 'condition': 'checkout_android and not build_with_chromium', +@@ -794,10 +789,5 @@ deps = { }, -- - 'third_party/dawn': { - 'url': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'), -- 'condition': 'not build_with_chromium' +- 'condition': 'checkout_angle_dawn_deps and not build_with_chromium' - }, - 'third_party/depot_tools': { - 'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@1fcc527019d786502b02f71b8b764ee674a40953', + 'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@94e89b10b92cc9d6e58fc8d1b6474b7d29e8a114', 'condition': 'not build_with_chromium', -@@ -809,11 +798,6 @@ deps = { +@@ -874,11 +864,6 @@ deps = { 'condition': 'not build_with_chromium', }, - 'third_party/llvm/src': { -- 'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project@1fd8d3fea53e6e4573cdce55bd38ef0a7813a442', -- 'condition': 'not build_with_chromium', +- 'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project@67790d3fb06b184b7be9c4d3e36ab01f0ac4198e', +- 'condition': 'checkout_angle_cl_deps and not build_with_chromium', - }, - - 'third_party/jdk': { - 'packages': [ - { -@@ -1000,11 +984,6 @@ deps = { + 'third_party/llvm-build/Release+Asserts': { + 'dep_type': 'gcs', + 'bucket': 'chromium-browser-clang', +@@ -1216,11 +1201,6 @@ deps = { 'condition': 'checkout_android and not build_with_chromium', }, - 'third_party/SwiftShader': { -- 'url': Var('swiftshader_git') + '/SwiftShader@7905fa19e456df5aa8e2233a7ec5832c9c6c287b', +- 'url': Var('swiftshader_git') + '/SwiftShader@f3e464b1e56795940f826a972b39e19bd9f6ac6c', - 'condition': 'not build_with_chromium', - }, - 'third_party/turbine/cipd': { 'packages': [ { -@@ -1016,10 +995,6 @@ deps = { +@@ -1232,10 +1212,6 @@ deps = { 'dep_type': 'cipd', }, @@ -60,5 +58,5 @@ index 9085ba513e..565840a832 100644 - }, - 'third_party/vulkan-deps': { - 'url': Var('chromium_git') + '/vulkan-deps@b9aab6c35f37e6532011ddab976c3ca71819c074', + 'url': Var('chromium_git') + '/vulkan-deps@f2b9fece7c6772c09379b3a6938dbcd2573f2a3e', 'condition': 'not build_with_chromium', diff --git a/NuGet/StaticGraphics/README.md b/NuGet/StaticGraphics/README.md index 25b8557..147e402 100644 --- a/NuGet/StaticGraphics/README.md +++ b/NuGet/StaticGraphics/README.md @@ -11,7 +11,7 @@ dotnet add package StaticLink.Avalonia Or add it manually: ```xml - + ``` For macOS, also reference `StaticLink.Avalonia.Native`. This package is macOS-only and must match your Avalonia version because it contains `libAvaloniaNative.a`. diff --git a/NuGet/StaticGraphics/StaticLink.Avalonia.csproj b/NuGet/StaticGraphics/StaticLink.Avalonia.csproj index e80b992..0d09bc7 100644 --- a/NuGet/StaticGraphics/StaticLink.Avalonia.csproj +++ b/NuGet/StaticGraphics/StaticLink.Avalonia.csproj @@ -6,7 +6,7 @@ false false StaticLink.Avalonia - 3.119.2-7151.12 + 3.119.4-7922.1 greepar greepar Static SkiaSharp, HarfBuzzSharp, and ANGLE libraries for Avalonia NativeAOT single-file publishing. @@ -19,7 +19,7 @@ - + diff --git a/README.md b/README.md index af84e2f..5d3a895 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ dotnet add package StaticLink.Avalonia Or add it manually: ```xml - + ``` -`3.119.2-7151.12` supports Avalonia 11. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant: +`3.119.4-7922.1` supports Avalonia 11. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant: ```xml diff --git a/Smoke/AvaloniaStaticLinkSmoke/App.axaml b/Smoke/AvaloniaStaticLinkSmoke/App.axaml new file mode 100644 index 0000000..a3d1b68 --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/App.axaml @@ -0,0 +1,7 @@ + + + + + diff --git a/Smoke/AvaloniaStaticLinkSmoke/App.axaml.cs b/Smoke/AvaloniaStaticLinkSmoke/App.axaml.cs new file mode 100644 index 0000000..d886bd6 --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace AvaloniaStaticLinkSmoke; + +public sealed partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/Smoke/AvaloniaStaticLinkSmoke/AvaloniaStaticLinkSmoke.csproj b/Smoke/AvaloniaStaticLinkSmoke/AvaloniaStaticLinkSmoke.csproj new file mode 100644 index 0000000..d57fc4f --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/AvaloniaStaticLinkSmoke.csproj @@ -0,0 +1,26 @@ + + + + + WinExe + net10.0 + enable + enable + true + true + true + true + true + false + true + 11.3.14 + + + + + + + + + + diff --git a/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml b/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml new file mode 100644 index 0000000..934b673 --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml.cs b/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml.cs new file mode 100644 index 0000000..43167f1 --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace AvaloniaStaticLinkSmoke; + +public sealed partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} diff --git a/Smoke/AvaloniaStaticLinkSmoke/Program.cs b/Smoke/AvaloniaStaticLinkSmoke/Program.cs new file mode 100644 index 0000000..435f50c --- /dev/null +++ b/Smoke/AvaloniaStaticLinkSmoke/Program.cs @@ -0,0 +1,54 @@ +using Avalonia; + +namespace AvaloniaStaticLinkSmoke; + +internal static class Program +{ + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + + public static AppBuilder BuildAvaloniaApp() + { + var builder = AppBuilder.Configure() + .UsePlatformDetect() + .LogToTrace(); + + if (OperatingSystem.IsWindows()) + { + builder = builder.With(new Win32PlatformOptions + { + RenderingMode = + [ + Win32RenderingMode.AngleEgl, + Win32RenderingMode.Software + ] + }); + } + + if (OperatingSystem.IsLinux()) + { + builder = builder.With(new X11PlatformOptions + { + RenderingMode = + [ + X11RenderingMode.Glx, + X11RenderingMode.Software + ] + }); + } + + if (OperatingSystem.IsMacOS()) + { + builder = builder.With(new AvaloniaNativePlatformOptions + { + RenderingMode = + [ + AvaloniaNativeRenderingMode.OpenGl, + AvaloniaNativeRenderingMode.Software + ] + }); + } + + return builder; + } +} diff --git a/scripts/build-linux-static-graphics.sh b/scripts/build-linux-static-graphics.sh index 9a621ca..5ae6b11 100755 --- a/scripts/build-linux-static-graphics.sh +++ b/scripts/build-linux-static-graphics.sh @@ -6,8 +6,8 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}" TARGET_CPU="${TARGET_CPU:-x64}" RID="${RID:-linux-$TARGET_CPU}" OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}" -SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.2}" -ANGLE_BRANCH="${ANGLE_BRANCH:-7151}" +SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}" +ANGLE_BRANCH="${ANGLE_BRANCH:-7922}" BUILD_JOBS="${BUILD_JOBS:-$(nproc)}" ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}" LLVM_AR="${LLVM_AR:-llvm-ar-19}" @@ -20,8 +20,8 @@ Usage: scripts/build-linux-static-graphics.sh [skia|angle|all] Environment: WORK_DIR Source/build cache directory. Default: External/NativeStatic/.work OUTPUT_DIR Final static library directory. Default: External/NativeStatic/linux-$TARGET_CPU - SKIASHARP_VERSION SkiaSharp release branch version. Default: 3.119.2 - ANGLE_BRANCH ANGLE chromium branch. Default: 7151 + SKIASHARP_VERSION SkiaSharp release branch version. Default: 3.119.4 + ANGLE_BRANCH ANGLE chromium branch. Default: 7922 TARGET_CPU GN target_cpu. Default: x64. Supported: x64, arm64 RID Output RID. Default: linux-$TARGET_CPU BUILD_JOBS Ninja parallelism. Default: nproc diff --git a/scripts/build-macos-static-graphics.sh b/scripts/build-macos-static-graphics.sh index fbee727..9676d60 100755 --- a/scripts/build-macos-static-graphics.sh +++ b/scripts/build-macos-static-graphics.sh @@ -6,8 +6,8 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}" TARGET_CPU="${TARGET_CPU:-arm64}" RID="${RID:-osx-$TARGET_CPU}" OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}" -SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.2}" -ANGLE_BRANCH="${ANGLE_BRANCH:-7151}" +SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}" +ANGLE_BRANCH="${ANGLE_BRANCH:-7922}" BUILD_JOBS="${BUILD_JOBS:-$(sysctl -n hw.ncpu)}" ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}" SKIA_DEPS_RETRIES="${SKIA_DEPS_RETRIES:-3}" @@ -112,10 +112,12 @@ build_skia() { cat >"$out_dir/args.gn" <" -} +$escapedNuGetSource = [System.Security.SecurityElement]::Escape($NuGetSource) +$escapedAvaloniaVersion = [System.Security.SecurityElement]::Escape($AvaloniaVersion) +$escapedStaticLinkVersion = [System.Security.SecurityElement]::Escape($StaticLinkVersion) +$escapedStaticLinkNativeVersion = [System.Security.SecurityElement]::Escape($StaticLinkNativeVersion) -$staticLinkReference = "" -if ($StaticLinkVersion) { - $staticLinkReference = "`n " -} +@" + + + $escapedAvaloniaVersion + $escapedStaticLinkVersion + $escapedStaticLinkNativeVersion + + +"@ | Set-Content -Path (Join-Path $ProjectDir "SmokeVersions.props") -Encoding UTF8 @" - + "@ | Set-Content -Path (Join-Path $ProjectDir "NuGet.config") -Encoding UTF8 - -@" - - - WinExe - net10.0 - enable - enable - true - true - true - true - true - false - true - - - - - - $staticLinkReference$nativeReference - - -"@ | Set-Content -Path (Join-Path $ProjectDir "AvaloniaStaticLinkSmoke.csproj") -Encoding UTF8 - -@" -using Avalonia; - -namespace AvaloniaStaticLinkSmoke; - -internal static class Program -{ - [STAThread] - public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); - - public static AppBuilder BuildAvaloniaApp() - { - var builder = AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(); - - if (OperatingSystem.IsMacOS()) - { - builder = builder.With(new AvaloniaNativePlatformOptions - { - RenderingMode = [AvaloniaNativeRenderingMode.Software] - }); - } - - return builder; - } -} -"@ | Set-Content -Path (Join-Path $ProjectDir "Program.cs") -Encoding UTF8 - -@" -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace AvaloniaStaticLinkSmoke; - -public sealed partial class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - desktop.MainWindow = new MainWindow(); - } - - base.OnFrameworkInitializationCompleted(); - } -} -"@ | Set-Content -Path (Join-Path $ProjectDir "App.axaml.cs") -Encoding UTF8 - -@" - - - - - -"@ | Set-Content -Path (Join-Path $ProjectDir "App.axaml") -Encoding UTF8 - -@" -using Avalonia.Controls; - -namespace AvaloniaStaticLinkSmoke; - -public sealed partial class MainWindow : Window -{ - public MainWindow() - { - InitializeComponent(); - } -} -"@ | Set-Content -Path (Join-Path $ProjectDir "MainWindow.axaml.cs") -Encoding UTF8 - -@" - - - - - - - - -"@ | Set-Content -Path (Join-Path $ProjectDir "MainWindow.axaml") -Encoding UTF8