Fail fast when compilation fails in the macOS launch script#197
Closed
domenix wants to merge 2 commits into
Closed
Fail fast when compilation fails in the macOS launch script#197domenix wants to merge 2 commits into
domenix wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS,
launch_modded.shlaunches the game even when script compilation fails. Sincesccalways 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 compiledfinal.redscripts, which is confusing when iterating on mods.Changes
sccCLI: check the compilation result viascc_get_successand 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 whensccfails, print the error to stderr, and show a native alert dialog viaosascriptso failures are visible when the script is run outside a terminal. Also launch the game viaopenon the app bundle so it starts as a regular app rather than a child process of the shell, and addset -euo pipefail.Testing
Verified on a real install (GOG build 2.31, Apple Silicon, macOS 26.5.1):
r6/scripts→sccexits 0, game launches normally, mods applied (verified in-game)..redspresent →sccexits 1, launch script prints the error, shows the alert dialog, and does not launch the game.final.redscriptsis left untouched.