From 00438bc1eac9776c7625ab0deeea52a7dd2b2510 Mon Sep 17 00:00:00 2001 From: Karl Lenz Date: Wed, 29 Jul 2026 20:07:04 -0400 Subject: [PATCH] Fix running Spice86 with the UI (in non-headless mode) on Linux At some point the Spice86 UI stopped working on Linux. Games would still ran in headless mode (with `--HeadlessMode Minimal` in the command line arguments), but not by default with the main interface (or with `--HeadlessMode Avalonia`, which is the default). Instead the SkiaSharp library threw an exception that indicated that a different version of the native Skia library was present on the system than the one supported by the version of SkiaSharp that Spice86 was compiled with. After digging into it, I discovered that SkiaSharp depends on SkiaSharp.NativeAssets.Win32 and SkiaSharp.NativeAssets.macOS to ensure that they are always the correct versions for Windows and macOS, but it does no such thing for Linux. I added SkiaSharp.NativeAssets.Linux explicitly to the Spice86 dependencies (since it isn't implicitly pulled in as a transitive dependency of SkiaSharp like the Windows and macOS versions are), rebuilt, and that fixed the issue. I can now run Spice86 again with the full UI on Linux. The unit tests didn't catch this bug because Spice86 still compiled on Linux. It just didn't run with the UI. The unit tests don't try to run it with the UI either. They run it in minimal mode with no UI - which makes sense. This was just a gap in the test coverage that happened to regress. I thought about how to introduce tests for it, but I think that would require integration tests, not just unit tests, and that it's not worth it for this fix. It's easier to just add the new dependency. It's unlikely that it will regress again in this way in the future now that it's there. I'm sure that there's a specific commit that introduced this regression since I used to be able to run Spice86 on Linux, but I don't know what it was. Ideally I should have tracked it down and referenced it in this commit, but it was easier to just fix it than to bisect, so I didn't. --- src/Directory.Packages.props | 1 + src/Spice86.Core/Spice86.Core.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 3cb4758614..d81fab071d 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -52,6 +52,7 @@ + diff --git a/src/Spice86.Core/Spice86.Core.csproj b/src/Spice86.Core/Spice86.Core.csproj index cf67ab809e..8e5ba252e9 100644 --- a/src/Spice86.Core/Spice86.Core.csproj +++ b/src/Spice86.Core/Spice86.Core.csproj @@ -35,6 +35,7 @@ +