fix(builder): on Linux a game started by the launcher has its lines in longshot_log.txt again #3130

Merged
HumanBean merged 2 commits from llun/Longshot:fix/linux-launcher-game-log into main 2026-12-03 23:47:17 +00:00
Member

Summary

On Linux, a game started with the Launcher's Play button leaves an empty longshot_log.txt: at most the builder's own lines, none of the game's. So the Insert menu's Bug report sends empty logs and cannot say where the player is.

How to see it on main: on Linux, start the game from the Launcher (or longshot-builder play --profile <p> --output json) and open longshot_log.txt in the game folder's logs folder. By the code, every nightly from 1007 on has this. A player's bug report from nightly-1041 had two logs of 172 bytes each, one builder line in each.

Why: #2822 made the log the builder's: it copies what reaches its standard error into the file. With --output json, json_output::Output::attach gave the game a standard error pipe of its own (since #2688), so the game's lines became JSON events and never reached the log. Windows does not show it, because its sandbox starts the game with its own pipes and writes the game's standard error to the builder's.

What changes: attach takes only the game's standard output, where the start-up events are. The game's standard error is left alone, so it reaches the log and the builder's standard error. That is what sandbox.md already says, and what Windows already does. build-events.md is updated.

The log is also finished before after_game runs, where it was finished after: the crash record and its report are written from the log, and would miss the game's last lines (BeanBot's L1).

#2741 fixed a similar loss before #2822. Prior work for this one: none found (json_output, StderrTee, redacting_tee, longshot_log, "game log", "empty log"; Longshot and LongshotLauncher).

Read first: Output::attach in builder/crates/longshot-builder/src/play/json_output.rs, then start in play.rs (the tee, attach, and where the tee is dropped).

Testing

The real game has not run with this change. The fault is on Linux only and this PC has no Linux game build; a Windows run does not go through the changed line. Opened without a game run (--force) at the request of the person I work for.

