Skip to content

Commit 492b3bf

Browse files
committed
fix(zaparoo): stable build applies full fork diff incl input.cpp/scheduler.cpp
The stable build excluded input.cpp/scheduler.cpp and re-applied a hardcoded hook set via apply_stable_hooks.py. That script drifted behind PRs #11/#12, which added input.cpp edits (the launcher_input_detect.inc include defining input_export_launcher_metadata, plus keyboard-grab/bridge hooks) it never learned — so stable builds failed to link (undefined reference to input_export_launcher_metadata) and would have shipped degraded launcher input. git apply -3 applies the full fork diff for these files cleanly against the stable release base (upstream has no drift there), same as every other fork-touched upstream file. Drop the exclusions and the bespoke script so the fork diff is the single source of truth. Fixes the failing stable Push Release build.
1 parent 0109e37 commit 492b3bf

4 files changed

Lines changed: 16 additions & 176 deletions

File tree

.github/apply_stable_hooks.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

AGENTS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ This fork auto-syncs upstream daily and publishes **two channels from two branch
6262
build layers the fork diff `upstream/master..<branch>` onto an upstream base, so that diff
6363
must stay **fork-only** — keep both branches upstream-synced.
6464
3. **Promote to the distribution only when explicitly asked:**
65-
`git checkout stable && git merge master && git push origin stable`. If the promoted feature
66-
adds *new* hooks to `input.cpp` or `scheduler.cpp`, also update
67-
`.github/apply_stable_hooks.py` on `stable` (stable's hooks in those two files come from that
68-
script, not the diff).
65+
`git checkout stable && git merge master && git push origin stable`. The stable build applies
66+
the full fork diff with `git apply -3`, so `input.cpp` / `scheduler.cpp` hooks promote like any
67+
other fork-touched file — no extra step.
6968

7069
Full details: `support/zaparoo/RELEASE.md`.
7170

stable-build.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,18 @@ git worktree add --detach "${TMP_WORKTREE}" "${STABLE_COMMIT}" >/dev/null
8080

8181
# Apply the cumulative fork-only diff (relative to upstream master) so revert
8282
# pairs and other intra-fork conflicts cancel out — replaying commit-by-commit
83-
# would re-expose them. -3 falls back to a 3-way merge when stable's content
84-
# for a shared file has drifted from upstream master. MiSTer.ini is excluded:
85-
# the fork's only change is an uncomment of a default-valued line, and stable's
86-
# example ini drifts often enough to cause spurious conflicts.
83+
# would re-expose them. -3 falls back to a 3-way merge when stable's content for
84+
# a shared file (including input.cpp / scheduler.cpp) has drifted from upstream
85+
# master — the same mechanism used for every fork-touched upstream file, so the
86+
# fork diff stays the single source of truth. MiSTer.ini is excluded: the fork's
87+
# only change is an uncomment of a default-valued line, and stable's example ini
88+
# drifts often enough to cause spurious conflicts.
8789
FORK_DIFF=$(git diff --binary "${UPSTREAM_REF}..${FORK_HEAD}" -- . \
88-
':(exclude)MiSTer.ini' \
89-
':(exclude)input.cpp' \
90-
':(exclude)scheduler.cpp')
90+
':(exclude)MiSTer.ini')
9191
if [ -n "${FORK_DIFF}" ]; then
9292
printf '%s\n' "${FORK_DIFF}" | git -C "${TMP_WORKTREE}" apply -3 --index
9393
fi
9494

95-
# These hook files drift across stable/master often. Apply the small Zaparoo
96-
# hook additions by function scope instead of using upstream-master patch context.
97-
if [ -n "$(git diff --name-only "${UPSTREAM_REF}..${FORK_HEAD}" -- input.cpp scheduler.cpp)" ]; then
98-
.github/apply_stable_hooks.py "${TMP_WORKTREE}"
99-
git -C "${TMP_WORKTREE}" add input.cpp scheduler.cpp
100-
fi
101-
10295
"${TMP_WORKTREE}/docker-build.sh" "$@"
10396

10497
mkdir -p "${OUTPUT_DIR}"

support/zaparoo/RELEASE.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ release channels, so upstream syncing and fork-feature promotion are decoupled.
2121
- **Unstable** (`.github/build_unstable_release.sh``unstable-build.sh`): upstream `master`
2222
HEAD base + `git diff upstream/master..master`.
2323
- **Stable** (`.github/build_release.sh``stable-build.sh`): upstream's latest tagged
24-
release (`releases/MiSTer_*`) base + `git diff upstream/master..stable`, with the
25-
`input.cpp` / `scheduler.cpp` hooks re-applied by `.github/apply_stable_hooks.py`.
24+
release (`releases/MiSTer_*`) base + `git diff upstream/master..stable`, applied with
25+
`git apply -3` (3-way, tolerates upstream drift) — `MiSTer.ini` is the only exclusion.
2626

2727
Each channel is built from a checkout of its **own branch**, so its content, build scripts,
2828
and hook list all come from that branch.
@@ -41,16 +41,10 @@ When a beta feature on `master` is ready to ship to everyone:
4141
```sh
4242
git checkout stable
4343
git merge master # or cherry-pick specific commits for a partial promotion
44-
# If the promoted feature adds NEW hooks to input.cpp or scheduler.cpp, also update
45-
# .github/apply_stable_hooks.py on stable to include them (see caveat below).
4644
git push origin stable # triggers a fresh MiSTer_Zaparoo_YYYYMMDD stable release
4745
```
4846

49-
### Caveat: input.cpp / scheduler.cpp hooks
50-
51-
The stable build excludes `input.cpp` and `scheduler.cpp` from the fork diff and instead
52-
re-applies a **hardcoded** set of hooks via `.github/apply_stable_hooks.py`. So stable's
53-
hooks in those two files are governed by that script, not by merging the diff. Promoting a
54-
feature that adds new hooks to either file requires editing `apply_stable_hooks.py` on the
55-
`stable` branch as well. Features that only touch new `support/zaparoo/*` files (or other
56-
upstream files) are handled by the diff alone — no script change needed.
47+
The stable build applies the **full** fork diff with `git apply -3`, so hooks in `input.cpp`
48+
/ `scheduler.cpp` promote exactly like any other fork-touched file — there is no separate
49+
hook list to maintain. If upstream ever drifts those files enough that the 3-way apply
50+
conflicts, the stable build fails loudly (rather than silently shipping a stale hook set).

0 commit comments

Comments
 (0)