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

runescape-launcher: init at 2.2.4, fixes #30582 #31075

Closed
wants to merge 1 commit into from

Conversation

lukateras
Copy link
Member

@lukateras lukateras commented Nov 1, 2017

Motivation for this change

Fixes #30582.

Runescape client only runs in FHS environment, otherwise it freezes at "Loading application resources".

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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.

@fusion809
Copy link
Contributor

I've successfully built it on Arch Linux, but it fails to run, giving the error:

/nix/store/iwxs4nwk80arwkvqdjqcy74r34wcg3wl-chroot-user:45:in `block in make_fcall': Invalid argument (Errno::EINVAL)
        from /nix/store/iwxs4nwk80arwkvqdjqcy74r34wcg3wl-chroot-user:115:in `<main>'

the build gave some collision issues, full log can be found here.

@lukateras
Copy link
Member Author

Interesting. Here is the line that causes the error:

# Create new mount and user namespaces
# CLONE_NEWUSER requires a program to be non-threaded, hence
# native fork above.
$unshare.call CLONE_NEWNS | CLONE_NEWUSER

I hope buildFHSUserEnv is not broken on non-NixOS distros...

/cc @abbradar

@lukateras
Copy link
Member Author

@fusion809 What is your kernel version? Do you use a custom kernel config?

You need Linux >= 3.8 with CONFIG_USER_NS on.

@fusion809
Copy link
Contributor

fusion809 commented Nov 1, 2017

No custom kernel config, I use the default kernel of Arch Linux, which is presently version 4.13.10.

@fusion809
Copy link
Contributor

zcat /proc/config.gz | grep "CONFIG_USER_NS" shows that it is disabled. So I'm rebuilding my kernel with CONFIG_USER_NS enabled so I can test this out.

@lukateras
Copy link
Member Author

lukateras commented Nov 1, 2017

https://bugs.archlinux.org/task/36969

Hate to say that Arch Linux kernels don't have CONFIG_USER_NS on. Most distros have it enabled by default by now. Hope they change that.

@fusion809
Copy link
Contributor

fusion809 commented Nov 1, 2017

Odd because other Nix packages have had no problems. But in an hour or so I'll know whether this problem persists or not.

@lukateras
Copy link
Member Author

lukateras commented Nov 1, 2017

Runescape Launcher runs in a virtualized environment with FHS file hierarchy. Some proprietary programs make too many assumptions and have to be run like this, Steam being another example.

There are only a few packages in Nixpkgs that use this feature (five including this one), which is why you've never had this problem before.

@lukateras
Copy link
Member Author

Oh, BTW! You can just use linux-userns package from AUR:
https://aur.archlinux.org/packages/linux-userns/

@fusion809
Copy link
Contributor

fusion809 commented Nov 1, 2017

I ain't, I'm rebuilding the linux package with the CONFIG_USER_NS option set to "y". Didn't even realize such a package existed, rofl.

@lukateras
Copy link
Member Author

Yeah, I thought so. It'd be the first thing I'd have done, too. Found this package while reading the aforementioned bug.

@fusion809
Copy link
Contributor

Well at least it's starting now, but not very successfully. This is what pops up (and it stays stuck at this, no game window (where you play RS) pops up):

screenshot_20171102_033043

and this is what I get from the command-line:

/nix/store/2a8nk14b9zqs8r8k5sg6yvrvsph9phjb-runescape-launcher-2.2.4/share/games/runescape-launcher
/runescape: /usr/lib/libcurl.so.4: no version information available (required by /nix/store/2a8nk14
b9zqs8r8k5sg6yvrvsph9phjb-runescape-launcher-2.2.4/share/games/runescape-launcher/runescape)

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(runescape:1958): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
/home/fusion809/Jagex/launcher/rs2client: /usr/lib/libcurl.so.4: no version information available (required by /home/fusion809/Jagex/launcher/rs2client)
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

runescape-launcher installed via pacman from the Arch User Repository runs like a charm though and all I get from the command-line with it is:

/usr/share/games/runescape-launcher/runescape: /usr/lib/libcurl.so.3: no version information available (required by /usr/share/games/runescape-launcher/runescape)
/home/fusion809/Jagex/launcher/rs2client: /usr/lib/libcurl.so.3: no version information available (required by /home/fusion809/Jagex/launcher/rs2client)

and if you're wondering, yes I did reboot after installing the new kernel.

@lukateras
Copy link
Member Author

I'm not sure about fonts, but the main window doesn't launch due to this: #9415

@@ -0,0 +1,26 @@
{ stdenv, buildFHSUserEnv, runescape-launcher-runtime }:
Copy link
Member

Choose a reason for hiding this comment

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

Please require package individually here instead of using pkgs. Otherwise users cannot use override properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't buildFHSUserEnv supposed to be used like this? Could you demonstrate?

Copy link
Member

Choose a reason for hiding this comment

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

There isn't any kind of support for comfortable overriding in buildFHSUserEnv now. In theory we could add overrides argument akin to haskell.packages one.

@fusion809
Copy link
Contributor

fusion809 commented Nov 3, 2017

Since I installed this package Guix is asking me to install Guile-git:

guix pull: error: Guile-Git is missing but it is now required by 'guix pull'.
Install it by running:

  guix package -i guile-git
  export GUILE_LOAD_PATH=$HOME/.guix-profile/share/guile/site/2.2:$GUILE_LOAD_PATH
  export GUILE_LOAD_COMPILED_PATH=$HOME/.guix-profile/lib/guile/2.2/site-ccache:$GUILE_LOAD_COMPILE
D_PATH

The problem is when I do this I get this error whenever I run guix pull:

Updating from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           5 (primitive-load "/usr/bin/guix")
In guix/ui.scm:
  1384:12  4 (run-guix-command _ . _)
In ice-9/boot-9.scm:
    837:9  3 (catch _ _ #<procedure 7f8048f66ac0 at guix/ui.scm:460…> …)
    837:9  2 (catch _ _ #<procedure 7f8048f66ad8 at guix/ui.scm:548…> …)
In guix/scripts/pull.scm:
    230:2  1 (report-git-error #<<git-error> code: -1 message: "curl…>)
In unknown file:
           0 (_ #<<git-error> code: -1 message: "curl error: Could n…>)

ERROR: ERROR: Wrong type to apply: #<syntax-transformer git-error?>

I haven't done anything with Guix except install this package...

@vyp
Copy link
Member

vyp commented Nov 3, 2017

@fusion809 you installed it with guix?

@fusion809
Copy link
Contributor

fusion809 commented Nov 3, 2017

Guile-git? Yes. runescape-launcher? Yes.

@vyp
Copy link
Member

vyp commented Nov 3, 2017

Maybe just ask help-guix about that then.

@fusion809
Copy link
Contributor

Oops rofl, forgot this was Nix.

@abbradar
Copy link
Member

abbradar commented Nov 4, 2017

@fusion809 I think your problem is an instance of #9415. Not sure how to mitigate that for non-NixOS in a fair way, the best I could come up with now is nix-build -A mesa_drivers -o /run/opengl-driver; nix-build -A pkgsi686Linux.mesa_drivers -o /run/opengl-driver-32.

@fusion809
Copy link
Contributor

fusion809 commented Nov 4, 2017

Well the font issue is fixed with this solution, but it segmentation faults with the error:

/home/fusion809/Jagex/launcher/rs2client: relocation error: /nix/store/yydnhs7migvlbl48wpsxan1yvq2icbr9-glibc-2.25-49/lib/libresolv.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
result/bin/runescape-launcher: line 14: 10691 Segmentation fault      (core dumped) /nix/store/b7scrq1jhja9s1gnclp0p9ycik5x01cg-runescape-launcher-2.2.4/share/games/runescape-launcher/runescape --configURI $configURI $@

and exits.

@lukateras
Copy link
Member Author

lukateras commented Nov 4, 2017

This happens because you (as an Arch Linux user) are using glibc 2.26 and Nix uses glibc 2.25.
See: psycopg/psycopg2-wheels#2

@fusion809
Copy link
Contributor

Guessing that means there's no fix.

@abbradar
Copy link
Member

abbradar commented Nov 5, 2017

That's not correct -- you can still run the game if you use only libraries from nixpkgs. Not sure what else gets in your way besides graphics drivers (which should be from nixpkgs with my fix above). Try running the game with strace -f -e trace=file and see what libraries in /usr and /lib it uses.

@fusion809
Copy link
Contributor

OK, it tells me what I expected to see some libraries belonging to glibc. What do I do with that info? I've tried installing glibc with nix-env in the hope that these libraries will enter ~/.nix-profile/lib and will be used by runescape-launcher but alas I do not seem that lucky today. I can't exactly uninstall glibc on my Arch Linux system to force it to use Nix's glibc.

@abbradar
Copy link
Member

abbradar commented Nov 5, 2017

Can you show the list? I think the first opened library from /usr/lib or /lib is the most interesting. It's strange that it'd use host's glibc out of the blue if it doesn't use any other host libraries.

@fusion809
Copy link
Contributor

fusion809 commented Nov 5, 2017

The only system (non-Nix) ones loaded are in /usr/lib:

open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 5
[pid 21561] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 5
[pid 21561] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 5
[pid 21576] openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 6
[pid 21576] openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 6
[pid 21576] openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 6

This is probably because on Arch /lib is just a symlink to /usr/lib.

@fusion809
Copy link
Contributor

Guessing there's something stunning about that output? Surprised how quiet you's have gotten.

@orivej
Copy link
Contributor

orivej commented Nov 16, 2017

Am I right that this is ready for merge?

@lukateras
Copy link
Member Author

lukateras commented Nov 16, 2017

There is no point in merging unless @fusion809 gets this to run, I don't play Runescape. Also, @Mic92's concern about non-overridable packages is still not addressed.

@abbradar
Copy link
Member

@fusion809 I wasn't actually sure what happens on your system -- for some reason libc.so.6 gets opened but for now I don't see why this happens. Do you have any entries in LD_LIBRARY_PATH? Do I get it correctly that /run/opengl-driver points to mesa_drivers from nixpkgs now?

name = "runescape-launcher-wrapper-${runescape-launcher-runtime.version}";

runScript = "${runescape-launcher-runtime}/bin/runescape-launcher";

Copy link
Member

Choose a reason for hiding this comment

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

@fusion809 Could you add profile = "export LD_DEBUG=libs"; here and show us output of runescape-launcher? I didn't want to do this initially because it's difficult to analyze but it could give us hints on what happens.

Copy link
Contributor

@fusion809 fusion809 Nov 17, 2017

Choose a reason for hiding this comment

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

What add it to the file or run it at the command-line? I ran this package in NixOS (17.09) itself and it ran fine. Although afterwards running:

sudo nix-channel --update && sudo nix-env --upgrade

gave the error:

downloading Nix expressions from ‘https://d3g5gsiof5omrk.cloudfront.net/nixos/17.09/nixos-17.09.2075.ac35504065/nixexprs.tar.xz’...
downloading ‘https://d3g5gsiof5omrk.cloudfront.net/nixos/17.09/nixos-17.09.2075.ac35504065/nixexprs.tar.xz’... [7599/9693 KiB, 1879.1 KiB/s]
unpacking channels...
error: syntax error, unexpected $end, at /nix/store/hjag2invv11g2fhqv1hyzlvx2j0f17z5-env-manifest.nix:1:1
cannot unpack the channels at /run/current-system/sw/bin/nix-channel line 172.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gave it a go, adding it to the wrapper.nix file, which is what I assume you mean, and I got the error:

/nix/store/iwxs4nwk80arwkvqdjqcy74r34wcg3wl-chroot-user:45:in `block in make_fcall': Invalid argument (Errno::EINVAL)
        from /nix/store/iwxs4nwk80arwkvqdjqcy74r34wcg3wl-chroot-user:115:in `<main>'

Copy link
Contributor

Choose a reason for hiding this comment

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

Gave it a go, adding it to the wrapper.nix file, which is what I assume you mean and it crashes and before it does it's got that strange font rendering issue:

screenshot_20171117_170924

Here is the output: https://gist.github.com/fec0b781d1b077af4940e475fa7868d3.

Copy link
Member

Choose a reason for hiding this comment

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

Any idea where might /var/bamboo-home/bamboo-home-05/xml-data/build-dir/NXT-BUIL2082-BLR/devplatform/3rdPartyLibs/cpp/wxWidgets/lib/linux/Release/tls/x86_64 come from?

Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't the foggiest if you're asking me. I'm not a panda so I have no need for bamboo :P.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, it may be paths from Runescape binaries then.

@lukateras lukateras closed this Dec 29, 2017
@lukateras
Copy link
Member Author

lukateras commented Dec 29, 2017

I'm not interested in maintaining this, because I don't play Runescape. If someone wants Runescape in Nixpkgs, feel free to checkout my branch, apply Runescape updates and send a pull request.

fusion809 added a commit to fusion809/nixpkgs that referenced this pull request Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants