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-12-25 #301666

Merged
merged 1 commit into from
Jan 2, 2025
Merged

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.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Apr 5, 2024
@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels May 22, 2024
@keenanweaver
Copy link
Member

Could this be eligible for the unstable updater? https://github.com/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://github.com/NixOS/nixpkgs/blob/master/pkgs/common-updater/unstable-updater.nix

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

@wegank wegank removed the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Jun 20, 2024
@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 force-pushed the mesen2 branch 2 times, most recently from 6661b6f to 0056e06 Compare September 18, 2024 16:26
@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.

@FliegendeWurst
Copy link
Member

ofborg build failed on aarch64-linux

       > /nix/store/nrg6lg8ihkav4g129q37h4h7bminng0d-dotnet-sdk-8.0.403/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3021: Unable to copy file "/build/nuget.uWn0cQ/fallback/system.reactive/6.0.0/lib/net6.0/System.Reactive.dll" to "/bin/linux-arm64/Release/System.Reactive.dll". Access to the path '/bin/linux-arm64' is denied. [/build/source/UI/UI.csproj]
       > /nix/store/nrg6lg8ihkav4g129q37h4h7bminng0d-dotnet-sdk-8.0.403/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3021: Unable to copy file "/build/nuget.uWn0cQ/fallback/tmds.dbus.protocol/0.16.0/lib/net6.0/Tmds.DBus.Protocol.dll" to "/bin/linux-arm64/Release/Tmds.DBus.Protocol.dll". Access to the path '/bin/linux-arm64' is denied. [/build/source/UI/UI.csproj]
       > /nix/store/nrg6lg8ihkav4g129q37h4h7bminng0d-dotnet-sdk-8.0.403/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3021: Unable to copy file "/build/nuget.uWn0cQ/fallback/system.io.pipelines/6.0.0/lib/net6.0/System.IO.Pipelines.dll" to "/bin/linux-arm64/Release/System.IO.Pipelines.dll". Access to the path '/bin/linux-arm64' is denied. [/build/source/UI/UI.csproj]
       > /nix/store/nrg6lg8ihkav4g129q37h4h7bminng0d-dotnet-sdk-8.0.403/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3021: Unable to copy file "/build/nuget.uWn0cQ/fallback/harfbuzzsharp.nativeassets.linux/7.3.0.2/runtimes/linux-arm64/native/libHarfBuzzSharp.so" to "/bin/linux-arm64/Release/libHarfBuzzSharp.so". Access to the path '/bin/linux-arm64' is denied. [/build/source/UI/UI.csproj]
       > /nix/store/nrg6lg8ihkav4g129q37h4h7bminng0d-dotnet-sdk-8.0.403/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3021: Unable to copy file "/build/nuget.uWn0cQ/fallback/skiasharp.nativeassets.linux/2.88.8/runtimes/linux-arm64/native/libSkiaSharp.so" to "/bin/linux-arm64/Release/libSkiaSharp.so". Access to the path '/bin/linux-arm64' is denied. [/build/source/UI/UI.csproj]
       >     1 Warning(s)
       >     43 Error(s)
       >
       > Time Elapsed 00:00:39.23

@TomaSajt TomaSajt force-pushed the mesen2 branch 2 times, most recently from d14f1f6 to 54e5a1b Compare December 31, 2024 22:07
@TomaSajt
Copy link
Contributor Author

Rebased, updated to use deps.json and added aarch64-linux to meta.badPlatforms

@keenanweaver
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 301666


x86_64-linux

✅ 1 package built:
  • mesen

@keenanweaver keenanweaver added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 31, 2024
@TomaSajt TomaSajt force-pushed the mesen2 branch 3 times, most recently from 453c5aa to 74e4b12 Compare January 1, 2025 00:18
@TomaSajt TomaSajt changed the title mesen: init at 2.0.0-unstable-2024-09-15 mesen: init at 2.0.0-unstable-2024-12-25 Jan 1, 2025
@TomaSajt TomaSajt closed this Jan 1, 2025
@TomaSajt TomaSajt reopened this Jan 1, 2025
@FliegendeWurst
Copy link
Member

To make the package ready for strictDeps: #178468

diff --git a/pkgs/by-name/me/mesen/package.nix b/pkgs/by-name/me/mesen/package.nix
index a714e5e6deea..479a9aed032d 100644
--- a/pkgs/by-name/me/mesen/package.nix
+++ b/pkgs/by-name/me/mesen/package.nix
@@ -28,6 +28,11 @@ buildDotnetModule rec {
     ./dont-zip-libraries.patch
   ];
 
+  postPatch = ''
+    substituteInPlace makefile \
+      --replace-fail 'sdl2-config' '${lib.getExe' (lib.getDev SDL2) "sdl2-config"}'
+  '';
+
   dotnet-sdk = dotnetCorePackages.sdk_8_0;
   dotnet-runtime = dotnetCorePackages.runtime_8_0;
 
@@ -52,7 +57,7 @@ buildDotnetModule rec {
   # according to upstream, compiling with clang creates a faster binary
   passthru.core = clangStdenv.mkDerivation {
     pname = "mesen-core";
-    inherit version src;
+    inherit version src patches postPatch;
 
     enableParallelBuilding = true;

You can add strictDeps = true in the core derivation if you want.

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Jan 1, 2025

To make the package ready for strictDeps: #178468

diff --git a/pkgs/by-name/me/mesen/package.nix b/pkgs/by-name/me/mesen/package.nix
index a714e5e6deea..479a9aed032d 100644
--- a/pkgs/by-name/me/mesen/package.nix
+++ b/pkgs/by-name/me/mesen/package.nix
@@ -28,6 +28,11 @@ buildDotnetModule rec {
     ./dont-zip-libraries.patch
   ];
 
+  postPatch = ''
+    substituteInPlace makefile \
+      --replace-fail 'sdl2-config' '${lib.getExe' (lib.getDev SDL2) "sdl2-config"}'
+  '';
+
   dotnet-sdk = dotnetCorePackages.sdk_8_0;
   dotnet-runtime = dotnetCorePackages.runtime_8_0;
 
@@ -52,7 +57,7 @@ buildDotnetModule rec {
   # according to upstream, compiling with clang creates a faster binary
   passthru.core = clangStdenv.mkDerivation {
     pname = "mesen-core";
-    inherit version src;
+    inherit version src patches postPatch;
 
     enableParallelBuilding = true;

You can add strictDeps = true in the core derivation if you want.

Is it not enough to just add SDL2 to nativeBuildInputs too?

@FliegendeWurst
Copy link
Member

I am not sure that SDL2 would give you the correct sdl2-config --libs when cross-compiling. (Though this package can't really be cross-compiled anyway.)

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 1, 2025
@corngood
Copy link
Contributor

corngood commented Jan 2, 2025

@ofborg build mesen

@TomaSajt are you okay with this getting merged as-is?

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Jan 2, 2025

Yes, it's fine I think

@corngood corngood added the backport release-24.11 Backport PR automatically label Jan 2, 2025
@corngood corngood merged commit 14f4013 into NixOS:master Jan 2, 2025
32 of 33 checks passed
@nixpkgs-ci
Copy link

nixpkgs-ci bot commented Jan 2, 2025

Successfully created backport PR for release-24.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: mesen
9 participants