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

mesen: init at 2.0.0-unstable-2024-09-15 #301666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TomaSajt
Copy link
Contributor

@TomaSajt TomaSajt commented Apr 4, 2024

Description of changes

Closes #301132

Core build time is ~10mins for me.

I only tested SMB for the NES.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@keenanweaver
Copy link
Member

Result of nixpkgs-review pr 301666 run on x86_64-linux 1

1 package built:
  • mesen

Copy link
Member

@keenanweaver keenanweaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building perfectly (albeit a long one as noted). All functionality is working (Saving demos, netplay, debugging tools, etc. What a cool emulator!) Only quirk I've noticed is the 'build date' on the about screen being Jan 1 1980, but not a big deal.

@keenanweaver
Copy link
Member

Could this be eligible for the unstable updater? https:/NixOS/nixpkgs/blob/master/pkgs/common-updater/unstable-updater.nix

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Jun 3, 2024

Could this be eligible for the unstable updater? https:/NixOS/nixpkgs/blob/master/pkgs/common-updater/unstable-updater.nix

Probably not, since this package needs a generated deps.nix file for dotnet packages.

@AtomicTroop
Copy link

What's currently pending for this one? I could definitely use this package for NES debugging, so if there's anything I can help with to move this forwards, please let me know.

@FlafyDev
Copy link
Contributor

FlafyDev commented Sep 3, 2024

I'm getting this error

❯ nix run github:TomaSajt/nixpkgs/mesen2#mesen
error: builder for '/nix/store/kjwrck5dfaig3bvnxqgw8qxqzm9yami5-mesen-2.0.0-unstable-2024-06-01.drv' failed with exit code 1;
       last 10 log lines:
       > patching file UI/Config/ConfigManager.cs
       > patching file UI/Program.cs
       > patching file UI/UI.csproj
       > Running phase: configureNuget
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Executing dotnetConfigureHook
       >   Determining projects to restore...
       > /build/source/UI/UI.csproj : error NU1301: Unable to load the service index for source https://nuget-feed-nightly.avaloniaui.net/v3/index.json.
       >   Failed to restore /build/source/UI/UI.csproj (in 5.5 sec).
       For full logs, run 'nix log /nix/store/kjwrck5dfaig3bvnxqgw8qxqzm9yami5-mesen-2.0.0-unstable-2024-06-01.drv'.

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Sep 3, 2024

I'm getting this error

❯ nix run github:TomaSajt/nixpkgs/mesen2#mesen
error: builder for '/nix/store/kjwrck5dfaig3bvnxqgw8qxqzm9yami5-mesen-2.0.0-unstable-2024-06-01.drv' failed with exit code 1;
       last 10 log lines:
       > patching file UI/Config/ConfigManager.cs
       > patching file UI/Program.cs
       > patching file UI/UI.csproj
       > Running phase: configureNuget
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Executing dotnetConfigureHook
       >   Determining projects to restore...
       > /build/source/UI/UI.csproj : error NU1301: Unable to load the service index for source https://nuget-feed-nightly.avaloniaui.net/v3/index.json.
       >   Failed to restore /build/source/UI/UI.csproj (in 5.5 sec).
       For full logs, run 'nix log /nix/store/kjwrck5dfaig3bvnxqgw8qxqzm9yami5-mesen-2.0.0-unstable-2024-06-01.drv'.

Yes, sorry about that, I should have probably put the PR into draft.

I'm still working on updating to the latest version but I'm having some issues. I'll try to fix this current one for now.
I'll be away this week but I'll try to do what I can.

@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-04-03 mesen: init at 2.0.0-unstable-2024-06-01 Sep 3, 2024
@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-06-01 mesen: init at 2.0.0-unstable-2024-07-27 Sep 3, 2024
@TomaSajt
Copy link
Contributor Author

TomaSajt commented Sep 3, 2024

Updated to the latest commit before update to Avalonia 11.1, which breaks the build (duplicate asset errors and elements just not compiling). I have no idea how to use Avalonia or why it broke, so this is as far as I could go for now.

@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-07-27 mesen: init at 2.0.0-unstable-2024-09-15 Sep 18, 2024
@TomaSajt
Copy link
Contributor Author

Now that #340493 is fixed I could update to a later commit more easily.

@FavoritoHJS
Copy link
Contributor

FavoritoHJS commented Oct 14, 2024

I'm getting a problem when starting up the program, and i don't know where else to ask...

When trying to start the program, the following gets printed out and the program crashes:

Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: /Assets/NesIcon.png
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](List`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at Avalonia.Platform.Internal.AssemblyDescriptor..ctor(Assembly assembly)
   at Avalonia.Platform.StandardAssetLoader..ctor(IAssemblyDescriptorResolver resolver, Assembly assembly)
   at Avalonia.Platform.StandardAssetLoader..ctor(Assembly assembly)
   at Avalonia.Platform.StandardRuntimePlatformServices.Register(Assembly assembly)
   at Avalonia.AppBuilder.<UseStandardRuntimePlatformSubsystem>b__68_0()
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at Mesen.Program.Main(String[] args) in /build/source/UI/Program.cs:line 58
Aborted (core dumped)

I really need this to work as this is the only program pvsneslib supports for its debug files...

EDIT: I'm using the following to enter a nix shell with Mesen on the path:

{pkgs ? import <nixpkgs>{}, ...}:
let
mesen = pkgs.callPackage ./mesen.nix {};
in
pkgs.mkShell{
  packages = [mesen];
}

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Oct 14, 2024

I'm getting a problem when starting up the program, and i don't know where else to ask...

When trying to start the program, the following gets printed out and the program crashes:

Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: /Assets/NesIcon.png
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](List`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at Avalonia.Platform.Internal.AssemblyDescriptor..ctor(Assembly assembly)
   at Avalonia.Platform.StandardAssetLoader..ctor(IAssemblyDescriptorResolver resolver, Assembly assembly)
   at Avalonia.Platform.StandardAssetLoader..ctor(Assembly assembly)
   at Avalonia.Platform.StandardRuntimePlatformServices.Register(Assembly assembly)
   at Avalonia.AppBuilder.<UseStandardRuntimePlatformSubsystem>b__68_0()
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at Mesen.Program.Main(String[] args) in /build/source/UI/Program.cs:line 58
Aborted (core dumped)

I really need this to work as this is the only program pvsneslib supports for its debug files...

EDIT: I'm using the following to enter a nix shell with Mesen on the path:

{pkgs ? import <nixpkgs>{}, ...}:
let
mesen = pkgs.callPackage ./mesen.nix {};
in
pkgs.mkShell{
  packages = [mesen];
}

You shouldn't be using your own <nixpkgs>, since it's missing crucial fixes for the AvaloniaUI ecosystem.

I advise you update your <nixpkgs> channel to a more recent version
or that you replace the <nixpkgs> expression with (builtins.fetchTarball { url = "https:/TomaSajt/nixpkgs/archive/mesen2.tar.gz"; sha256 = ""; })

This way you can even just write pkgs.mesen instead of using callPackage with a copy of the .nix file

Or if you don't need it in a shell.nix file, you could just do

nix-shell -I nixpkgs=https:/TomaSajt/nixpkgs/archive/mesen2.tar.gz -p mesen

@FavoritoHJS
Copy link
Contributor

that fixed it! thank you

@FliegendeWurst
Copy link
Member

Doesn't build for me:

Executing dotnetConfigureHook
  Determining projects to restore...
/build/source/UI/UI.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Host.win-x64 with version (= 8.0.10)
/build/source/UI/UI.csproj : error NU1102:   - Found 1 version(s) in _nix [ Nearest version: 8.0.8 ]
  Failed to restore /build/source/UI/UI.csproj (in 254 ms).

@TomaSajt
Copy link
Contributor Author

Doesn't build for me:

Executing dotnetConfigureHook
  Determining projects to restore...
/build/source/UI/UI.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Host.win-x64 with version (= 8.0.10)
/build/source/UI/UI.csproj : error NU1102:   - Found 1 version(s) in _nix [ Nearest version: 8.0.8 ]
  Failed to restore /build/source/UI/UI.csproj (in 254 ms).

@corngood could you help with this? I'm not exactly sure how these AppHost things work...

@corngood
Copy link
Contributor

Result of nixpkgs-review pr 301666 run on x86_64-linux 1

1 package failed to build:
  • mesen

@corngood
Copy link
Contributor

@corngood could you help with this? I'm not exactly sure how these AppHost things work...

I think you just need:

diff --git a/pkgs/by-name/me/mesen/package.nix b/pkgs/by-name/me/mesen/package.nix
index a5fd5a47f1a2..bc8d722799c3 100644
--- a/pkgs/by-name/me/mesen/package.nix
+++ b/pkgs/by-name/me/mesen/package.nix
@@ -37,6 +37,10 @@ buildDotnetModule rec {
 
   projectFile = [ "UI/UI.csproj" ];
 
+  dotnetFlags = [
+    "-p:RuntimeIdentifier=${dotnetCorePackages.systemToDotnetRid clangStdenv.hostPlatform.system}"
+  ];
+
   executables = [ "Mesen" ];
 
   nugetDeps = ./deps.nix;

To stop it from overriding the RID to windows. That's a property they set in their makefile. You should then re-run fetch-deps, which should remove Microsoft.NETCore.App.Host.win-x64 from the lock file.

@TomaSajt TomaSajt force-pushed the mesen2 branch 2 times, most recently from 5b0562f to 2b20bdb Compare October 17, 2024 22:20
@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-09-15 mesen: init at 2.0.0-unstable-2024-10-17 Oct 17, 2024
@keenanweaver
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 301666


x86_64-linux

✅ 1 package built:
  • mesen

@TomaSajt
Copy link
Contributor Author

Seems like updating broke the non x86-64-linux builds. Will look into it

@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-10-17 mesen: init at 2.0.0-unstable-2024-09-15 Oct 19, 2024
@TomaSajt
Copy link
Contributor Author

Reverted to the working version, for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: mesen
9 participants