From 8f22be283c9dc69693a254bde73fd899ca07462f Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Sun, 15 Sep 2024 23:52:48 -0400 Subject: [PATCH 1/2] fix: Adjust VS build --- .../src/SkiaSharpTools.Initializer.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs index 1214a01..61fc5a0 100644 --- a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs +++ b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs @@ -36,6 +36,31 @@ public static void Initialize() { SetupResolver(); } + else + { + SetupWindows(); + } + } + } + + /// + /// Load libraries explicitly on Windows, as search paths may not be available when + /// running inside VS msbuild nodes. + /// + private static void SetupWindows() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + foreach (var runtimePath in GetRuntimesFolder()) + { + if (Directory.Exists(runtimePath)) + { + foreach (var file in Directory.GetFiles(runtimePath, "*.dll")) + { + var r = LoadLibrary(file); + } + } + } } } @@ -184,6 +209,10 @@ IntPtr localDlOpen(string fileName) [DllImport("libSystem.dylib", EntryPoint = "dlopen")] public static extern IntPtr dlopen_macos(string fileName, int flags); + // Declare dllimport for loadlibrary + [DllImport("kernel32.dll", SetLastError = true)] + public static extern IntPtr LoadLibrary(string lpFileName); + // Imported from https://github.com/mono/SkiaSharp/blob/482e6ee2913a08a7cad76520ccf5fbce97c7c23b/binding/Binding.Shared/LibraryLoader.cs private static class Linux { From 9b869b0e5ae676f5cad3bd3a2a570432fe68bcaf Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Mon, 16 Sep 2024 00:20:45 -0400 Subject: [PATCH 2/2] ci: Add dummy required check --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebad678..f410f39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,6 +252,20 @@ jobs: name: logs_5_1 path: .\logs + # This step is only used to add a required check for the PR + Validation_Check: + name: Validation Check + runs-on: windows-latest + needs: + - build_tool + - validation_5_1 + - validation_5_2_win + - validation_5_2_nix + + steps: + - name: Checkout + uses: actions/checkout@v4 + sign: name: Sign if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}