Fix running Spice86 with the UI (in non-headless mode) on Linux - #2281
Merged
maximilien-noal merged 1 commit intoJul 30, 2026
Merged
Conversation
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.
Member
|
@xorangekiller sorry about that ! I'm glad you found a fix. It's probably the skiasharp v4 update commit that broke it. |
maximilien-noal
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At some point the Spice86 UI stopped working on Linux. Games would still ran in headless mode (with
--HeadlessMode Minimalin 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.