From 5be7ed813fb38b9479c3591aa1524c463bb8e313 Mon Sep 17 00:00:00 2001 From: Oliver Ames Date: Fri, 6 Nov 2026 17:24:16 -0500 Subject: [PATCH] build_ipa.sh: the DMCommit and DMChain stamps overwrite an existing entry, so a project.yml that carries one prepares the app A project source a front end or a fork copy keeps can carry DMCommit in its Info.plist values; xcodegen writes it into Gen/Info.plist at the generate step, and the prepare then stopped at the stamp: "Add: :DMCommit Entry Already Exists", "[RED] build_ipa.sh exit code 1" (the Mario Kart World #1383 snapshot on the Duo, 2026-11-06, its prepare_xcode.log). The built commit belongs in the stamp, so it now falls back to Set: the same prepare succeeds and the app logs the real source and chain. Gen/Info.plist is regenerated at every prepare, so the replaced value does not outlive the build. Checked: bash -n passes; the Mario Kart World prepare that failed before now stamps both keys and finishes with the same Xcode project output ('source: ' in its prepare_xcode.log). --- dm/ios/tools/build_ipa.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dm/ios/tools/build_ipa.sh b/dm/ios/tools/build_ipa.sh index 57a16dbc23..dcd8d4d295 100755 --- a/dm/ios/tools/build_ipa.sh +++ b/dm/ios/tools/build_ipa.sh @@ -188,9 +188,10 @@ fi [ "${DM_COPY_ROMFS:-YES}" != NO ] || [ "$PREPARE_XCODE" != YES ] || echo "DM_COPY_ROMFS = NO" >> Gen/dm.xcconfig xcodegen generate -q > /dev/null || die "xcodegen" # DMCommit / DMChain: the checkout that built the app (+dirty with uncommitted changes to tracked files) and the shader chain it carries, which the host logs at start (main.c) +# A front end's or fork copy's project.yml can carry these keys into the generated Info.plist; PlistBuddy's Add refuses to overwrite an entry, so Add then Set (the built commit wins). COMMIT=$(git -C "$DM" rev-parse --short=12 HEAD 2> /dev/null) && { [ -z "$(git -C "$DM" status --porcelain --untracked-files=no 2> /dev/null)" ] || COMMIT=$COMMIT+dirty - /usr/libexec/PlistBuddy -c "Add :DMCommit string $COMMIT" Gen/Info.plist > /dev/null || die "DMCommit"; t "source: $COMMIT"; } -case "$MSLDIR" in b-*) /usr/libexec/PlistBuddy -c "Add :DMChain string ${MSLDIR#b-}" Gen/Info.plist > /dev/null || die "DMChain";; esac + /usr/libexec/PlistBuddy -c "Add :DMCommit string $COMMIT" Gen/Info.plist > /dev/null || /usr/libexec/PlistBuddy -c "Set :DMCommit $COMMIT" Gen/Info.plist > /dev/null || die "DMCommit"; t "source: $COMMIT"; } +case "$MSLDIR" in b-*) /usr/libexec/PlistBuddy -c "Add :DMChain string ${MSLDIR#b-}" Gen/Info.plist > /dev/null || /usr/libexec/PlistBuddy -c "Set :DMChain ${MSLDIR#b-}" Gen/Info.plist > /dev/null || die "DMChain";; esac # DM_METAL_CAPTURE=1: a development build that may write GPU frame captures (MetalCaptureEnabled; the host's DM_GPU_CAPTURE switch writes them to Documents/gpu_captures) if [ "${DM_METAL_CAPTURE:-0}" = 1 ]; then /usr/libexec/PlistBuddy -c "Add :MetalCaptureEnabled bool true" Gen/Info.plist > /dev/null || die "MetalCaptureEnabled"; t "Metal frame capture: enabled (DM_METAL_CAPTURE=1)"; fi RP=; if [ -n "${PROGRAMS_TSV:-}" ]; then # a game of several programs: each program's files, which the Xcode build phase copies under p as the IPA has them (stage_resources.sh)