Skip to content

Fail fast when compilation fails in the macOS launch script#197

Closed
domenix wants to merge 2 commits into
jac3km4:1.0.xfrom
domenix:fail-fast-macos-launcher
Closed

Fail fast when compilation fails in the macOS launch script#197
domenix wants to merge 2 commits into
jac3km4:1.0.xfrom
domenix:fail-fast-macos-launcher

Conversation

@domenix

@domenix domenix commented Jul 25, 2026

Copy link
Copy Markdown

Problem

On macOS, launch_modded.sh launches the game even when script compilation fails. Since scc always exited with code 0 (the compilation result was discarded), the script had no way to detect the failure — the game would silently start with the last successfully compiled final.redscripts, which is confusing when iterating on mods.

Changes

  • scc CLI: check the compilation result via scc_get_success and exit with code 1 on fatal errors (previously the result was freed without inspection and the exit code was always 0).
  • launch_modded.sh: abort the launch when scc fails, print the error to stderr, and show a native alert dialog via osascript so failures are visible when the script is run outside a terminal. Also launch the game via open on the app bundle so it starts as a regular app rather than a child process of the shell, and add set -euo pipefail.

Testing

Verified on a real install (GOG build 2.31, Apple Silicon, macOS 26.5.1):

  • Clean r6/scriptsscc exits 0, game launches normally, mods applied (verified in-game).
  • With a syntactically broken .reds present → scc exits 1, launch script prints the error, shows the alert dialog, and does not launch the game. final.redscripts is left untouched.

domenix added 2 commits July 25, 2026 10:15
The CLI previously discarded the compilation result and always exited
with code 0, making it impossible for callers (such as the macOS launch
script) to detect failures. Check the result via scc_get_success and
exit with code 1 on fatal errors.
launch_modded.sh previously launched the game even if scc failed,
silently running with the last successfully compiled scripts. Now it
stops, prints the error, and shows an alert dialog instead. Also launch
the app bundle via 'open' so the game starts as a regular app instead
of a child of the shell.
@domenix domenix closed this Jul 25, 2026
@domenix
domenix deleted the fail-fast-macos-launcher branch July 25, 2026 08:17
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