Tested:

  • Linux (WSL2 Ubuntu 24.04, kernel 6.18.58), the real longshot-builder playing a profile with --output json, a shell script standing in for the game that writes two lines to its standard error (one_copy.rs's setup, changed in a throwaway copy). main @ 6318f4056: longshot_log.txt is empty and both lines are JSON events. This PR's first version, 5784b19c7: both lines are in longshot_log.txt, and game_started still arrives as an event.
  • The new test the_games_stderr_reaches_its_log runs a builder process and a game process: the game's standard error line must be in the log, and its game_ready on the builder's standard output. On Linux (WSL), the test's commit alone (main's code) fails with an empty log; with the fix it passes, 20 of 20 runs. On Windows it passes with the fix.
  • The second new test (tests/game_log.rs, Linux) plays a profile with the real builder and --output json; the script in the game's place writes a line, then a last line with no end, and exits 1. Both must be in longshot_log.txt, and the crash record must have seen the last one (log_tail_fatal: yes). On Linux (WSL): the test's commit alone (main's code) fails, the log being empty; with the fix it passes, 20 of 20 runs; with the fix but the log finished after the record, it fails (log_tail_fatal: no).
  • Linux (WSL): cargo test -p longshot-builder: all pass but installed_versions_reuse_their_own_builds_with_one_profile (one_copy.rs:149), which fails the same way on main 6318f4056 (mods_recorded, from #3105). cargo clippy -p longshot-builder --all-targets --no-deps -D warnings is clean. cargo test -p build-core passed on the first version; its clippy failure on main is not touched.
  • Windows 11 (gnullvm, llvm-mingw): cargo test -p longshot-builder: 84 of 84. Clippy as above: clean. run_all.py, on the first version: 836 of 837 pass. The one failure is test_run_all_junit, because the test_utf8_paths it runs fails on main since #3093. An earlier run that stopped after 273 checks (too long a command line) had 2 failures whose names were not kept.
  • main does not compile on Windows since #3113, so the Windows runs had that one line of #3110 (super::note_lines) for the run only. It is not in this PR.
  • All of these ran on main 6318f4056. The branch is now on f2cd2f4b3, which changes nothing under builder/; they were not run again there.

Not run: test_utf8_paths and test_cursor_hidden_linux (they fail on main, other code), and test_lifter but for longshot-builder's tests and clippy above.

Still to test:

  • Linux, any GPU: start the game from the Launcher, load a save, make a Bug report; expecting the game's lines in longshot_log.txt, and the report naming the map (by hand)
  • Linux: the Launcher's start-up screen still shows shader and pipeline progress and goes away when the game is ready (by hand)
  • Windows: the same start from the Launcher, expecting the log as before (by hand)

Measurements

Nothing to measure in the game: this changes which pipe the game's log lines take, on Linux with --output json only. One thread of the builder and the JSON wrapping of each log line go; no game or renderer code changes. The effect is the log's content, in Testing.

Risks

  • The Launcher's last-launch.log on Linux no longer keeps the game's log lines once the game is running: they come as plain standard error, which the Launcher records only until then. Until the game is running it still has them. longshot_log.txt has all of them, as on Windows. Reports that only attach last-launch.log will show less.
  • A reader of --output json that took the game's standard error from log events (source game, stream stderr) gets it on the builder's standard error instead.
  • The lines the Launcher gets this way now have the player's home folder and name taken out, as in the log.
  • The builder's own message about a crash (--output text) comes after the log is finished, so it is on the standard error but no longer at the end of longshot_log.txt. This is so on Windows too.
  • Saves, settings and caches: nothing. Reverting is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Not in the real game: a Linux-only fault, no Linux game build here. The real builder ran on Linux with a stand-in game.)
  • mise run test passes (any failure that also fails on main is named). (Not run whole: test_lifter ran only for longshot-builder; see Testing.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary On Linux, a game started with the Launcher's Play button leaves an empty `longshot_log.txt`: at most the builder's own lines, none of the game's. So the Insert menu's Bug report sends empty logs and cannot say where the player is. **How to see it on main:** on Linux, start the game from the Launcher (or `longshot-builder play --profile <p> --output json`) and open `longshot_log.txt` in the game folder's logs folder. By the code, every nightly from 1007 on has this. A player's bug report from nightly-1041 had two logs of 172 bytes each, one builder line in each. **Why:** https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822 made the log the builder's: it copies what reaches its standard error into the file. With `--output json`, `json_output::Output::attach` gave the game a standard error pipe of its own (since https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2688), so the game's lines became JSON events and never reached the log. Windows does not show it, because its sandbox starts the game with its own pipes and writes the game's standard error to the builder's. **What changes:** `attach` takes only the game's standard output, where the start-up events are. The game's standard error is left alone, so it reaches the log and the builder's standard error. That is what `sandbox.md` already says, and what Windows already does. `build-events.md` is updated. The log is also finished before `after_game` runs, where it was finished after: the crash record and its report are written from the log, and would miss the game's last lines (BeanBot's L1). https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2741 fixed a similar loss before #2822. Prior work for this one: none found (`json_output`, `StderrTee`, `redacting_tee`, `longshot_log`, "game log", "empty log"; Longshot and LongshotLauncher). Read first: `Output::attach` in `builder/crates/longshot-builder/src/play/json_output.rs`, then `start` in `play.rs` (the tee, `attach`, and where the tee is dropped). ## Testing **The real game has not run with this change.** The fault is on Linux only and this PC has no Linux game build; a Windows run does not go through the changed line. Opened without a game run (`--force`) at the request of the person I work for. **Tested:** - **Linux (WSL2 Ubuntu 24.04, kernel 6.18.58), the real `longshot-builder`** playing a profile with `--output json`, a shell script standing in for the game that writes two lines to its standard error (`one_copy.rs`'s setup, changed in a throwaway copy). main @ 6318f4056: `longshot_log.txt` is empty and both lines are JSON events. This PR's first version, 5784b19c7: both lines are in `longshot_log.txt`, and `game_started` still arrives as an event. - **The new test** `the_games_stderr_reaches_its_log` runs a builder process and a game process: the game's standard error line must be in the log, and its `game_ready` on the builder's standard output. On Linux (WSL), the test's commit alone (main's code) fails with an empty log; with the fix it passes, 20 of 20 runs. On Windows it passes with the fix. - **The second new test** (`tests/game_log.rs`, Linux) plays a profile with the real builder and `--output json`; the script in the game's place writes a line, then a last line with no end, and exits 1. Both must be in `longshot_log.txt`, and the crash record must have seen the last one (`log_tail_fatal: yes`). On Linux (WSL): the test's commit alone (main's code) fails, the log being empty; with the fix it passes, 20 of 20 runs; with the fix but the log finished after the record, it fails (`log_tail_fatal: no`). - **Linux (WSL):** `cargo test -p longshot-builder`: all pass but `installed_versions_reuse_their_own_builds_with_one_profile` (`one_copy.rs:149`), which fails the same way on main 6318f4056 (`mods_recorded`, from https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3105). `cargo clippy -p longshot-builder --all-targets --no-deps -D warnings` is clean. `cargo test -p build-core` passed on the first version; its clippy failure on main is not touched. - **Windows 11 (gnullvm, llvm-mingw):** `cargo test -p longshot-builder`: 84 of 84. Clippy as above: clean. `run_all.py`, on the first version: 836 of 837 pass. The one failure is `test_run_all_junit`, because the `test_utf8_paths` it runs fails on main since https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3093. An earlier run that stopped after 273 checks (too long a command line) had 2 failures whose names were not kept. - main does not compile on Windows since https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3113, so the Windows runs had that one line of https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3110 (`super::note_lines`) for the run only. It is not in this PR. - All of these ran on main 6318f4056. The branch is now on f2cd2f4b3, which changes nothing under `builder/`; they were not run again there. **Not run:** `test_utf8_paths` and `test_cursor_hidden_linux` (they fail on main, other code), and `test_lifter` but for `longshot-builder`'s tests and clippy above. **Still to test:** - Linux, any GPU: start the game from the Launcher, load a save, make a Bug report; expecting the game's lines in `longshot_log.txt`, and the report naming the map (by hand) - Linux: the Launcher's start-up screen still shows shader and pipeline progress and goes away when the game is ready (by hand) - Windows: the same start from the Launcher, expecting the log as before (by hand) ## Measurements Nothing to measure in the game: this changes which pipe the game's log lines take, on Linux with `--output json` only. One thread of the builder and the JSON wrapping of each log line go; no game or renderer code changes. The effect is the log's content, in Testing. ## Risks - **The Launcher's `last-launch.log` on Linux** no longer keeps the game's log lines once the game is running: they come as plain standard error, which the Launcher records only until then. Until the game is running it still has them. `longshot_log.txt` has all of them, as on Windows. Reports that only attach `last-launch.log` will show less. - A reader of `--output json` that took the game's standard error from `log` events (`source` `game`, `stream` `stderr`) gets it on the builder's standard error instead. - The lines the Launcher gets this way now have the player's home folder and name taken out, as in the log. - The builder's own message about a crash (`--output text`) comes after the log is finished, so it is on the standard error but no longer at the end of `longshot_log.txt`. This is so on Windows too. - Saves, settings and caches: nothing. Reverting is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. *(Not in the real game: a Linux-only fault, no Linux game build here. The real builder ran on Linux with a stand-in game.)* - [ ] `mise run test` passes (any failure that also fails on `main` is named). *(Not run whole: `test_lifter` ran only for `longshot-builder`; see Testing.)* - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fails on main on Linux: with --output json the game's standard error is a
pipe of its own, so its lines never reach longshot_log.txt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): on Linux a game started by the launcher has its lines in longshot_log.txt again
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5784b19c74
With --output json the game's standard error was a pipe of its own, so
the builder's log got none of its lines. Only its standard output is
relayed now; its standard error goes to the log, as it does on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • issue #2484 Game: Game log is missing on Arch Linux Desktop Mode — Open report of missing Linux game log; likely same symptom.
  • PR #2741 fix(host): a game started by longshot-builder play writes its own longshot_log.txt (LONGSHOT_OWN_LOG) — Merged related builder JSON stderr/log handling; this PR addresses remaining Linux path.
Possibly related, for context: - issue #2484 Game: Game log is missing on Arch Linux Desktop Mode — Open report of missing Linux game log; likely same symptom. - PR #2741 fix(host): a game started by longshot-builder play writes its own longshot_log.txt (LONGSHOT_OWN_LOG) — Merged related builder JSON stderr/log handling; this PR addresses remaining Linux path.
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. The Linux pipe change restores game lines to the log in the stand-in run, but crash reporting can read the log before the tee has finished writing it. The real launcher and game path still needs a Linux run.

The builder now sends the game's stderr through its existing redacting log tee while continuing to forward startup events from stdout. This restores the intended log on Linux, but changes the JSON output contract and can leave crash reports with an incomplete log.

Blocking (1): must change before merging.

  1. L1 builder/crates/longshot-builder/src/play/json_output.rs:16: The newly routed game stderr can still be pending in the tee when crash reporting reads the log. (more on the line) Do: Finish and drop the stderr tee after the game exits and before after_game reads the log; cover that ordering with a test using final stderr output.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2: The real Linux launcher and game path has not been checked. When: The stand-in writes synthetic stderr and a startup event, but does not exercise the game's actual startup and bug-report flow through the launcher. Do: On Linux, start the real game from the Launcher, verify startup progress and handoff, then load a save and check that a bug report contains the game log and identifies the map.

@fix can do L1.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes for the stand-in: on Linux, the reported base run produced an empty log and the head run recorded both stderr lines while retaining game_started. The real game and launcher have not yet been tested.

Other systems: The change affects JSON play on Linux and changes where consumers receive game stderr; the description notes the loss of post-start lines from the Launcher's last-launch.log. Windows uses its sandbox relay and passed the reported builder tests, but its real launcher path has not been run. GPU rendering, saves, audio and input are not changed by the diff.

Switches: No player or developer switches added, changed or removed. The test adds two process-role environment variables, used only by the test.

Reviewed: 5784b19c74 against 6318f4056e: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed files in full, both commits, and the relevant play, log tee and crash-report paths. Skimmed the surrounding builder code and the reported runs. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent; the network was unavailable.; nothing run (a code review).

Checked and fine:

  • The synthetic test checks both a game stderr line in the log and a forwarded game_ready event; the author reports it fails on the base and passes on the head.
  • Both commits record AI assistance. The diff contains no game-derived files, generated output, renderer API changes or switch-table changes.
  • Startup events remain on the stdout relay, and the tee bounds its copy queue so a slow stderr reader does not stall the game.

Testing: Read-only review; no commands from the project, builds or tests were run. The author reports Linux stand-in and Windows builder test results; CI was still running.

Overlaps and merge order: No overlapping pull request found in the supplied material; the network was closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The Linux pipe change restores game lines to the log in the stand-in run, but crash reporting can read the log before the tee has finished writing it. The real launcher and game path still needs a Linux run. The builder now sends the game's stderr through its existing redacting log tee while continuing to forward startup events from stdout. This restores the intended log on Linux, but changes the JSON output contract and can leave crash reports with an incomplete log. **Blocking (1)**: must change before merging. 1. **L1** `builder/crates/longshot-builder/src/play/json_output.rs:16`: The newly routed game stderr can still be pending in the tee when crash reporting reads the log. (more on the line) **Do:** Finish and drop the stderr tee after the game exits and before after_game reads the log; cover that ordering with a test using final stderr output. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The real Linux launcher and game path has not been checked. *When:* The stand-in writes synthetic stderr and a startup event, but does not exercise the game's actual startup and bug-report flow through the launcher. **Do:** On Linux, start the real game from the Launcher, verify startup progress and handoff, then load a save and check that a bug report contains the game log and identifies the map. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the stand-in: on Linux, the reported base run produced an empty log and the head run recorded both stderr lines while retaining game_started. The real game and launcher have not yet been tested. **Other systems:** The change affects JSON play on Linux and changes where consumers receive game stderr; the description notes the loss of post-start lines from the Launcher's last-launch.log. Windows uses its sandbox relay and passed the reported builder tests, but its real launcher path has not been run. GPU rendering, saves, audio and input are not changed by the diff. **Switches:** No player or developer switches added, changed or removed. The test adds two process-role environment variables, used only by the test. **Reviewed:** 5784b19c74bf against 6318f4056eed: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed files in full, both commits, and the relevant play, log tee and crash-report paths. Skimmed the surrounding builder code and the reported runs. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent; the network was unavailable.; nothing run (a code review). **Checked and fine:** - The synthetic test checks both a game stderr line in the log and a forwarded game_ready event; the author reports it fails on the base and passes on the head. - Both commits record AI assistance. The diff contains no game-derived files, generated output, renderer API changes or switch-table changes. - Startup events remain on the stdout relay, and the tee bounds its copy queue so a slow stderr reader does not stall the game. **Testing:** Read-only review; no commands from the project, builds or tests were run. The author reports Linux stand-in and Windows builder test results; CI was still running. **Overlaps and merge order:** No overlapping pull request found in the supplied material; the network was closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -18,3 +16,1 @@
thread::Builder::new().spawn(move || relay(stdout, "stdout"))?,
thread::Builder::new().spawn(move || relay(stderr, "stderr"))?,
]))
game.stdout(Stdio::from(out));
Member

L1 (blocking): The newly routed game stderr can still be pending in the tee when crash reporting reads the log.

When: On Linux JSON play, the game writes its final diagnostics and exits. Player::start calls after_game before dropping _stderr_tee, while the tee pumps asynchronously; after_run can therefore read and send a log missing those diagnostics, or read it before its capped tail is joined.

Do: Finish and drop the stderr tee after the game exits and before after_game reads the log; cover that ordering with a test using final stderr output.

**L1** (blocking): The newly routed game stderr can still be pending in the tee when crash reporting reads the log. *When:* On Linux JSON play, the game writes its final diagnostics and exits. Player::start calls after_game before dropping _stderr_tee, while the tee pumps asynchronously; after_run can therefore read and send a log missing those diagnostics, or read it before its capped tail is joined. **Do:** Finish and drop the stderr tee after the game exits and before after_game reads the log; cover that ordering with a test using final stderr output.
llun force-pushed fix/linux-launcher-game-log from 5784b19c74
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to f16f3038e2
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Failing after 6s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m33s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 11m2s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 14m15s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m20s
CI / Website build and checks (pull_request) Failing after 1m14s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 50m49s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
2026-12-03 23:34:28 +00:00
Compare
Author
Member

f16f3038e answers the review, and the branch is rebased onto main f2cd2f4b3 (no conflicts; that commit changes nothing under builder/).

L1 is right, and fixed. Player::start called after_game before the log was finished. The log is now finished first: stderr_tee is dropped after the channel ends and before after_game.

The new test tests/game_log.rs (Linux) plays a profile with the real builder and --output json. A script stands in for the game: it writes a line, then FATAL: the last line with no line end, and exits 1. Both must be in the log, and the crash record must say log_tail_fatal: yes.

On Linux (WSL):

  • main's code: fails, the log is empty
  • with the fix: passes, 20 of 20 runs
  • with the fix, but the log finished after the record: fails, log_tail_fatal: no

cargo test -p longshot-builder and its clippy, before the rebase:

  • Windows: 84 of 84, clippy clean. The new test is Linux only. Run with the one line of #3110 that main needs to compile there; it is not in this PR.
  • Linux (WSL): all pass but installed_versions_reuse_their_own_builds_with_one_profile, which fails the same way on main 6318f4056. Clippy clean.

One effect, now under Risks: with --output text, the builder's own message about a crash comes after the log is finished. It is still on the standard error, but no longer at the end of longshot_log.txt.

L2 is still open. The real game has not run on Linux with this, so it stays WIP.

#2484 (missing log on Arch) is v3.1.1, from before #2822, so it is not this fault.

f16f3038e answers the review, and the branch is rebased onto main f2cd2f4b3 (no conflicts; that commit changes nothing under `builder/`). **L1 is right, and fixed.** `Player::start` called `after_game` before the log was finished. The log is now finished first: `stderr_tee` is dropped after the channel ends and before `after_game`. The new test `tests/game_log.rs` (Linux) plays a profile with the real builder and `--output json`. A script stands in for the game: it writes a line, then `FATAL: the last line` with no line end, and exits 1. Both must be in the log, and the crash record must say `log_tail_fatal: yes`. On Linux (WSL): - main's code: fails, the log is empty - with the fix: passes, 20 of 20 runs - with the fix, but the log finished after the record: fails, `log_tail_fatal: no` `cargo test -p longshot-builder` and its clippy, before the rebase: - Windows: 84 of 84, clippy clean. The new test is Linux only. Run with the one line of https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3110 that main needs to compile there; it is not in this PR. - Linux (WSL): all pass but `installed_versions_reuse_their_own_builds_with_one_profile`, which fails the same way on main 6318f4056. Clippy clean. One effect, now under Risks: with `--output text`, the builder's own message about a crash comes after the log is finished. It is still on the standard error, but no longer at the end of `longshot_log.txt`. **L2 is still open.** The real game has not run on Linux with this, so it stays WIP. https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2484 (missing log on Arch) is v3.1.1, from before https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822, so it is not this fault.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The tee now finishes before crash reporting reads the log, and the stand-in game tests exercise the missing and final lines. The real Linux launcher and game path still needs a run. Recommend approval; not approved on the forge.

Linux games started through the launcher should again put their stderr in longshot_log.txt while startup events remain on the JSON stream. The change also finishes the log before crash reporting; the launcher’s last-launch.log retains fewer game lines after startup.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2: The real Linux launcher and game path has not been checked. When: The stand-in writes synthetic stderr and a startup event, but does not exercise the game's actual startup and bug-report flow through the launcher. Do: On Linux, start the real game from the Launcher, verify startup progress and handoff, then load a save and check that a bug report contains the game log and identifies the map.

Since the last review (on 5784b19c74)
Resolved: L1 (The newly routed game stderr can still be pending in the tee when crash reporting reads th…)
Still open: L2 (The real Linux launcher and game path has not been checked.)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the real game. The author reports the stand-in game test passed 20 of 20 Linux runs with the fix and failed on main; the real Linux launcher and game have not been run.

Other systems: Windows uses its sandbox relay and the tee is now finished before crash reporting there too; the author reports 84 builder tests passed with a separate main-branch compile fix applied. Linux launcher startup progress and bug reports still need a real-game check. JSON consumers no longer receive game stderr as log events.

Switches: No production switches added, changed or removed.

Reviewed: f16f3038e2 against f2cd2f4b34: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full diff, json_output.rs and game_log.rs, and the relevant play.rs and game_log.rs paths. The full play.rs and build-events.md output was truncated; other related code and recorded runs were skimmed. No docs/review-checklist.md was present.; nothing run (a code review).

Checked and fine:

  • The new integration test checks an unterminated final game line and the crash record derived from it.
  • Startup events remain forwarded from game stdout.

Testing: No commands that run project code were executed. The author reports Linux stand-in and Windows builder tests; CI is still running.

Overlaps and merge order: None identified in the supplied record.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left (a run of the change itself). The tee now finishes before crash reporting reads the log, and the stand-in game tests exercise the missing and final lines. The real Linux launcher and game path still needs a run. Recommend approval; not approved on the forge. Linux games started through the launcher should again put their stderr in longshot_log.txt while startup events remain on the JSON stream. The change also finishes the log before crash reporting; the launcher’s last-launch.log retains fewer game lines after startup. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2**: The real Linux launcher and game path has not been checked. *When:* The stand-in writes synthetic stderr and a startup event, but does not exercise the game's actual startup and bug-report flow through the launcher. **Do:** On Linux, start the real game from the Launcher, verify startup progress and handoff, then load a save and check that a bug report contains the game log and identifies the map. **Since the last review** (on 5784b19c74bf) Resolved: L1 (The newly routed game stderr can still be pending in the tee when crash reporting reads th…) Still open: L2 (The real Linux launcher and game path has not been checked.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the real game. The author reports the stand-in game test passed 20 of 20 Linux runs with the fix and failed on main; the real Linux launcher and game have not been run. **Other systems:** Windows uses its sandbox relay and the tee is now finished before crash reporting there too; the author reports 84 builder tests passed with a separate main-branch compile fix applied. Linux launcher startup progress and bug reports still need a real-game check. JSON consumers no longer receive game stderr as log events. **Switches:** No production switches added, changed or removed. **Reviewed:** f16f3038e28b against f2cd2f4b34f9: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full diff, json_output.rs and game_log.rs, and the relevant play.rs and game_log.rs paths. The full play.rs and build-events.md output was truncated; other related code and recorded runs were skimmed. No docs/review-checklist.md was present.; nothing run (a code review). **Checked and fine:** - The new integration test checks an unterminated final game line and the crash record derived from it. - Startup events remain forwarded from game stdout. **Testing:** No commands that run project code were executed. The author reports Linux stand-in and Windows builder tests; CI is still running. **Overlaps and merge order:** None identified in the supplied record. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(builder): on Linux a game started by the launcher has its lines in longshot_log.txt again to fix(builder): on Linux a game started by the launcher has its lines in longshot_log.txt again 2026-12-03 23:47:12 +00:00
HumanBean deleted branch fix/linux-launcher-game-log 2026-12-03 23:47:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3130
No description provided.