Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scarab crashes on startup #345038

Closed
l0b0 opened this issue Sep 28, 2024 · 4 comments
Closed

Scarab crashes on startup #345038

l0b0 opened this issue Sep 28, 2024 · 4 comments
Labels
0.kind: bug Something is broken

Comments

@l0b0
Copy link
Contributor

l0b0 commented Sep 28, 2024

Describe the bug

Scarab 
[19:14:36 INF] Launching...
[19:14:36 INF] Initializing to normal mode (.cctor)
[19:14:36 FTL] Fatal error in MainWindowViewModel startup!
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Scarab.ViewModels.MainWindowViewModel.Impl()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Scarab.ViewModels.MainWindowViewModel.Impl()
   at Scarab.ViewModels.MainWindowViewModel.OnInitialized() in /build/source/Scarab/ViewModels/MainWindowViewModel.cs:line 302

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install Scarab from current nixos-unstable
  2. Run Scarab within GNOME + Wayland (not tested with any other windowing systems)

Expected behavior

It should not crash.

Notify maintainers

@huantianad There's an upstream PR by you; does that need to be released for Scarab to work?

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.52, NixOS, 24.11 (Vicuna), 24.11pre684846.30439d93eb8b
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.7
  • channels(root): "nixos, nixos-hardware, nixos-stable-24.05"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Add a 👍 reaction to issues you find important.

@l0b0 l0b0 added the 0.kind: bug Something is broken label Sep 28, 2024
@huantianad
Copy link
Contributor

I've bisected the issue to d3ca502, part of #327651. I'll mention @corngood to see if they have any idea why this is the case...

@l0b0 l0b0 mentioned this issue Sep 29, 2024
13 tasks
@huantianad
Copy link
Contributor

Strange, I was just changing projectFile to Scarab/Scarab.csproj instead of Scarab.sln as a part of another change, and I noticed that this change seemed to fix the issue... Can you confirm? Is this actually the root cause or is this somehow fixing it another way? I'm very confused...

@l0b0
Copy link
Contributor Author

l0b0 commented Sep 30, 2024

Strange, I was just changing projectFile to Scarab/Scarab.csproj instead of Scarab.sln as a part of another change, and I noticed that this change seemed to fix the issue... Can you confirm?

Yep, that fixes it. No idea why, but then I'm not a .NET person…

@corngood
Copy link
Contributor

corngood commented Oct 1, 2024

I looked into this a bit. I think the underlying problem is described by:

https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/7.0/solution-level-output-no-longer-valid

Running phase: installPhase
Executing dotnetInstallHook
MSBuild version 17.3.4+a400405ba for .NET
  Scarab -> [...]/out/lib/scarab/
  Scarab.Tests -> [...]/out/lib/scarab/

Both projects are publishing to the same location. Looking at the troublesome dll:

b75730d6c1ef5e0ca6d7f7a1a5ee540aee940836  ./source/Scarab/bin/Release/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
b75730d6c1ef5e0ca6d7f7a1a5ee540aee940836  ./source/Scarab.Tests/bin/Release/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
048893ee3be64754646fb8392cba3b7fc94bedb9  ./nuget.xoJbF3/fallback/microsoft.aspnetcore.app.runtime.linux-x64/6.0.33/runtimes/linux-x64/lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
eb8284af6e36982b07941be818021ba1ebae89d2  ./nuget.xoJbF3/fallback/microsoft.aspnetcore.app.ref/6.0.33/ref/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
453cfc5d9a9cb9c54ec38fef07d7bb3289484c7e  ./nuget.xoJbF3/fallback/coverlet.collector/1.3.0/build/netstandard1.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
9a2952589a19d650932e7c633577eb9afc04f959  ./nuget.xoJbF3/fallback/microsoft.extensions.dependencyinjection.abstractions/7.0.0/lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll
b75730d6c1ef5e0ca6d7f7a1a5ee540aee940836  ./nuget.xoJbF3/fallback/microsoft.extensions.dependencyinjection.abstractions/7.0.0/lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
8880eb2a9d3ba942ae476c0fda723a5e2a0f1e0b  ./nuget.xoJbF3/fallback/microsoft.extensions.dependencyinjection.abstractions/7.0.0/lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
5b5d234578bc0527373894a360a92cc3756bdae2  ./nuget.xoJbF3/fallback/microsoft.extensions.dependencyinjection.abstractions/7.0.0/lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
20c735abc2a391bd2010d3b134e59a5ced8343d8  ./nuget.xoJbF3/fallback/microsoft.extensions.dependencyinjection.abstractions/7.0.0/lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll
453cfc5d9a9cb9c54ec38fef07d7bb3289484c7e  ./out/lib/scarab/Microsoft.Extensions.DependencyInjection.Abstractions.dll

The one that ends up in $out is the one from 'coverlet.collector', but there's likely some non-deterministic aspect to it.

I think this is probably the way to go:

diff --git a/pkgs/tools/games/scarab/default.nix b/pkgs/tools/games/scarab/default.nix
index 25ac92691e89..fdf70a7fff4e 100644
--- a/pkgs/tools/games/scarab/default.nix
+++ b/pkgs/tools/games/scarab/default.nix
@@ -22,7 +22,8 @@ buildDotnetModule rec {
   };
 
   nugetDeps = ./deps.nix;
-  projectFile = "Scarab.sln";
+  projectFile = "Scarab/Scarab.csproj";
+  testProjectFile = "Scarab.Tests/Scarab.Tests.csproj";
   executables = [ "Scarab" ];
 
   preConfigureNuGet = ''
@@ -47,6 +48,8 @@ buildDotnetModule rec {
     wrapGAppsHook3
   ];
 
+  doCheck = true;
+
   postFixup = ''
     # Icons for the desktop file
     icotool -x $src/Scarab/Assets/omegamaggotprime.ico

Tests are currently being built and published, but never run. This will run them but not publish them.

huantianad added a commit to huantianad/nixpkgs that referenced this issue Oct 3, 2024
By using testProjectFile, we can properly build the test and run it in
checkPhase, as well as not include the test in the derivation output.

This also happens to fix the startup crash as described in NixOS#345038.
@corngood corngood closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants