retroArchCores: remove, retroarchFull: init, retroarch: use fixed paths on "libretro_info_path"#146714
retroArchCores: remove, retroarchFull: init, retroarch: use fixed paths on "libretro_info_path"#146714thiagokokada merged 6 commits intoNixOS:masterfrom thiagokokada:remove-retroArchCores
Conversation
|
Maybe this needs an entry on release notes 🤔 ? |
|
CC @aanderse. BTW, this doesn't invalidate the need of |
There was a problem hiding this comment.
Needed to remove the assertion since it would evaluate the assertion before the override occurs.
But I tested and this works fine too:
(kodi-retroarch-advanced-launchers.override {
cores = with pkgs.libretro; [
snes9x
desmume
];
})|
I'm not sure about this. If I run |
No because when the path doesn't exist RetroArch will update the config with defaults (that is now up-to-date). Of course, not ideal, but works 🤷♂️ . BTW, this is not related to this PR right 🤔 ? |
Ah, sorry. I missed that part. So... should we be consistent and do |
Yes! |
I mean, we could, but I still prefer the module because the situation is not ideal (for example, if I added/remove a core, until I trigger the GC this will reflect the old cores from the old derivation). However, this is orthogonal with this PR. Even with the Now, adding So my proposal is to use |
BTW, I want to eventually solve this problem, however I am trying to ask upstream for help so we don't need to patch too much. See issue libretro/RetroArch#13251 for details. Even if a better solution for the core issue came afterwards, I still think that having a module is worth it. With it, we can allow folks to fully customize RetroArch (for example, this would make NixOS a good replacement for RetroPie). Does this make sense @aanderse ? If you want, feel free to ask me more details on Matrix. |
pkgs/top-level/all-packages.nix
Outdated
There was a problem hiding this comment.
I just discovered that this one didn't even work (the correct name is thepowedertoy).
Done. Also added a release notes entry about the recent RetroArch bump. |
|
Result of 1 package blacklisted:
1 package failed to build:
2 packages built:
|
|
@aanderse Can I have your review? |
With commit WDYT @aanderse ? I think this solves most of the issues. I can also split this in another PR if you want. |
`retroArchCores` is strange: it requires a global configuration on nixpkgs, as:
```nix
nixpkgs.config.retroarch = {
enableDolphin = true;
enableMGBA = true;
enableMAME = true;
};
```
To do so, we ended up declaring all available emulators on
`all-packages.nix`. Failing to do so would mean that the emulator
wouldn't be available.
However, there is a mechanism on nixpkgs that also works: overrides.
Overrides are similar on how other packages works, for example:
```nix
(retroarch.override { cores = with libretro; [ citra snes9x ]; });
```
So let's remove `retroArchCores` and leave the overrides mechanism
instead.
This is retroarch + all available retroarch cores.
aanderse
left a comment
There was a problem hiding this comment.
This looks great! It all makes sense to me, and the release notes cover everything we need to. Thanks for doing all of this 🙇
Nice. I will just test this on macOS since I need to patch one more place to make it work. |
This commit introduces a patch that hardcodes "libretro_info_path" directly in the RetroArch code, without the issues of the previous approach. With this commit, RetroArch stops reading "libretro_info_path" from `retroarch.cfg` file, and always use the default.
With those changes retroarch builds on Darwin, but the executable itself is broken.
|
@aanderse Sorry for bothering you, but can you do one last review with the Darwin changes? |
| maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ]; | ||
| # FIXME: exits with error on macOS: | ||
| # No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting | ||
| broken = stdenv.isDarwin; |
There was a problem hiding this comment.
I just saw a ton of people volunteer to support OSX recently. I wonder if we could find some volunteers after we merge this?
There was a problem hiding this comment.
Yeah, this is my idea.
BTW, it is already broken on master, because Wayland is Linux-only (so it propagates its broken state).
There was a problem hiding this comment.
On master:
$ nix-build -A retroarch
error: Package ‘wayland-1.19.0’ in /Users/thiagoko/Projects/nixpkgs/pkgs/development/libraries/wayland/default.nix:107 is marked as broken, refusing to evaluate.
a) To temporarily allow broken packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_BROKEN=1
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
|
No bother at all. Looks good to me 👍 |
Nice, I will do one last build to make sure everything is fine and merge them. |
|
Great. Thanks again! I'll try to create a maintainers team PR this weekend. I'm really loving to |
|
|
||
| # If disabled, will hide the ability to update cores (and core info files) inside the menu. | ||
| -# menu_show_core_updater = true | ||
| +menu_show_core_updater = false |
There was a problem hiding this comment.
Does this disable manually installed cores too? I don’t know if anyone actually does this but I thought in the past you could imperitively install cores in the UI. If this can be enabled manually in the UI that would be alright.
There was a problem hiding this comment.
No, it just disable the UI to download new cores, that didn't work anyway since it doesn't connect to the RetroArch core servers (it would just show the cores that you already have installed). I don't know if this used to work, but at least the situation from version 1.8.5 (the version that was on master before I started updating and refactor everything) was already like this.
You can still re-enable this manually though, and this is respected on the next boot. But it will be useless.
There was a problem hiding this comment.
BTW, even if this used to work I don't think download would do anything.
First because this is NixOS, and thanks to this a core downloaded from RetroArch servers would probably just segfault (each core is a .so file and are dynamically linked, however since NixOS has no FHS it wouldn't find the necessary libraries).
Second because even before this PR, libretro_directory was already set to a path on /nix/store, that is read-only, so it would fail to write the core there. I am just setting libretro_directory directly in the code for consistency, but it was already the default.
| - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path, | ||
| - "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE])); | ||
| + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], "@libretro_directory@", | ||
| + "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE])); |
There was a problem hiding this comment.
Could we set the DEFAULT_DIR_CORE constant instead? If I understand this, it is assuming the default is unset?
There was a problem hiding this comment.
No, this is just a enum. This is exactly the part of the code that sets the g_defaults global (that stores the default values) to the default.
I tried to set it before but got either a compilation failure or segfault (don't remember exactly).
|
@matthewbauer Any other issue? Can I go and merge this (still building everything, but the only core that remains are MAME and should finish soon). |
MAME since 0.225 have a fix for the build issues while building in parallel. Since libretro.mame is on 0.227 right now, should be safe to enable. Since eventually enableParallelBuilding should be the default, enabling it for all cores except the older MAMEs seems better than just enabling for libretro.mame.
|
Saw this PR that should be included from MAME 0.225 and above (we use 0.227 currently), so I think it is safe to enable parallel building in everything, except for older MAME cores: mamedev/mame#7279. Restart my build from zero (hope this is faster though, building the latest version of MAME in special is very slow without parallel building). |
Seems like it was a good idea, it build much faster: Result of 1 package failed to build:
82 packages built:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
retroArchCoresis strange: it requires a global configuration on nixpkgs, as:To do so, we ended up declaring all available emulators on
all-packages.nix. Failing to do so would mean that the emulator wouldn't be available.However, there is a mechanism on nixpkgs that also works: overrides. Overrides are similar on how other packages works, for example:
So let's remove
retroArchCoresand leave the overrides mechanism instead.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes