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

lutris: init at 0.4.18 #42075

Closed
wants to merge 11 commits into from
Closed

lutris: init at 0.4.18 #42075

wants to merge 11 commits into from

Conversation

Chiiruno
Copy link
Contributor

@Chiiruno Chiiruno commented Jun 15, 2018

Motivation for this change

Steam-like program for keeping games in order and easily accessible.

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/)
  • Fits CONTRIBUTING.md.

@Chiiruno
Copy link
Contributor Author

nix-shell -p nox --run "nox-review wip" errored, however the error was an osquery test, Lutris itself seems to work fine, aside from this issue when using online functions I'm not sure how to resolve:

Traceback (most recent call last):
  File "/nix/store/6864ay4b9skqskzi4sszbyx8pycwy4pk-lutris-v0.4.18/lib/python3.6/site-packages/lutris/gui/lutriswindow.py", line 169, in <lambda>
    lambda *x: open_uri('https://lutris.net/user/register/')
  File "/nix/store/6864ay4b9skqskzi4sszbyx8pycwy4pk-lutris-v0.4.18/lib/python3.6/site-packages/lutris/util/system.py", line 387, in open_uri
    Gtk.show_uri(None, uri, Gdk.CURRENT_TIME)
GLib.Error: g-io-error-quark: Operation not supported (15)

@Chiiruno Chiiruno mentioned this pull request Jun 15, 2018
8 tasks
Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

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

LGTM!

@lukateras
Copy link
Member

This should work for the most part, although native Steam client won't be accessible.

@lukateras
Copy link
Member

Oh, have you tested if external emulators (say, SNES9x) installed either in user or system profile work?

@bkchr
Copy link
Contributor

bkchr commented Jun 15, 2018

Any plan to maybe integrate a patch, that calls patchelf on dowloaded wine installations?

@lukateras
Copy link
Member

lukateras commented Jun 15, 2018

There's no need, because it runs in a FHS environment that tolerates ELF headers of downloaded Wine installations.

@bkchr
Copy link
Contributor

bkchr commented Jun 15, 2018

Ahh! Nice! I did not saw that, then it is really nice :)

@Chiiruno
Copy link
Contributor Author

The native steam client should be possible by adding steam-runtime-native to the FHS environment IIRC.
I can't tell one way or another if the external emulators work, I do know they download and I can log in, but adding any games to the menu is either impossible or impossible to show, there are no error messages, just no action.

Sorry, I guess I pushed a somewhat broken commit in my excitement.

@Chiiruno
Copy link
Contributor Author

Again, a lot of the trouble probably stems from this:

Traceback (most recent call last):
  File "/nix/store/6864ay4b9skqskzi4sszbyx8pycwy4pk-lutris-v0.4.18/lib/python3.6/site-packages/lutris/gui/lutriswindow.py", line 169, in <lambda>
    lambda *x: open_uri('https://lutris.net/user/register/')
  File "/nix/store/6864ay4b9skqskzi4sszbyx8pycwy4pk-lutris-v0.4.18/lib/python3.6/site-packages/lutris/util/system.py", line 387, in open_uri
    Gtk.show_uri(None, uri, Gdk.CURRENT_TIME)
GLib.Error: g-io-error-quark: Operation not supported (15)

@Chiiruno
Copy link
Contributor Author

Oh wait hang on, after restarting the program a lot of my games show up, will test.

@Chiiruno
Copy link
Contributor Author

Okay, will probably have to pull dependencies like X.

@tenten8401
Copy link

It seems regardless of distro, Lutris needs a restart for my games to properly show up, at least when syncing from the lutris website. I don't think that's related to anything you've done.

@tenten8401
Copy link

tenten8401 commented Jun 15, 2018

Getting a fun error over here when attempting to install Battlefield 1 using the Wine runner.
image

Looks like we probably need an shasum utilitiy in order for the verification of downloaded files.

@Chiiruno
Copy link
Contributor Author

This is a big project with a lot of "unknown" dependencies.
Please report all bugs and I'll attempt to fix them.
Will continue until I get everything (at least on the surface) working.

@Chiiruno
Copy link
Contributor Author

@tenten8401 Could you give more detail about that error please?
Does something need to be added into the target packages?

@tenten8401
Copy link

tenten8401 commented Jun 15, 2018 via email

@Chiiruno
Copy link
Contributor Author

What package is sha1sum part of? Isn't it bin or coreutils?

@tenten8401
Copy link

tenten8401 commented Jun 15, 2018 via email

@Chiiruno
Copy link
Contributor Author

Could you test it out? I don't have BF1.
Just add coreutils to targetPkgs = pkgs: with pkgs; with xorg; [

@tenten8401
Copy link

tenten8401 commented Jun 15, 2018 via email

@Chiiruno
Copy link
Contributor Author

Okay, that commit should at least make this somewhat usable.
As far as I can tell, most emulators work, I can't get WINE to work no matter what I do, same with this error on Citra: This application failed to start because it could not find or load the Qt platform plugin "xcb" - It's a QT issue or some sort. Mednafen is weird with sound, not the fault of this package.

@lukateras
Copy link
Member

@Chiiruno export QT_QPA_PLATFORM_PLUGIN_PATH=$(nix-build '<nixpkgs>' -A qt5.qtbase)/lib/qt-5.10/plugins/platforms will likely help (could be part of buildFHSUserEnv runScript).

@tenten8401
Copy link

tenten8401 commented Jun 16, 2018 via email

@Chiiruno
Copy link
Contributor Author

Chiiruno commented Jun 16, 2018

@yegortimoshenko I'm afraid I've tried many variations of that already, thanks for the heads-up though.
@tenten8401 I'm sorry to hear that, I hope my package didn't cause you any (albeit indirect) permanent damage.

@tenten8401
Copy link

tenten8401 commented Jun 16, 2018 via email

@Chiiruno
Copy link
Contributor Author

I'm not sure there's a lot more I can do to improve this package, any idea?

@tenten8401
Copy link

tenten8401 commented Jul 26, 2018

also, dumb question, but is makeWrapper even getting called? I see you have the args but I don't know if it's getting called or not, as I don't see anywhere the LD_LIBRARY_PATH is being set.

scratch that, just realized that makeWrapperArgs is a parameter of buildPythonApplication. Hmm.

@tenten8401
Copy link

Alright, I'm at the point where my lack of knowledge of the Nix package management system is what's stopping me from working on this further.

I'd be willing to send $10 PayPal to anyone who can successfully get this package fully working as intended, since I think this point we're basically stuck on Lutris versions of Wine not being able to find the libraries correctly.

@Chiiruno
Copy link
Contributor Author

#44047 may be a possible fix for the QT issues.

@infinisil
Copy link
Member

While trying to install Portal 1:

WARNING  2018-10-13 23:05:43,893 [lutriswindow]:portal is not available
INFO     2018-10-13 23:05:57,276 [steam]:Data path for SteamApp 400 not found.
** (process:25779): WARNING **: 23:05:57.289: chrootenv doesn't stack!
** Message: 23:05:57.290: Requires Linux version >= 3.19 built with CONFIG_USER_NS
** (process:25781): ERROR **: 23:05:57.291: main: unshare: Operation not permitted

Which sounds pretty bad.. Seems like we don't have a chance for this to ever work reliably, because we need to run everything in a chroot to begin with.

@Chiiruno
Copy link
Contributor Author

So there's nothing we can do?
What about how the Steam package does things?
Can we incorporate anything from other FHS packages?

@lukateras
Copy link
Member

lukateras commented Oct 13, 2018

The problem here is that Steam package and Lutris both use chrootenv, which doesn't stack because, I think, Linux user namespaces do not. I might be wrong about that, however here's a similar situation with Flatpak + Docker: flatpak/flatpak#1326

There might be intricate ways of dealing with this issue (making buildFHSUserEnv stack, rather; making all dirs in container's / read-writable, detecting stacking attempt in wrapper script and appending to existing container's FS instead of trying to create a new one), but can't really come up with any quick fixes.

@colemickens
Copy link
Member

Has anyone tried it with a kernel with CONFIG_USER_NS enabled? Some other distros do enable it.

@infinisil
Copy link
Member

@colemickens Hmm I thought it was enabled, even by default, but now I'm not so sure anymore. I originally interpreted the Requires Linux version >= 3.19 built with CONFIG_USER_NS error as just being a false assumption based on the first error by the program.

But now I'm also confused even more, because in the man page on user namespaces they clearly mention that they can be nested up to 32 levels deep. I guess chrootenv doesn't stack! doesn't have much to do with user namespaces maybe? Not sure what stack means in this context if not nesting.

@lukateras
Copy link
Member

lukateras commented Oct 14, 2018

@colemickens It's on for NixOS users unless one uses hardened kernel:

$ zcat /proc/config.gz | grep CONFIG_USER_NS
CONFIG_USER_NS=y

@infinisil Good find! Now we should try to understand why it fails to unshare the second time. Source code for reference: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c

@silverhook
Copy link
Contributor

I'd be willing to send $10 PayPal to anyone who can successfully get this package fully working as intended, since I think this point we're basically stuck on Lutris versions of Wine not being able to find the libraries correctly.

I’m also wiling to chip in 10 € for a box of beer.

@JohnAZoidberg
Copy link
Member

It doesn't work for me anymore.
Most (all?) curls to https://abbradar.net/steamrt/pool/main/... and http://repo.steampowered.com/steamrt/pool/main/... result in 404.

@davidak
Copy link
Member

davidak commented Nov 14, 2018

@JohnAZoidberg that's related to #49048

@nixos-discourse
Copy link

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/request-nixos-steam-for-dummies/1428/5

"--prefix LD_LIBRARY_PATH : ${fullPath}:$out/lib"
"--set GI_TYPELIB_PATH $GI_TYPELIB_PATH"
"--prefix XDG_DATA_DIRS : $out/share"
"--suffix XDG_DATA_DIRS : $XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
Copy link
Member

Choose a reason for hiding this comment

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

GSETTINGS_SCHEMAS_PATH will be also set automatically by wrapGAppsHook when glib gnome3.gsettings_desktop_schemas are in buildInputs: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/rambox/default.nix#L33

@teto
Copy link
Member

teto commented Feb 3, 2019

would be great to have a FOSS alternative at steam. Any update ?

@nyanloutre
Copy link
Member

Would a similar approach work for GameHub, or did anyone tried to package it ?

https://github.com/tkashkin/gamehub

@L-as
Copy link
Member

L-as commented Feb 5, 2019

What are the issues with this PR?

@KiaraGrouwstra
Copy link
Contributor

we may want to update the PR at least -- using the present one I just ran into lutris/lutris#967.

@KiaraGrouwstra
Copy link
Contributor

trying to update it, but still figuring out how to expose requests to it:

  Could not find a version that satisfies the requirement requests (from lutris==0.5.1) (from versions: )
No matching distribution found for requests (from lutris==0.5.1)

@teto
Copy link
Member

teto commented Apr 19, 2019

@tycho01 that might come from a version mismatch, you can fetch a requests from master or patch the setup.py with the hope it works.
The latest lutris allows to access the epic store which has made a few interesting games free in the upcoming weeks (thinking about Assassin's Creed Unity where you can jump from Notre Dame):
https://www.gamingonlinux.com/articles/you-can-now-easily-run-the-epic-store-on-linux-with-lutris-epic-suggests-applying-for-a-grant.13964

@TheSirC
Copy link

TheSirC commented Apr 30, 2019

It seams that the only conflicting files on this PR is on the top-level packages file. Any updates on the PR other than that ?

@abbradar
Copy link
Member

I've rebased and updated that PR at #61742 and fixed Steam too. I noticed that some people offered bounty for this but I'm here just for the fun ;)

@Chiiruno
Copy link
Contributor Author

Closed in favor of #61742

@Chiiruno Chiiruno closed this May 20, 2019
@Chiiruno Chiiruno deleted the dev/lutris branch August 24, 2019 08:48
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