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

retroarch: Remove --menu from wrapper #51935

Merged
merged 1 commit into from Dec 18, 2018
Merged

Conversation

neonfuz
Copy link
Contributor

@neonfuz neonfuz commented Dec 13, 2018

Motivation for this change

Retroarch already opens a menu without needing --menu to be passed to it, and explicitly passing it means you cannot later override it. This means in nixos, passing -L to retroarch to specify a specific core is broken. Removing --menu makes the default behavior the same but fixes -L.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@neonfuz
Copy link
Contributor Author

neonfuz commented Dec 13, 2018

By the way, I didn't write the wrapper or anything, and don't know if it's there for some other reason. My guess is it was there for an earlier version of retroarch, or just because the author didn't know explicitly passing it was bad.

@@ -27,7 +27,7 @@ stdenv.mkDerivation {

makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
--suffix-each LD_LIBRARY_PATH ':' "$cores" \
--add-flags "-L $out/lib/ --menu" \
--add-flags "-L $out/lib/" \
Copy link
Member

Choose a reason for hiding this comment

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

cc @edwtjo

@neonfuz
Copy link
Contributor Author

neonfuz commented Dec 13, 2018

Also just in general, I don't think this wrapper is currently doing much. First, it adds each core to the LD_LIBRARY_PATH, which I'm not sure retroarch actually uses, and then passes the directory of cores to retroarch with -L, which in older versions of retroarch (<1.0) was used to override the core directory, but has been silently broken and deprecated since (they broke the functionality then removed it from the documentation). So in short, this wrapper builds specified cores, but doesn't actually pass them to retroarch in any meaningful way. I don't think removing the wrapper altogether is the right answer though, declarative building of cores is definitely the proper nixos way.

For a user wanting to use the nix built cores, a naive workaround would be to manually configure retroarch to point to /nix/store/<hash>-retroarch/lib, but then you need to update your config on each retroarch update. A slightly better approach for nix-env users could be pointing to the core directory in ~/.nix-profile/, but because the wrapper puts cores in /lib, they end up in .nix-profile/lib along with a ton of other shared libraries. This doesn't really make much sense, most other distros put it in a different directory like /usr/lib/retroarch, a much better directory choice might be /lib/libretro or /lib/retroarch. This way all the cores would end up in an isolated folder when merged into .nix-profile.

This feature (-L for core directory) was originally broken when they partially rewrote some related code, but remnants of the code for the feature still exist. I have also checked the code for what should happen when a directory is passed to -L, and currently it's a harmless no-op. So I think the best course of action is to continue passing -L as we are and attempt to fix this upstream.

@Mic92 Mic92 merged commit 6b69a8c into NixOS:master Dec 18, 2018
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.

None yet

3 participants