#229 FEX RootFS: Slow Steam/Game startup due to missing locales
Closed by neobrain. Opened by neobrain.

(I was pointed to this repo after asking where the image for fex-emu-rootfs-fedora was built; apologies if it's the wrong place!)

Problem description

Pressure-vessel (Steam's containerization helper) requires any locale set by the user through any LC_ env variable to be installed. Otherwise, during game startup (or Steam startup itself), PV will have to generate those locales on the fly, which adds a 5 second startup delay even for trivial applications.

The RootFS we distribute upstream via FEXRootFSFetcher bundles all locales and hence launches Steam/games faster. There is also a PV debug toggle PRESSURE_VESSEL_GENERATE_LOCALES=0 to disable the locale generation, but according to the Steam Linux Runtime maintainer there are games this causes problems with.

Steps to reproduce (METHOD A):

  1. Run ~/.steam/root/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/steam-runtime-launch-options -- ls (any steam-runtime-launch-options from other SLR versions will work too)
  2. Select "soldier 2.0" or "sniper 3.0" in the Container runtime (first combobox)
  3. Press run
  4. Observe that it prints pv-adverb[449]: W: Container startup will be faster if missing locales are created at OS level to the console

Steps to reproduce (METHOD B):

  1. Launch Steam
  2. Start any Linux-native x86 game
  3. Open webhelper-linux.txt and console-linux.txt in ~/.steam/root/logs, which should contain the pv-adverb[449]: W: Container startup will be faster if missing locales are created at OS level message

This should be fixed by 093f4032b7da6 . Build for Fedora 43 should become available in the next 1-3 days

A new RootFS updated landed for me today, but sadly the startup times are unchanged (~33s for Steam), and the PV warning is still printed in the log files.

Is it looking differently on your end?

I never tested the commits I just assumed I knew what the issue was (unavailable locale in the rootfs and presence of /usr/{lib,share}/locale in the rootfs hiding host locales.

Now I can reproduce locale generation and W: Container startup will be faster if missing locales are created at OS level only if I explicitly set an unavailable locale.

That's strange, I'm still seeing this output specifically:

setlocale "en_GB.utf8": No such file or directory
pv-locale-gen: Missing locale en_GB.utf8 (found in $LC_ADDRESS)
pv-locale-gen: Generating locale en_GB.utf8...
I CLONE_CLEAR_SIGHAND passed to clone3. Returning EINVAL.
I clone: Unsupported flags w/o CLONE_THREAD (Shared Resources), 4100
pv-locale-gen: Generated locale en_GB.UTF-8 successfully
pv-locale-gen: Generating locale en_US.utf8...
I CLONE_CLEAR_SIGHAND passed to clone3. Returning EINVAL.
I clone: Unsupported flags w/o CLONE_THREAD (Shared Resources), 4100
pv-locale-gen: Generated locale en_US.UTF-8 successfully
pv-adverb[392]: W: Container startup will be faster if missing locales are created at OS level

But en_GB.utf8 and en_US.utf8 are listed in localedef --list-archive /usr/lib/locale/locale-archive, both inside and outside FEXBash.

Is there any other place I would need to check to ensure the locales are available?

For reference, here's my locale output:

FEXBash@asahi:~> locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC=en_GB.utf8
LC_TIME=en_GB.utf8
LC_COLLATE="en_US.utf8"
LC_MONETARY=en_GB.utf8
LC_MESSAGES="en_US.utf8"
LC_PAPER=en_GB.utf8
LC_NAME=en_GB.utf8
LC_ADDRESS=en_GB.utf8
LC_TELEPHONE=en_GB.utf8
LC_MEASUREMENT=en_GB.utf8
LC_IDENTIFICATION=en_GB.utf8
LC_ALL=

Changing all those LC_ variables to en_US.utf8 made the issue go away, so I double-checked and indeed I didn't have the glibc-langpack-en package installed. Installing it makes it work for en_GB.utf8 as well!

Strangely enough, that package also bundles en_US locale files, so I'm not sure why that one was working fine but en_GB wasn't?

Anyway, as far as the RootFS is concerned it looks like we're all set, thanks a lot :)

Metadata Update from @neobrain:
- Issue status updated to: Closed (was: Open)

Metadata