Skip to content

setup-steamcmd@v1.4.1#12

Merged
StephenHodgson merged 3 commits into
buildalon:mainfrom
rursache:fix/linux-steamcmd-self-update-path
May 31, 2026
Merged

setup-steamcmd@v1.4.1#12
StephenHodgson merged 3 commits into
buildalon:mainfrom
rursache:fix/linux-steamcmd-self-update-path

Conversation

@rursache

@rursache rursache commented May 31, 2026

Copy link
Copy Markdown
Contributor
  • fix(linux): symlink linux -> linux32 so steamcmd resolves after self-update

Problem

On Linux runners, the first time steamcmd is invoked after setup-steamcmd runs, it fails with:

steamcmd.sh[...]: Couldn't find steamcmd at /home/runner/work/_temp/steamcmd/linux/steamcmd, exiting
##[error]Process completed with exit code 1.

It reproduces in a matrix like:

- uses: buildalon/setup-steamcmd@v1
- shell: bash
  run: steamcmd +login "$USER" "$PASS" "$TOTP" +run_app_build app.vdf +quit

macOS and Windows are unaffected (this action already handles their bootstrap quirks — Windows' self-update relaunch exit code, etc.). Linux is the only failure.

Root cause

steamcmd self-updates on its first launch (this happens inside getVersion() during setup). After the update, Valve's steamcmd.sh re-execs itself via:

STEAMEXE="${STEAMROOT}/${STEAM_PLATFORM:-linux32}/steamcmd"

but the post-update layout leaves the actual binary under linux32/ while the re-exec resolves ${STEAMROOT}/linux/steamcmd — so the second invocation can't find the binary and exits 1. ${STEAMROOT} is path.dirname(steamcmd.sh), which on a cache miss is the download dir ($RUNNER_TEMP/steamcmd) — matching the error path above.

The action's own getVersion() (steamcmd.sh +quit) succeeds because it runs before this mismatch bites; the failure only surfaces on the next steamcmd call the consumer makes.

Fix

In the IS_LINUX branch of findOrDownload(), after writing the steamcmd wrapper, mirror linux32 -> linux next to steamcmd.sh (using path.dirname(tool), which is correct for both the cache-miss download dir and the cache-hit tool dir):

const steamRoot = path.dirname(tool);
const linux32Dir = path.join(steamRoot, 'linux32');
const linuxDir = path.join(steamRoot, 'linux');
// symlink linux -> linux32 if linux32 exists and linux doesn't

It's a no-op if linux32/ is absent (future layout changes) or if linux/ already exists, so it's safe across steamcmd versions.

How I diagnosed it

Hit this in a real 3-OS Steam deploy where Windows/macOS went green via this action but Linux failed. The CI logs showed steamcmd.sh re-execing .../linux/steamcmd while the binary sat at .../linux32/steamcmd, which lines up with the STEAM_PLATFORM:-linux32 resolution in Valve's steamcmd.sh. I then confirmed the fix by applying the equivalent ln -sfn linux32 linux as a workflow-level step right after setup-steamcmd — the Linux deploy went green on a real ubuntu-latest runner. This PR moves that workaround into the action so consumers don't need it.

Testing notes

  • npx tsc --noEmit is clean; dist/ rebuilt with ncc (per the build script).
  • I verified the equivalent symlink on a real ubuntu-latest GitHub runner (Linux Steam depot upload succeeded). I couldn't run the action's own matrix on Linux locally because steamcmd's 32-bit binary segfaults under amd64 emulation on Apple Silicon — happy to adjust if your CI surfaces anything.

…update

On Linux, steamcmd self-updates on first launch and steamcmd.sh then
re-execs ${STEAMROOT}/linux/steamcmd, but the binary stays under
linux32/. The second invocation fails with 'Couldn't find steamcmd at
.../linux/steamcmd'. Mirror linux32 -> linux next to steamcmd.sh so the
re-exec resolves.
@rursache rursache requested a review from a team as a code owner May 31, 2026 20:39
@StephenHodgson

Copy link
Copy Markdown
Member

Thank you! I'll get this releases by the end of the day

@StephenHodgson StephenHodgson changed the title fix(linux): symlink linux -> linux32 so steamcmd resolves after self-update setup-steamcmd@v1.4.1 May 31, 2026
@StephenHodgson

Copy link
Copy Markdown
Member

idk why codeQL didn't run. will bypass

@StephenHodgson StephenHodgson merged commit 2a16e8f into buildalon:main May 31, 2026
3 checks passed
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.

2 participants