Skip to content

Steam beta 2021-09-07: steamwebhelper cannot find LIBTHAI_0.1.25 on NixOS #462

Closed

Description

@benneti

Your system information

  • Steam Runtime Version:
  • Distribution (e.g. Ubuntu 18.04): NixOS 21.05
  • Link to your full system information (Help -> System Information) in a Gist: https://gist.github.com/benneti/49b1e572b6af12d98805961723957a91
  • (Additionally this happens on an Intel Laptop/AMD Desktop system (same OS )
  • Have you checked for system updates?: Yes
  • What compatibility tool are you using?: Steam Linux Runtime / Proton 5.13+
  • If you are using Steam Linux Runtime for native Linux games: What versions are listed in SteamLinuxRuntime/VERSIONS.txt?
  • If you are using Steam Linux Runtime, or Proton 5.13 or newer: What versions are listed in SteamLinuxRuntime_soldier/VERSIONS.txt?
#Name	Version		Runtime	Runtime_Version	Comment
depot	0.20210818.24			# Overall version number
pressure-vessel	0.20210809.1			
scripts	v0.20210818.0-0-gc6be089			# Entry point scripts, etc.
soldier	0.20210817.0	soldier	0.20210817.0	# soldier_platform_0.20210817.0/

Please describe your issue in as much detail as possible:

The issue described here ValveSoftware/steam-for-linux#7935 (comment) i.e. LIBRARY + SHOP only work in big picture mode because steamwebhelper is broken.

steamwebhelper.log

Steam runtime environment up-to-date!
Warning: An unexpected error occurred while executing "/sbin/ldconfig -XNv", the exit status was 127
./steamwebhelper: /home/benneti/.local/share/Steam/ubuntu12_64/steam-runtime-heavy/usr/lib/x86_64-linux-gnu/libthai.so.0: version `LIBTHAI_0.1.25' not found (required by /lib64/libpango-1.0.so.0)

Either the NixOS package needs to be changed to accomodate the missing libraries or they should be in the runtime.

Steps for reproducing this issue:

  1. Install NixOS
  2. Install Steam
  3. Run Steam
  4. Login and activate beta
  5. Observe

Activity

  1. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    @kisak-valve or @benneti, please could you retitle this to "Steam beta 2021-09-07: steamwebhelper cannot find LIBTHAI_0.1.25 on NixOS"? If people on different non-FHS distros like Guix have similar issues, then we'll want to track those separately.

  2. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    @benneti, do you know who maintains the Steam package in NixOS? Can you ask them to participate in solving this issue?

  3. changed the title [-]`LIBTHAI_0.1.25' not found on non-FHS distro[/-] [+]Steam beta 2021-09-07: steamwebhelper cannot find LIBTHAI_0.1.25 on NixOS[/+] on Sep 8, 2021
  4. benneti commented on Sep 8, 2021

    @benneti
    Author

    I hope it is fine for you to be pinged here, could you maybe help @jagajaga @jonringer or maybe the maintainers of the runtime are more suited @hrdinka @abbradar ?

  5. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    Steam for Linux is primarily designed to be run on a FHS-ish operating system like Ubuntu, Arch or Fedora, so it's always going to be a bit of an awkward fit on NixOS.

    I know NixOS is not FHS, but I also know (from previous issues) that it builds a small FHS container and runs Steam inside that container, to make an environment a bit closer to Steam's expectations.

    Some information that would help:

    head -v ~/.steam/root/ubuntu12_64/steam-runtime-heavy.version.txt
    head -v ~/.steam/root/ubuntu12_64/steam-runtime-heavy/version.txt
    ls -l ~/.steam/root/ubuntu12_64/steam-runtime-heavy/pinned_libs_32/
    ls -l ~/.steam/root/ubuntu12_64/steam-runtime-heavy/pinned_libs_64/
    

    It might also be helpful to edit ~/.steam/root/ubuntu12_64/steam-runtime-heavy/run.sh and ~/.steam/root/ubuntu12_64/steam-runtime-heavy/setup.sh, and near the top of each one, where it says set -u, also add a line set -x; then try restarting Steam. That will put a lot more in steamwebhelper.log.

    Warning: An unexpected error occurred while executing "/sbin/ldconfig -XNv", the exit status was 127
    

    I think this is probably the root cause, or a large part of the root cause. On a more normal, FHS distribution, ldconfig would tell us all the directories that make up the default search path for the runtime linker, so that we could arrange the library search path correctly. What we want to end up with in the LD_LIBRARY_PATH is, in this order:

    • the pinned_libs_32 and pinned_libs_64 subdirectories of steam-runtime-heavy
    • your OS's default search path (and I know that isn't really a thing that exists on NixOS, but read on...)
    • steam-runtime-heavy/usr/lib/x86_64-linux-gnu and steam-runtime-heavy/lib/x86_64-linux-gnu

    However, there is clearly something a bit weird going on here, because we're successfully picking up libpango-1.0.so.0 from NixOS, but for some reason using our own copy of libthai.so.0 (which is too old for NixOS' pango). I would have expected that even in the case where ldconfig completely fails, we would either get a purely NixOS environment (which should work, as long as NixOS' FHS-ish container has all the libraries we need), or a purely heavy environment (which should also work, because since Steam beta 2021-09-xx we ship a self-contained heavy environment instead of the previous more ad-hoc arrangement), but not this strange mixture.

    I think the easiest way to make this work might be something like this:

    • in the FHS-ish container that NixOS uses to run Steam, make one directory (perhaps /usr/lib64, /usr/lib or /usr/lib/x86_64-linux-gnu) that has symlinks to all the x86_64 libraries that are provided;
    • somehow tell the Steam Runtime launching scripts to treat that as your "default search path" instead of asking ldconfig;
    • and change the launching scripts to pick that up.
  6. benneti commented on Sep 8, 2021

    @benneti
    Author

    I think it is a problem with the LD library path order (putting system library at the very end omitts this error, but then it mesa doesn't work as expected anymore).
    Maybe the simplest solution is to remove the now obsolete libraries that weren't in the runtime previously, is there a list somewhere of the minimal set of libraries that should be in the nixos container? (i.e. stripping down https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/games/steam/fhsenv.nix)

    Additionally for completeness:

    steam-run head -v ~/.steam/root/ubuntu12_64/steam-runtime-heavy.version.txt                                                                                     15:51
    steam-run head -v ~/.steam/root/ubuntu12_64/steam-runtime-heavy/version.txt
    steam-run ls -l ~/.steam/root/ubuntu12_64/steam-runtime-heavy/pinned_libs_32/
    steam-run ls -l ~/.steam/root/ubuntu12_64/steam-runtime-heavy/pinned_libs_64/
    ==> /home/benneti/.steam/root/ubuntu12_64/steam-runtime-heavy.version.txt <==
    steam-runtime-heavy_0.20210826.0
    ==> /home/benneti/.steam/root/ubuntu12_64/steam-runtime-heavy/version.txt <==
    steam-runtime-heavy_0.20210826.0
    total 0
    total 0
    

    (steam-run runs the following application in the environment steam sees)

  7. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    I think it is a problem with the LD library path order (putting system library at the very end omitts this error, but then it mesa doesn't work as expected anymore).

    The intended library path order is as I said: "pinned" libraries (those that are strictly newer in the runtime than on the host, or have had incompatible changes), then your libraries from NixOS' FHS container (which you can update), and finally our libraries from the heavy runtime (which we basically can't, unless we are willing to break older OSs, which we are not).

    In your case there are no "pinned" libraries, which is expected when running on a reasonably up-to-date host OS.

    The problem is that on NixOS, the "your libraries" part of the search order is only finding some of your libraries, but not the rest, for whatever reason.

    If you add pango's dependencies (in particular libthai) to the FHS environment, so that they will appear in /lib64 rather than being loaded directly from /nix/store, does that work?

  8. benneti commented on Sep 8, 2021

    @benneti
    Author

    I already tried to add them, but then I simply hit the next library with such a problem.
    Therefore I think it would be the simplest solution to remove all libraries from the environment that are already in the steam-runtime.

    Thank you for the details by the way!

  9. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    Therefore I think it would be the simplest solution to remove all libraries from the environment that are already in the steam-runtime.

    Something else to consider here is: what would happen on a more typical OS that we actually have the resources to test, like Ubuntu or Arch? And if the answer on NixOS is "something totally different", then it's always going to be more likely to break on NixOS.

    On a more typical OS, we're not running in a special minimal container, we're running on the host OS - so we can see all libraries, including those that the desktop environment depends on. The Steam Runtime is designed to work with this, rather than against it.

    You've chosen to use an unusual non-FHS operating system, so in a sense you've brought this on yourself; but you can mitigate it by reducing the number of things visible to Steam that are unusual.

    I already tried to add them, but then I simply hit the next library with such a problem.

    Which is ...?

    You can make this process take fewer iterations by assuming you are likely to need "most" of the libraries in heavy. There are actually not that many libraries in heavy - it's a small runtime specifically for the steamwebhelper - and probably you already have at least half of them. You can see them all by listing the contents of steam-runtime/heavy/{,usr/}lib/x86_64-linux-gnu.

  10. jonringer commented on Sep 8, 2021

    @jonringer

    I made a PR to append the pinned libraries to LD_LIBRARY_PATH: https://github.com/NixOS/nixpkgs/pull/120829/files I could rebase the PR to see if it would fix anything, but:

    the pinned_libs_32 and pinned_libs_64 subdirectories of steam-runtime-heavy
    your OS's default search path (and I know that isn't really a thing that exists on NixOS, but read on...)
    steam-runtime-heavy/usr/lib/x86_64-linux-gnu and steam-runtime-heavy/lib/x86_64-linux-gnu

    just for clarity, this would be:

    ~/.steam/bin64/steam-runtime-heavy
    ~/.steam/bin32/steam-runtime-heavy
    # default paths, these get mounted by nixos runtime container
    /lib64
    /lib32
    

    I can't seem to find a steam-runtime-heavy/usr/lib/x86_64-linux-gnu anywhere.

  11. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    This issue is about the Steam beta, not the general-availability version (at the moment). The general-availability version has a much simpler setup for steam-runtime-heavy that uses our bundled libraries unconditionally, but that causes compatibility issues for people with a sufficiently new version of Freetype installed (ValveSoftware/steam-for-linux#7935). The beta replaces it with something a lot more similar to the scout steam-runtime, which tries to use your libraries preferentially, and only falls back to our bundled libraries if it has to.

    The intention is that for the steamwebhelper, after going through setup.sh and run.sh, we end up with the search path order I described. (The call path actually starts in ~/.steam/root/ubuntu12_64/steamwebhelper.sh, you can trace though shell scripts from there.)

    To achieve that, I think all you would need to put in the caller environment should be LD_LIBRARY_PATH=/lib64:/lib32? Steam's scripts should be able to do the rest.

    However, the way this currently works, and with your FHS environment not having a /sbin/ldconfig, we need every library that is both in heavy, and also provided by NixOS, to appear in one of those directories. For example, in the error message from this issue report, it is not enough to put libpango-1.0.so.0 in /lib64 and rely on getting libthai.so.0 loaded from /nix/store/... via a RUNPATH: to get the correct precedence order, we'd need to see libthai.so.0 in /lib64.

  12. benneti commented on Sep 8, 2021

    @benneti
    Author

    thanks john for joining in, was about to write an answer but smcv summarizes it better than I could

  13. smcv commented on Sep 8, 2021

    @smcv
    Contributor
    ~/.steam/bin64/steam-runtime-heavy
    ~/.steam/bin32/steam-runtime-heavy
    

    It is not supposed to be necessary to add these directories to the search path before running Steam. Any parts of Steam that need to search these directories are meant to edit the LD_LIBRARY_PATH themselves.

    Looking at NixOS/nixpkgs#120829, it is not supposed to be necessary to add those directories to the search path either.

  14. jonringer commented on Sep 8, 2021

    @jonringer

    Is there a way to get rid of using LD_LIBRARY_PATH altogether? I think part of the issue is that LD_LIBRARY_PATH is destructively forcing a lot of unwanted behavior as well.

    For a while we were building a ldconfig.cache for steam to consume. Would there be another way to communicate dependency preference?

  15. smcv commented on Sep 8, 2021

    @smcv
    Contributor

    For a while we were building a ldconfig.cache for steam to consume

    Are you not still doing that?

    If you can provide a ldconfig cache, together with a /sbin/ldconfig that reads it, in the FHS-like container, then that would be the thing that's closest to what happens on more mainstream distros.

  16. 5 remaining items

  17. YellowOnion commented on Sep 11, 2021

    @YellowOnion
    (steam.override {
          extraPkgs = pkgs: with pkgs; [ pango harfbuzz libthai ];
        })

    This fixed my issue.

    @smcv The irony of all this DLL hell, is that nix is designed to solve this, if Steam and all sub components were built inside a pure nix derivation, Valve would pick up on any missing dll's pretty quickly, my biggest gripe is that the updates are pushed with no warning of changes, and don't seem to be widely tested, and no way to revert back to older versions, nix provides these facilities. If I break my ArchLinux system I have to find a rescue disk and then fix it, if I screw up my NixOS all I have to do is select a different generation from my boot menu.

    This could be easily fixed if Valve used a sandboxing system to test their code, and then explicit defining what OS libraries are required for steam to build, using containers on the client end I don't think necessary. And then perhaps having a notice board somewhere that OS maintainers can quickly check and update their packages (maybe even parse), before these updates come out.

    Yesterday Valve shipped this broken "beta" to everyone without waiting an extra few days to fix it for OS maintainers, why can't they wait a few extra days?

    On top of that, it would be nice if there was a guide to debugging native steam games, Half-Life Seg-faults on my system, the dump files are instantly deleted and uploaded to Valves server, I can't figure out how to get a debugger attached inside the layers of runtimes, and even when I do get a crash dump file gdb doesn't seem compatible with them.

  18. anund commented on Sep 11, 2021

    @anund

    Picking up on @smcv comment on it being weird to use both the nix version of libpango-1.0.so.0 and the steam version of libthai I looked at the contents of the current FHS used by steam. libpango-1.0.so.0 is there https://github.com/NixOS/nixpkgs/blob/master/pkgs/games/steam/fhsenv.nix#L126. libthai and harfbuzz are not. I suspect while the steamwebhelper version requirements lined up with the host system no one could see the partial sharing of a set of dependencies between bundled steam libraries and os.

    Perhaps there's an assumption that the FHS container has a valid but minimized ecosystem of dependencies when it only has a minimum set added through trial and error. I suspect the short term fix is collecting the valid dependency set as a group and adding it to the FHS container on the nixos side.

    Notes on steamwebhelper.log

    Adding libthai to the nixos FHS container fixes ./steamwebhelper: /home/anund/data/Steam/ubuntu12_64/steam-runtime-heavy/usr/lib/x86_64-linux-gnu/libthai.so.0: version LIBTHAI_0.1.25 not found (required by /lib64/libpango-1.0.so.0)
    Adding harfbuzz fixes ./steamwebhelper: symbol lookup error: /lib64/libpango-1.0.so.0: undefined symbol: hb_buffer_set_cluster_level
    (both can be accomplished as pointed out just above)

  19. benneti commented on Sep 11, 2021

    @benneti
    Author

    as this will most likely be fixed on the nixos side (and there are already workarounds) feel free to close it here

  20. smcv commented on Sep 11, 2021

    @smcv
    Contributor

    Perhaps there's an assumption that the FHS container has a valid but minimized ecosystem of dependencies when it only has a minimum set added through trial and error. I suspect the short term fix is collecting the valid dependency set as a group and adding it to the FHS container on the nixos side.

    To most closely resemble what is expected from a typical FHS distribution, the libraries in /lib64 on NixOS' FHS container should be self-contained (a "dependency closure"): so if your libpango requires libthai (which it does), then we should be able to find libthai in /lib64 too, not just in /nix/store. The same is true for the recursive dependencies of everything else in /lib64.

    If the FHS environment does that, then that will pre-emptively fix various possible future issues.

    my biggest gripe is that the updates are pushed with no warning of changes

    I do not have control over Valve's update schedule for Steam. There are other regressions triggered by fixing ValveSoftware/steam-for-linux#7935 that I had hoped would be fixed in a new beta before going to GA, such as #458, but fixes for those didn't make it either.

    why can't they wait a few extra days?

    It wasn't my decision, but I would guess: either because ValveSoftware/steam-for-linux#7935 was breaking distributions that are more widely used than NixOS, or because changes in the Windows version of Steam were being released and the Linux version had to keep up.

    Again, I would recommend that people who are involved in maintaining distros' Steam packages should use the Steam beta, so that changes that happen in the general-availability branch of Steam do not come as an unwelcome surprise when it's too late to work around them by switching between branches.

  21. added a commit that references this issue on Sep 11, 2021
  22. added a commit that references this issue on Sep 12, 2021
  23. added a commit that references this issue on Sep 12, 2021
  24. added a commit that references this issue on Sep 12, 2021
  25. benneti commented on Sep 12, 2021

    @benneti
    Author

    fixed in nixos

  26. added a commit that references this issue on Sep 13, 2021
  27. added a commit that references this issue on Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions