scripts/linux-boot/boot.sh: validate mode, timeout, and prerequisites upfront #2298
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2298
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-boot-sh-safety"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: LINUX-BOOT-SH-MODE-TIMEOUT-PATH-AND-ARG-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192730067)
What and why
-h/--helpsupport (exit0) and upfront validation of positional argument count, mode (dry-run|init|run), and positive integerSECS(^[1-9][0-9]*$) inscripts/linux-boot/boot.shbefore creating output directories (exit2on invalid input).$GTA6RTexists as a regular file and verify required commands ($UNSHARE,$TIMEOUTinrunmode, and$WINE) exist before creating$OUT/traces,$OUT/overlay, and$OUT/cache/nv.LEONIDA_OUT,LEONIDA_GAME_DIR,LEONIDA_GAME_WIN,LEONIDA_EXE,LEONIDA_OVERLAY_WIN,LEONIDA_TRACE_WIN,PYTHON3,UNSHARE,TIMEOUT) with production defaults preserved, and guard optionalboot_trace.pysummary generation so the guest exit code is always preserved cleanly.tests/test_linux_boot.py.Tested
python -I tests/test_linux_boot.py -v: 4 passed, 0 failed via Git Bash (detachedupstream/mainbaseline with only the new test file fails with 3 failures).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tests/test_linux_boot.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.#2298 | head 9f86f4b46b71320abc042ae8d0825a6684e901df (merged cleanly with main 3ca0707dd) |
python -I tests/test_linux_boot.py| red on main:FAILED (failures=3)(1 != 0on--help/ hardcoded/opt/leonidamkdirand1 != 2on missinggta6rt) | green on PR+main:4 tests OK(-k test_dry_run_and_run_forward_args_timeout_and_exit_code:1 test OK) | Windows 11, Python 3.12.10 (Git Bash) | AI-assisted: yesAudited
scripts/linux-boot/boot.shandtests/test_linux_boot.py(--help,dry-run|init|runmode and positive-integerSECSchecks,GTA6RT/UNSHARE/TIMEOUT/WINEprerequisite checks before creating trace directories, and exit-code preservation across optionalboot_trace.py), and verified bothPR + main(3ca0707dd) and a combinedmain + #2305 + #2298merge (0conflicts;4 OK+4 OK). Also passedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.py.Red/green: tests/test_linux_boot.py fails 3 assertions on main (boot.sh accepts bad mode/timeout and missing gta6rt and creates dirs) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)