fix(dx): portable realpath in autoplay-batch.sh (python; works on macOS dispatch host + linux workers)

realpath -m (GNU) blew up on BSD realpath during dist:sim from plum. Now python os.path.realpath (cross platform, same -m semantics for non-existing RESULTS_DIR). Unblocks fleet sim verifs for p3-26 headless completeness.
This commit is contained in:
Natalie 2026-06-28 11:16:17 -04:00
parent 2014fd7ee5
commit 0f046463fd

View file

@ -106,10 +106,9 @@ fi
# Flatpak's sandboxed Godot resolves AUTO_PLAY_DIR against an unspecified CWD, # Flatpak's sandboxed Godot resolves AUTO_PLAY_DIR against an unspecified CWD,
# not the caller's shell CWD — a relative path silently produces 0-byte # not the caller's shell CWD — a relative path silently produces 0-byte
# meta.json / turn_stats.jsonl even when the game itself completes (game.log # meta.json / turn_stats.jsonl even when the game itself completes (game.log
# is fine because it's redirected host-side). realpath -m tolerates the path # is fine because it's redirected host-side). Use python realpath (portable
# not existing yet; it will be mkdir'd just below. Also ensures the /tmp # across macOS BSD + linux GNU; tolerates non-existing path like realpath -m).
# reject check that follows catches all forms (./tmp, ../tmp, etc). RESULTS_DIR="$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$RESULTS_DIR")"
RESULTS_DIR="$(realpath -m "$RESULTS_DIR")"
# Flatpak sandbox can't write to /tmp. Reject /tmp paths outright instead of # Flatpak sandbox can't write to /tmp. Reject /tmp paths outright instead of
# silently redirecting — persistent output belongs under the repo. # silently redirecting — persistent output belongs under the repo.