Skip to content

steam-runtime-tools scripts may error with getopt: command not found #414

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

Open
R1kaB3rN opened this issue Mar 14, 2025 · 15 comments
Open

steam-runtime-tools scripts may error with getopt: command not found #414

R1kaB3rN opened this issue Mar 14, 2025 · 15 comments

Comments

@R1kaB3rN
Copy link
Member

R1kaB3rN commented Mar 14, 2025

Description

When running umu-launcher in certain environments/system configurations, the Steam Runtime tool's shell scripts may result in errors due to missing commands not found in PATH. In the case for v2-entry-point aka umu , I get the error getopt: command not found.

Terminal output

(deck@steamdeck ~)$ which umu-run
/home/deck/.nix-profile/bin/umu-run
(deck@steamdeck ~)$ PROTONPATH=GE-Proton9-26 umu-run ""
INFO: umu-launcher version 1.2.5 (3.12.9 (main, Feb  4 2025, 14:38:38) [GCC 14.2.1 20241116])
INFO: No GAMEID set, using umu-default
INFO: steamrt3 is up to date
/home/deck/.local/share/umu/umu: line 93: getopt: command not found
deck@steamdeck ~> cat .local/share/umu/VERSIONS.txt
#Name	Version		Runtime	Runtime_Version	Comment
depot	3.0.20250306.120299			# Overall version number
pressure-vessel	0.20250225.0	scout		# pressure-vessel-bin.tar.gz
scripts	0.20250225.0			# from steam-runtime-tools
sniper	3.0.20250306.120299	sniper	3.0.20250306.120299	# sniper_platform_3.0.20250306.120299/
deck@steamdeck ~/.l/s/umu [1]> rm umu-shim compatibilitytools.d.lock pfx.lock umu.lock
deck@steamdeck ~/.l/s/umu> mv umu _v2-entry-point
deck@steamdeck ~/.l/s/umu> ./pressure-vessel/bin/pv-verify --mtree mtree.txt.gz
pv-verify[20028]: N: Verified "/home/deck/.local/share/umu/sniper_platform_3.0.20250306.120299/files" against "/home/deck/.local/share/umu/sniper_platform_3.0.20250306.120299/usr-mtree.txt.gz" successfully
pv-verify[20028]: N: Verified "/home/deck/.local/share/umu" against "mtree.txt.gz" successfully

Reproduce

  1. Setup home-manager (if possible, in a Steam Deck)
  2. Install the umu-launcher NixOS package
  3. Run PROTONPATH=GE-Proton umu-run ""

cc @MattSturgeon @LovingMelody @beh-10257 for insight

@R1kaB3rN R1kaB3rN changed the title steam-runtime-tools scripts may error with "getopt: command not found" steam-runtime-tools scripts may error with getopt: command not found Mar 14, 2025
@MattSturgeon
Copy link
Contributor

Steam Runtime tool's shell scripts may result in errors due to missing commands not found in PATH

The nixpkgs steam package bundles a number of dependencies in its FHS-environment: https://github.com/NixOS/nixpkgs/blob/6607cf789e541e7873d40d3a8f7815ea92204f32/pkgs/by-name/st/steam/package.nix#L22-L64

So far, the umu-lanucher package has held off adding many things to $PATH: https://github.com/NixOS/nixpkgs/blob/6607cf789e541e7873d40d3a8f7815ea92204f32/pkgs/by-name/um/umu-launcher/package.nix#L22-L29

(Note, however, that since NixOS/nixpkgs#381047 the umu-launcher does define the same profile environment, as we discovered this was needed in NixOS/nixpkgs#297662 (comment). We could use a similar strategy for runtime dependencies.)

I've not yet tried to reproduce the issue, however it sounds like the umu-launcher wrapper should be providing many (all?) of the same dependencies that the steam wrapper does in its FHS-env.

That said, we probably don't need all of them; some may relate to the steam launcher itself or running native games, so aren't relevant to umu, proton, or steamrt. If so, then we should just be able to add a few things like coreutils to the runtime dependencies. Is there a dependencies list anywhere?

@beh-10257
Copy link
Contributor

beh-10257 commented Mar 14, 2025

#75
this is probably the issue
as far as I know its hardcoded to use the stuff in .local/share/umu no ??
for some reason when installed from home manager on other distros it doesn't work ??
anyway with more testing (context btw umu1 is the old local install or whatever you wanna call it umu is the new one)

Image
at least on nixos there is no .local/share/umu/umu
why is that

@MattSturgeon
Copy link
Contributor

MattSturgeon commented Mar 14, 2025

#75
this is probably the issue

That issue sounds like it would affect nix-based installations, since anything copied from the nix store will be readonly.

However, "command not found" errors imply the PATH was searched. If you see my links above, you'll see that the umu-launcher wrapper package does not add many of the runtime dependencies that steam's wrapper package does.

I can see getopt in steam and heroic's FHS-env's $out/usr/bin directory, however not in umu-launcher's:

$ ls -l /nix/store/j4b9p9vm8g69v65rc2xb1y8qnbvhqvbj-steam-fhsenv-rootfs/usr/bin/getopt
lrwxrwxrwx 2 root root 67 Jan  1  1970 /nix/store/j4b9p9vm8g69v65rc2xb1y8qnbvhqvbj-steam-fhsenv-rootfs/usr/bin/getopt -> /nix/store/ki14bk4bhlrqnpkg4famkr1dnbda3ya9-getopt-1.1.6/bin/getopt*

$ ls -l /nix/store/vf8vzv9frq4f9rbpwks42hanl03vidjs-heroic-2.16.0-fhsenv-rootfs/usr/bin/getopt
lrwxrwxrwx 4 root root 76 Jan  1  1970 /nix/store/vf8vzv9frq4f9rbpwks42hanl03vidjs-heroic-2.16.0-fhsenv-rootfs/usr/bin/getopt -> /nix/store/8qp4dnhf02xg43c3yrqc63ivhxwhk950-util-linux-2.40.4-bin/bin/getopt*

$ ls -l /nix/store/lcr82knp6921j8spaaihxzw9ppcl7746-umu-launcher-1.2.5-fhsenv-rootfs/usr/bin/getopt
ls: cannot access '/nix/store/lcr82knp6921j8spaaihxzw9ppcl7746-umu-launcher-1.2.5-fhsenv-rootfs/usr/bin/getopt': No such file or directory

For steam, this is getopt 1.1.6, packaged as pkgs.getopt not the getopt from pkgs.unixtools (that would be 2.40.4).

I'm struggling to see where getopt gets added to the steam wrapper, as it doesn't seem to be part of any of the dependencies I can see listed.

For heroic, it is getopt from util-linux 2.40.4 and I can see util-linux being explicitly added to the wrapper's inputs.

@MattSturgeon
Copy link
Contributor

MattSturgeon commented Mar 14, 2025

  1. Setup home-manager (if possible, in a Steam Deck)

  2. Install the umu-launcher NixOS package

  3. Run PROTONPATH=GE-Proton umu-run ""

Hm, I'm seemingly unable to reproduce the issue on NixOS (I can't test on SteamOS):

$ PROTONPATH=GE-Proton umu-run ""
INFO: umu-launcher version 1.2.5 (3.12.9 (main, Feb  4 2025, 14:38:38) [GCC 14.2.1 20241116])
INFO: No GAMEID set, using umu-default
INFO: Setting up Unified Launcher for Windows Games on Linux...
INFO: Downloading GE-Proton9-26.sha512sum...
INFO: Downloading GE-Proton9-26.tar.gz...
INFO: Downloading steamrt3 (latest), please wait...
INFO: SteamLinuxRuntime_sniper.tar.xz: SHA256 is OK
INFO: Verifying integrity of sniper_platform_3.0.20250306.120299...
INFO: sniper_platform_3.0.20250306.120299: mtree is OK
INFO: Using steamrt3 (latest)
INFO: GE-Proton9-26.tar.gz: SHA512 is OK
INFO: Extracting GE-Proton9-26.tar.gz...
INFO: /home/matt/.cache/umu/tmpk6e20x2w/GE-Proton9-26 -> /home/matt/.local/share/Steam/compatibilitytools.d
INFO: Using GE-Proton9-26
pressure-vessel-wrap[5748]: W: Found more than one possible libdrm data directory from provider
Proton: Upgrading prefix from None to GE-Proton9-26 (/home/matt/Games/umu/umu-default/)
ProtonFixes[5867] INFO: Running protonfixes
ProtonFixes[5867] INFO: Running checks
ProtonFixes[5867] INFO: All checks successful
ProtonFixes[5867] WARN: Game title not found in CSV
ProtonFixes[5867] INFO: Non-steam game UNKNOWN (umu-default)
ProtonFixes[5867] INFO: No store specified, using UMU database
ProtonFixes[5867] INFO: Using global defaults for UNKNOWN (umu-default)
ProtonFixes[5867] INFO: Non-steam game UNKNOWN (umu-default)
ProtonFixes[5867] INFO: No store specified, using UMU database
ProtonFixes[5867] INFO: No global protonfix found for UNKNOWN (umu-default)
Proton:
Proton: Executable is inside wine prefix, launching normally.
fsync: up and running.
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Command exited with status: 1

@MattSturgeon
Copy link
Contributor

MattSturgeon commented Mar 14, 2025

If you are able to reproduce with the flake in this repo, can you test if this patch helps?

diff --git a/packaging/nix/package.nix b/packaging/nix/package.nix
index 2030f87..b1572b5 100644
--- a/packaging/nix/package.nix
+++ b/packaging/nix/package.nix
@@ -41,5 +41,9 @@ in
         if overrides == {}
         then umu-launcher-unwrapped
         else umu-launcher-unwrapped.override overrides;
+
+      extraPkgs = pkgs: [
+        pkgs.util-linux
+      ];
     }
   )

Otherwise, if you're installing from nixpkgs you could use this overlay instead:

(final: prev: {
  umu-launcher = prev.umu-launcher.override {
    extraPkgs = pkgs: [ pkgs.util-linux ];
  };
})
E.g. using an overlay with home-manager

Assuming home-manager is managing its own pkgs instance (which is usually true, unless you have home-manager as a nixos module and enable home-manager.useGlobalPkgs), you can use home-manager's nixpkgs.overlays option to specify overlays:

# Either in home.nix or an imported home-manager module
{
  nixpkgs.overlays = [
    (final: prev: {
      umu-launcher = prev.umu-launcher.override {
        extraPkgs = pkgs: [
          pkgs.util-linux
        ];
      };
    })
  ];
}

@R1kaB3rN
Copy link
Member Author

To note, I do not get the getopt: command not found error when using the umu-launcher-unwrapped package, and the command runs as expected:

deck@steamdeck ~ [1]> PROTONPATH=GE-Proton GAMEID=umu-0 umu-run ""
INFO: umu-launcher version 1.2.5 (3.12.9 (main, Feb  4 2025, 14:38:38) [GCC 14.2.1 20241116])
INFO: steamrt3 is up to date
INFO: GE-Proton is up to date
i386-linux-gnu-capsule-capture-libs: warning: Dependencies of /usr/lib32/libMangoHud.so not found, ignoring: Missing dependencies: Could not find "libxkbcommon.so.0" in LD_LIBRARY_PATH "", ld.so.cache, DT_RUNPATH or fallback /lib:/usr/lib
ProtonFixes[6565] INFO: Running protonfixes
ProtonFixes[6565] INFO: Running checks
ProtonFixes[6565] INFO: All checks successful
ProtonFixes[6565] WARN: Game title not found in CSV
ProtonFixes[6565] INFO: Non-steam game UNKNOWN (umu-0)
ProtonFixes[6565] INFO: No store specified, using UMU database
ProtonFixes[6565] INFO: Using global defaults for UNKNOWN (umu-0)
ProtonFixes[6565] INFO: Non-steam game UNKNOWN (umu-0)
ProtonFixes[6565] INFO: No store specified, using UMU database
ProtonFixes[6565] INFO: No global protonfix found for UNKNOWN (umu-0)
Proton: 
Proton: Executable is inside wine prefix, launching normally.
fsync: up and running.
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Command exited with status: 1
deck@steamdeck ~ [1]> which umu-run
/home/deck/.nix-profile/bin/umu-run

Otherwise, if you're installing from nixpkgs you could use this overlay instead:

Using the overlay where home-manager is managing its own pkgs instance, I get a new error:

INFO: umu-launcher version 1.2.5 (3.12.9 (main, Feb  4 2025, 14:38:38) [GCC 14.2.1 20241116])
INFO: Setting up Unified Launcher for Windows Games on Linux...
INFO: GE-Proton is up to date
INFO: Downloading steamrt3 (latest), please wait...
INFO: SteamLinuxRuntime_sniper.tar.xz: SHA256 is OK
INFO: Verifying integrity of sniper_platform_3.0.20250306.120299...
INFO: sniper_platform_3.0.20250306.120299: mtree is OK
INFO: Using steamrt3 (latest)
/usr/lib/pressure-vessel/from-host/libexec/steam-runtime-tools-0/pv-adverb: symbol lookup error: /lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE

@R1kaB3rN
Copy link
Member Author

This issue seems to be dependency related when entering the FHS-environment and only applicable to the official umu-launcher NixOS package. I haven't tested the Flake yet or to see if the issue is only specific to home-manager. Though, I don't expect the former to be an issue.

Hm, I'm seemingly unable to reproduce the issue on NixOS (I can't test on SteamOS):

That's strange, assuming you were using home-manager and umu-launcher.

@MattSturgeon
Copy link
Contributor

To note, I do not get the getopt: command not found error when using the umu-launcher-unwrapped package, and the command runs as expected:

I guess because you're running steamos, all of steamrt's dependencies will be installed as part of the distro. So in that scenario it should be fine to use the unwrapped package.

The goal of the unwrapped package is to ensure all dependencies and env vars are correct regardless of that is installed on the main system.

It is strange/interesting that the wrapper package would make things worse though. Maybe bubblewrap blocks access to some of the host's environment?

Hm, I'm seemingly unable to reproduce the issue on NixOS (I can't test on SteamOS):

That's strange, assuming you were using home-manager and umu-launcher.

It shouldn't make a difference how the package is installed (nixos, home-manager, shell), whatever method is used it'll be the same package. It's more likely that something impure from the wider system is different. It's also possible that my system has even more dependencies missing than yours, and so I'm running into a different (earlier) issue.

I've tested both the nixpkgs package and this repo's flake. Both exit with this error:

Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

(See full output above)

Using the overlay, I get a new error:

Looks like you may be using binaries that aren't nix compatible. Nix packages need to be built or patched to link correctly with nix-installed libraries. It could also be a lib version discrepancy. Hopefully once we get iron out all the required dependencies things will start to work 🤞


It's a shame we can't add a test to the nix package to cover this usage; nix tests need to be able to run in the build sandbox (without network access), so I don't think this case can be tested easily.


We can try adding more of steam's requirements to the overlay for now:

This overlay should bring in the same dependencies the steam wrapper does. I suspect many of them are steam client dependencies, not steamrt dependencies, but if it works with these we can try gradually commenting out the ones we don't think we need.

(final: prev: {
  umu-launcher = prev.umu-launcher.override {
    # https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md#command-line-tools
    extraPkgs = pkgs: with pkgs; [
      # commented out, since it isn't listed in the steam package... maybe we'll need it anyway?
      # util-linux

      # We could also try using the other getopt package:
      # getopt

      # this shouldn't be needed, but maybe it has some transitives?
      # if uncommenting this helps, we can investigate further
      # steam-unwrapped

      bash
      coreutils
      file
      lsb-release  # not documented, called from Big Picture (we shouldn't need this)
      pciutils  # not documented, complains about lspci on startup (maybe we need this?)
      glibc_multi.bin
      xz
      zenity
    ];

    # https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md#shared-libraries
    multiPkgs = pkgs: with pkgs; [
      glibc
      libxcrypt
      libGL

      libdrm
      libgbm
      udev
      libudev0-shim
      libva
      vulkan-loader

      networkmanager  # not documented, used for network status things in Big Picture
                      # (we shouldn't need this)
      libcap  # not documented, required by srt-bwrap
    ]
  };
})

@R1kaB3rN
Copy link
Member Author

Additionally, I will say that the error getopt: command not found just started occurring all of a sudden. I used to be able to just run umu-launcher fine. Assuming the host isn’t related, it must of happened after updating the home-manager environment.

@MattSturgeon
Copy link
Contributor

Assuming the host isn’t related, it must of happened after updating the home-manager environment.

The host env could be related.

Depending on what revision of nixpkgs you've updated from/to, a packaging regression is also possible. We could try git-bisecting your nixpkgs input if needed.

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Mar 15, 2025

This overlay should bring in the same dependencies the steam wrapper does

As far as dependencies goes, I believe we should only need to cover the ones between the boundaries of umu-launcher and the container runtime. In our case, since we only support container runtimes (e.g., soldier, sniper), this should only be the shell interpreter related or GNU coreutil related ones. The dependencies for the binaries within the pressure-vessel directory are already satisfied via RPATH.

@MattSturgeon
Copy link
Contributor

MattSturgeon commented Mar 15, 2025

Yeah, I just figured we'd start overkill with dependencies. If that works, then we can gradually remove some/most until things stop working again.

If having all the same dependencies as steam isn't enough, then there's probably additional issues unrelated to dependencies.

If this is a regression, then maybe something in the profile is causing issues. We recently changed the umu wrapper to use the same profile as steam's wrapper, although we probably don't need all of it.

@R1kaB3rN
Copy link
Member Author

Hmm, is there an easy way to track the changes for the umu-run NixOS script? Or is it automatically generated by the build system and is guaranteed to be consistent across builds? I just find it a bit strange that it was working before, so it leaves me to believe that there was a change to that script.

umu-launcher umu-run script:

deck@steamdeck ~> cat /home/deck/.nix-profile/bin/umu-run
#!/nix/store/ki4if6b0w5bqv8dc5lrjp8xm7wjy9dlf-bash-5.2p37/bin/bash
ignored=(/nix /dev /proc /etc )
ro_mounts=()
symlinks=()
etc_ignored=()



# loop through all entries of root in the fhs environment, except its /etc.
for i in /nix/store/6y2di3pqn7jrpi5xnzpv0gr045d810fi-umu-launcher-1.2.5-fhsenv-rootfs/*; do
  path="/${i##*/}"
  if [[ $path == '/etc' ]]; then
    :
  elif [[ -L $i ]]; then
    symlinks+=(--symlink "$(/nix/store/vz67zaqyfln2jcqwar682kdlrxfx9vq1-coreutils-9.6/bin/readlink "$i")" "$path")
    ignored+=("$path")
  else
    ro_mounts+=(--ro-bind "$i" "$path")
    ignored+=("$path")
  fi
done

# loop through the entries of /etc in the fhs environment.
if [[ -d /nix/store/6y2di3pqn7jrpi5xnzpv0gr045d810fi-umu-launcher-1.2.5-fhsenv-rootfs/etc ]]; then
  for i in /nix/store/6y2di3pqn7jrpi5xnzpv0gr045d810fi-umu-launcher-1.2.5-fhsenv-rootfs/etc/*; do
    path="/${i##*/}"
    # NOTE: we're binding /etc/fonts and /etc/ssl/certs from the host so we
    # don't want to override it with a path from the FHS environment.
    if [[ $path == '/fonts' || $path == '/ssl' ]]; then
      continue
    fi
    if [[ -L $i ]]; then
      symlinks+=(--symlink "$i" "/etc$path")
    else
      ro_mounts+=(--ro-bind "$i" "/etc$path")
    fi
    etc_ignored+=("/etc$path")
  done
fi

# propagate /etc from the actual host if nested
if [[ -e /.host-etc ]]; then
  ro_mounts+=(--ro-bind /.host-etc /.host-etc)
else
  ro_mounts+=(--ro-bind /etc /.host-etc)
fi

# link selected etc entries from the actual root
for i in /etc/static /etc/nix /etc/shells /etc/bashrc /etc/zshenv /etc/zshrc /etc/zinputrc /etc/zprofile /etc/passwd /etc/group /etc/shadow /etc/hosts /etc/resolv.conf /etc/nsswitch.conf /etc/profiles /etc/login.defs /etc/sudoers /etc/sudoers.d /etc/localtime /etc/zoneinfo /etc/machine-id /etc/os-release /etc/pam.d /etc/fonts /etc/alsa /etc/asound.conf /etc/ssl/certs /etc/ca-certificates /etc/pki /etc/dconf; do
  if [[ "${etc_ignored[@]}" =~ "$i" ]]; then
    continue
  fi
  if [[ -e $i ]]; then
    symlinks+=(--symlink "/.host-etc/${i#/etc/}" "$i")
  fi
done

declare -a auto_mounts
# loop through all directories in the root
for dir in /*; do
  # if it is a directory and it is not ignored
  if [[ -d "$dir" ]] && [[ ! "${ignored[@]}" =~ "$dir" ]]; then
    # add it to the mount list
    auto_mounts+=(--bind "$dir" "$dir")
  fi
done

declare -a x11_args
# Always mount a tmpfs on /tmp/.X11-unix
# Rationale: https://github.com/flatpak/flatpak/blob/be2de97e862e5ca223da40a895e54e7bf24dbfb9/common/flatpak-run.c#L277
x11_args+=(--tmpfs /tmp/.X11-unix)

# Try to guess X socket path. This doesn't cover _everything_, but it covers some things.
if [[ "$DISPLAY" == *:* ]]; then
  # recover display number from $DISPLAY formatted [host]:num[.screen]
  display_nr=${DISPLAY/#*:} # strip host
  display_nr=${display_nr/%.*} # strip screen
  local_socket=/tmp/.X11-unix/X$display_nr
  x11_args+=(--ro-bind-try "$local_socket" "$local_socket")
fi



cmd=(
  /nix/store/ss6zrgf22sfy9bc1jh2ia8dn79c1p73c-bubblewrap-0.11.0/bin/bwrap
  --dev-bind /dev /dev
  --proc /proc
  --chdir "$(pwd)"
  
  
  
  
  
  
  --die-with-parent
  --ro-bind /nix /nix
  
  # Our glibc will look for the cache in its own path in `/nix/store`.
  # As such, we need a cache to exist there, because pressure-vessel
  # depends on the existence of an ld cache. However, adding one
  # globally proved to be a bad idea (see #100655), the solution we
  # settled on being mounting one via bwrap.
  # Also, the cache needs to go to both 32 and 64 bit glibcs, for games
  # of both architectures to work.
  --tmpfs /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc \
  --tmpfs /etc \
  --symlink /etc/ld.so.conf /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc/ld.so.conf \
  --symlink /etc/ld.so.cache /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc/ld.so.cache \
  --ro-bind /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc/rpc /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc/rpc \
  --remount-ro /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/etc \
  --symlink /nix/store/1y3338ska5ysgvlydm9bj23qiqas346z-umu-launcher-1.2.5-init /init \
  --tmpfs /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc \
  --symlink /etc/ld.so.conf /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc/ld.so.conf \
  --symlink /etc/ld.so.cache /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc/ld.so.cache \
  --ro-bind /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc/rpc /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc/rpc \
  --remount-ro /nix/store/3bvb7ckan4brha60nnq54ya5p7ms2p8j-glibc-2.40-66/etc \
  "${ro_mounts[@]}"
  "${symlinks[@]}"
  "${auto_mounts[@]}"
  "${x11_args[@]}"
  
  /nix/store/7rb6jvw88fk6fdpwfwykwa4wv5rb2f7p-container-init "$@"
)
exec "${cmd[@]}"

umu-launcher-unwrapped umu-run script:

deck@steamdeck ~ [SIGINT]> cat /home/deck/.nix-profile/bin/umu-run
#! /nix/store/ki4if6b0w5bqv8dc5lrjp8xm7wjy9dlf-bash-5.2p37/bin/bash -e
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/28f4gpvnczg7zlvvavi78r6qikwzi4sw-python3.12-cbor2-5.6.5/bin'':'/':'}
PATH='/nix/store/28f4gpvnczg7zlvvavi78r6qikwzi4sw-python3.12-cbor2-5.6.5/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/kgi1s3jiz0y67d9qsh5i5vv7nfbrhlh8-python3.12-charset-normalizer-3.4.1/bin'':'/':'}
PATH='/nix/store/kgi1s3jiz0y67d9qsh5i5vv7nfbrhlh8-python3.12-charset-normalizer-3.4.1/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/7km6fc1gpadidh00h070i9hfx55182lr-python3.12-httpx-0.28.1/bin'':'/':'}
PATH='/nix/store/7km6fc1gpadidh00h070i9hfx55182lr-python3.12-httpx-0.28.1/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/70v0afid822m08v9c6qqfgzhykshprzy-python3.12-umu-launcher-unwrapped-1.2.5/bin'':'/':'}
PATH='/nix/store/70v0afid822m08v9c6qqfgzhykshprzy-python3.12-umu-launcher-unwrapped-1.2.5/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/wz0j2zi02rvnjiz37nn28h3gfdq61svz-python3-3.12.9/bin'':'/':'}
PATH='/nix/store/wz0j2zi02rvnjiz37nn28h3gfdq61svz-python3-3.12.9/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
export PYTHONNOUSERSITE='true'
exec -a "$0" "/nix/store/70v0afid822m08v9c6qqfgzhykshprzy-python3.12-umu-launcher-unwrapped-1.2.5/bin/.umu-run-wrapped"  "$@" 

@LovingMelody
Copy link
Contributor

Bubble wrap does have an impact on the dependencies it's part of why nix packages can cause libGL errors iirc

@MattSturgeon
Copy link
Contributor

Hmm, is there an easy way to track the changes for the umu-run NixOS script? Or is it automatically generated by the build system and is guaranteed to be consistent across builds?

It is generated, however you could checkout different revisions of nixpkgs and build the wrapper to inspect/compare it.

That said, the umu-launcher wrapper is only responsible for setting up the bubble-wrap FHS environment. It seems more likely that something in the environment has changed, assuming it isn't something from the host environment causing issues.

umu-launcher-unwrapped umu-run script:

Yeah that inner wrapper is less exciting; it's just setting up PATH and PYTHONNOUSERSITE variables so that dependencies are available to the actual umu-run script. The outer umu-launcher wrapper is more involved (using bubblewrap to setup an FHS env).

To clarify, we have a few layers of indirection here:

  • upstream umu-run the script from this repo
  • the wrapper from umu-launcher-unwrapped: just adds stuff to PATH
  • the wrapper from umu-launcher: this sets up the FHS env then runs the wrapper from umu-launcher-unwrapped

The easiest way to debug this if you have nix installed (which you must, if you're using home-manager) is to clone the nixpkgs repo locally and checkout a few suspicious commits. If needed, you can use git bisect too.

With nixpkgs cloned locally and your terminal cd'd into the root of the nixpkgs tree, you can use nix build or nix-build (flake-based vs non-flake based commands) to build a package. Once built, it will be symlinked to ./result. Note: nix-build will probably be faster, as nix build will copy the entire nixpkgs tree into the nix store before doing anything else.

$ # Clone nixpkgs
$ git clone https://github.com/NixOS/nixpkgs.git
$ cd nixpkgs
$ # Build umu-launcher
$ nix-build -A umu-launcher
$ # Run umu-launcher
$ PROTONPATH=GE-Proton9-26 ./result/bin/umu-run ""

$ # Start a bisect for run and profit
$ git bisect start
$ git bisect bad  # (assuming you reproduced the issue)
$ git checkout 3f5198c5  # commit before #381047

$ # Rebuild & rerun:
$ nix-build -A umu-launcher
$ PROTONPATH=GE-Proton9-26 ./result/bin/umu-run ""
$ git bisect good  # (assuming the issue wasn't reproduced)

$ # Checkout the commit from #381047
$ git checkout fc333939
$ nix-build -A umu-launcher
$ PROTONPATH=GE-Proton9-26 ./result/bin/umu-run ""
$ git bisect bad  # (assuming you reproduced the issue)

If needed, you can edit the package definition directly at:

vim pkgs/by-name/um/umu-launcher/package.nix

(no need to mess with overlays)


Also, idk if you'll get any useful info from STEAM_LINUX_RUNTIME_LOG (etc)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants