Skip to content

Electron apps can't run in the Steam Linux Runtime (libcups) #579

Closed
@dfabulich

Description

@dfabulich

Your system information

  • Steam Runtime Version: soldier 0.20230228.42394
  • Distribution (e.g. Ubuntu 18.04): Steam Deck SteamOS 3.4.6
  • Link to your full system information (Help -> System Information) in a Gist: https://gist.github.com/dfabulich/5ee302908d2bd09ad38fca464ef8a6a2
  • Have you checked for system updates?: Yes
  • What compatibility tool are you using?: Steam Linux Runtime
  • If you are using Steam Linux Runtime for native Linux games: What versions are listed in SteamLinuxRuntime/VERSIONS.txt?
#Name	Version		Runtime	Runtime_Version	Comment
depot	0.20230216.0			# Overall version number
LD_LIBRARY_PATH	-	scout	-	# see ~/.steam/root/ubuntu12_32/steam-runtime/version.txt
scripts	0.20230216.0			# from steam-runtime-tools
  • 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.20230228.42394			# Overall version number
pressure-vessel	0.20230227.0	scout		# pressure-vessel-bin.tar.gz
scripts	0.20230227.0			# from steam-runtime-tools
soldier	0.20230228.42394	soldier	0.20230228.42394	# soldier_platform_0.20230228.42394/

Please describe your issue in as much detail as possible:

Apps that are built with Electron https://www.electronjs.org/ are unable to launch in the Steam Linux Runtime.

I first encountered this issue while attempting to use the Steam Linux Runtime on my Steam Deck with a game that has a working native Linux build, but it crashes on startup when I use the option to "Force the use of a specific Steam Play compatibility tool" and I select "Steam Linux Runtime."

But furthermore, I can provide instructions to build a basic "Hello, World" Electron app, and show that it crashes in the same way as my game.

As you'll see, the problem is that Steam Linux Runtime is missing libcups, part of the CUPS printing server. https://openprinting.github.io/cups/

Ideally, Steam games "shouldn't" require CUPS, because they shouldn't need to print anything, but Electron apps embed a copy of the Chromium browser, which does require CUPS support. Thus, Electron apps are unable to run in Steam Linux Runtime.

EDIT: We've found a workaround. #579 (comment)

Steps for reproducing this issue:

I'll provide two methods to reproduce the issue. The first method to reproduce the issue is to launch my game. The other method is to launch a "Hello, World" Electron app, built from scratch.

Method 1: Launch my game

  1. On Steam Deck, download my game, SLAMMED https://store.steampowered.com/app/343370/SLAMMED/ (you can test with the Demo if you don't want to buy the full game)
  2. In the Steam Library, click the Gear --> Properties --> Compatibility
  3. Check the box "Force the use of a specific Steam Play compatibility tool" and select "Steam Linux Runtime."
  4. Launch the game. It will crash on startup.

Following the instructions at https://github.com/ValveSoftware/steam-runtime/blob/master/doc/reporting-steamlinuxruntime-bugs.md I switched to Desktop mode, launched a Konsole, and ran Steam with STEAM_LINUX_RUNTIME_LOG=1 steam. Then, I launched SLAMMED again, and found the debug log at this path: /home/deck/.local/share/Steam/steamapps/common/SteamLinuxRuntime_solder/var/slr-app343370-t20230327T114647.log. The log is here as a gist: https://gist.github.com/dfabulich/66f22fdf45f1c6e24124cdeece8f1574

The crucial line is on line 195:

/home/deck/.local/share/Steam/steamapps/common/SLAMMED/SLAMMED: symbol lookup error: /home/deck/.local/share/Steam/steamapps/common/SLAMMED/SLAMMED: undefined symbol: cupsEnumDests

Method 2: Launch a "Hello, World" empty Electron app on Steam Deck

First, you'll need to set a password for the deck sudo user. Press the Steam button, Power --> Desktop Mode. Then launch System Settings --> Users --> Steam Deck User --> Change Password and set a password.

To use Electron, you'll first need to install nodejs and npm. Instructions are as follows:

sudo steamos-readonly disable
sudo pacman-key --init
sudo pacman -Sy --noconfirm archlinux-keyring
sudo pacman -Su --noconfirm
sudo pacman -S --noconfirm libuv c-ares nodejs
node --version
sudo pacman -Rs --noconfirm npm
sudo pacman -S --noconfirm npm
npm --version

Once you have those, you'll be able to follow steps to set up a basic Electron app. These steps are documented here: https://www.electronforge.io/

cd ~
npm init electron-app@latest my-app
cd my-app
npm start

To build your app for distribution, you'll need to edit the forge.config.js file in your new my-app directory. You'll need to remove the sections about building .deb and .rpm files, and replace the word darwin with linux. I've provided an example of this in this Git repository: https://github.com/dfabulich/hello-world-electron-app using this forge.config.js file: https://github.com/dfabulich/hello-world-electron-app/blob/main/forge.config.js

(You could, if you wish, check out my Git repository and use that, instead, but I wanted to provide trivial steps to reproduce it, so you can trust that I didn't do anything weird.)

With that done, you can npm run make to build the Linux app. You can run ./out/my-app/linux-x64/my-app to launch the app.

So far, so good. Now, try to run it in Steam Linux Runtime soldier. We'll start by launching xterm in the solder SLR, following instructions here: https://gitlab.steamos.cloud/steamrt/soldier/platform/#running-the-steam-container-runtime-without-steam

cd ~
./.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/run-in-soldier -- xterm

In the xterm:

cd my-app
./out/my-app/linux-x64/my-app

The app will crash immediately with this error:

./out/my-app/linux-x64/my-app: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory

Since libcups is missing in the container, the app fails to start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions