NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.29k stars 14.27k forks source link

mangohud: libGL issue with minetest #347777

Open theotheroracle opened 1 month ago

theotheroracle commented 1 month ago

Describe the bug

when trying to launch minetest with mangohud, i get a library error

Steps To Reproduce

Steps to reproduce the behavior:

  1. install minetest and mangohud
  2. run mangohud minetest

Expected behavior

the app to launch

Additional context

relevant mangohud issue : https://github.com/flightlessmango/MangoHud/issues/1457

2024-10-10 12:54:11: [Main]: Automatically selecting world at [/home/hive/.minetest/worlds/world1]
[2024-10-10 12:54:11.277] [error] [loader_glx.cpp:28] Failed to open 64bit libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[2024-10-10 12:54:11.344] [error] [loader_glx.cpp:28] Failed to open 64bit libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[2024-10-10 12:54:11.346] [error] [loader_glx.cpp:28] Failed to open 64bit libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[2024-10-10 12:54:11.346] [error] [inject_glx.cpp:49] Failed to get function 'glXCreateContextAttribsARB'
[2024-10-10 12:54:11.349] [error] [loader_glx.cpp:28] Failed to open 64bit libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
fish: Job 1, 'mangohud minetest' terminated by signal SIGSEGV (Address boundary error)

Notify maintainers

@zeratax @kira-bruneau @SuperSandro2000

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

hive@library : /e/nixos ඞ
» nix-shell -p nix-info --run "nix-info -m"
install: cannot remove '/tmp/env-vars': Operation not permitted
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.9-zen1, NixOS, 24.11 (Vicuna), 24.11.20241009.5633bcf`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.8`
 - channels(root): `""`
 - nixpkgs: `/nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source`

Add a :+1: reaction to issues you find important.

kira-bruneau commented 1 month ago

Huh this is going to be tricky to figure out. I explicitly avoided hard-coding the libGL dependency in mangohud because games should already have libGL or vulkan loaded to render the game... I don't think it's a good idea to force the wrapped game to use a version that could be incompatible.

But from what I'm seeing with minetest, it looks like it uses libGL indirectly through IrrlichtMt, and won't have it loaded at the time mangohud hooks into the game.

It seems like mangohud does work if I hardcode libGL, but the font rasterization seems a bit off, and I want to make sure that adding it won't break other games:

image