Skip to content

Restore PATH for native non-Steam shortcuts - #290

Open
tslmy wants to merge 1 commit into
armada-os:mainfrom
tslmy:codex/native-launch-path
Open

Restore PATH for native non-Steam shortcuts#290
tslmy wants to merge 1 commit into
armada-os:mainfrom
tslmy:codex/native-launch-path

Conversation

@tslmy

@tslmy tslmy commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prepare a usable executable PATH for every game command, not only AppImages
  • preserve an existing native-launch PATH and the AppImage-specific append behavior
  • cover a native non-Steam launch whose Steam environment has no PATH

Symptom

On an AYN Thor, Heroic games launch from KDE Desktop Mode, but the built-in controller is not usable there. Adding the games to Steam as non-Steam shortcuts supplies Steam Input's virtual controller, but in Game Mode the shortcuts briefly report that they are running and then stop before the game appears.

For Caravan SandWitch, Heroic's bundled Legendary helper terminated with:

BrokenPipeError: [Errno 32] Broken pipe

The diagnosis, successful workaround, and end-user instructions are documented in this Discord thread.

Root cause

Steam can omit PATH from the environment of a non-Steam shortcut in Game Mode. The top-level native ARM64 Heroic executable still starts because Steam invokes it by absolute path, but Heroic's bundled Legendary/Python helper cannot reliably start its child processes; its multiprocessing resource-tracker pipe closes and the helper aborts with BrokenPipeError.

armada-game-launch already repairs an incomplete PATH for AppImages (the failure reported in #103), but only when an AppImage is present in the command line. Packaged native launchers such as /usr/lib64/heroic/heroic bypass that branch, so the missing environment variable reaches Heroic unchanged.

Fix

Generalize the existing path preparation so an absent or empty PATH is seeded with:

/usr/local/bin:/usr/bin:/bin

An existing PATH remains byte-for-byte unchanged for native commands. AppImages continue to have any missing standard paths appended for fusermount discovery. Per-game environment settings are still applied afterward, so an explicit user override keeps taking precedence.

Validation

Root-cause reproduction

  • Replayed Heroic's exact Steam launch environment: omitting PATH reproduced the Legendary BrokenPipeError; adding /usr/local/bin:/usr/bin:/bin let Legendary continue to authentication.

On-device OS-wide test

Tested the PR launcher directly on the same AYN Thor without building or flashing a new image:

  1. Installed the launcher from this branch as a root-owned file and bind-mounted it over /usr/libexec/armada/armada-game-launch.
  2. Removed /etc/armada/game-tweaks.json from the active configuration and verified it was absent, so neither game had the earlier per-game PATH workaround.
  3. Started each existing non-Steam shortcut through the running Steam Game Mode client.

Sanitized process evidence:

PER_GAME_TWEAKS
absent

# Caravan SandWitch
X:\Games\Heroic\CaravanSandWitch\CaravanSandWitch\Binaries\Win64\CaravanSandWitch-Win64-Shipping.exe
winedevice_pid=364864 opens /dev/input/event12

# Sherlock Holmes Chapter One
X:\Games\Heroic\SherlockHolmesChapter1\SH9\Binaries\Win64\SHCO.exe
winedevice_pid=365585 opens /dev/input/event12

Both games progressed past Heroic/Legendary into their real Windows executables, with no new BrokenPipeError. In both launches, Wine's winedevice.exe held Steam's virtual controller device at /dev/input/event12, confirming the Game Mode controller path was active. The games were tested sequentially and stopped afterward; Steam remained running.

Regression checks

  • Added a regression assertion for a native non-AppImage command with no inherited PATH.
  • bash -n tests/perf-settings-test.sh
  • python3 -m py_compile system_files/usr/libexec/armada/armada-game-launch
  • Focused launch-path regression checks on the modified module.

@tslmy
tslmy marked this pull request as ready for review August 20, 2026 18:40
@tslmy
tslmy marked this pull request as draft August 20, 2026 18:42
@tslmy
tslmy marked this pull request as ready for review August 20, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant