From 771ded81673b81ef4ea435a40a244bd47fdd5ffe Mon Sep 17 00:00:00 2001 From: Shokunin <30949000+tetrisgm@users.noreply.github.com> Date: Thu, 8 Oct 2026 03:34:56 -0700 Subject: [PATCH 1/3] ci: require only the tracked OpenBIOS backend in release checks #575 stopped tracking generated/SCPH1001_*, but check_generated.sh and the game-release template still required them, failing title release packaging. SCPH1001 is now optional/local: complete -> noted, absent -> skipped with a note, partial -> error. Co-Authored-By: Claude Opus 5.5 --- docs/ci/templates/game-release.yml | 10 ++---- tools/ci/check_generated.sh | 52 ++++++++++++++++++------------ 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/docs/ci/templates/game-release.yml b/docs/ci/templates/game-release.yml index 90313c8e..16154c10 100644 --- a/docs/ci/templates/game-release.yml +++ b/docs/ci/templates/game-release.yml @@ -8,8 +8,8 @@ # # WHAT THIS SHIPS. A compiled game. The title COMMITS its generated/ game C # (psxrecomp_cli.py generate, run once by the developer from a legal disc); -# the framework COMMITS its two BIOS backends (OpenBIOS and SCPH-1001) in -# psxrecomp/generated/. CI links both into the runtime and packages the +# the framework COMMITS its OpenBIOS backend in psxrecomp/generated/ +# (SCPH-1001 is local-only since #575). CI links it into the runtime and packages the # executable with its runtime data. Players download, point it at their disc # (and, if they want the retail BIOS, their own dump — the runtime needs the # image's data and checks its identity), and play. Nothing is generated or @@ -482,7 +482,7 @@ jobs: # Full game build: the committed generated/ C is REQUIRED, so a # checkout without it fails configure instead of silently producing # a setup host. runtime.cmake links every BIOS backend whose C is - # committed in the submodule (OpenBIOS and SCPH-1001), and + # committed in the submodule (OpenBIOS; SCPH-1001 is local-only), and # BIOS_STALE_FATAL refuses a stamp that predates the emitter. # PSX_SETUP_WIZARD stays on: it is the first-run BIOS/disc picker. # Netplay titles: set PSX_NETPLAY ON in CMakeLists *before* @@ -512,10 +512,6 @@ jobs: echo "::error::CMake did not link the OpenBIOS backend (psxrecomp/generated missing or stale?)" exit 1 fi - if ! grep -qE 'BIOS backends linked: .*SCPH1001' build-ci-configure.log; then - echo "::error::CMake did not link the SCPH-1001 backend (psxrecomp/generated/SCPH1001_* missing or stale?)" - exit 1 - fi if ! grep -q 'Vulkan backend: headers' build-ci-configure.log; then echo "::error::CMake did not enable PSX_HAVE_VULKAN (see configure log)" exit 1 diff --git a/tools/ci/check_generated.sh b/tools/ci/check_generated.sh index e78a0a92..049cadee 100755 --- a/tools/ci/check_generated.sh +++ b/tools/ci/check_generated.sh @@ -14,12 +14,13 @@ # 2. Those files are tracked by git. An untracked generated/ builds fine on # the developer's machine and is absent from every CI checkout, which is # the exact gap between "works for me" and a red release. -# 3. The framework's BIOS backends are present and tracked in the submodule -# (psxrecomp/generated/{OpenBIOS,SCPH1001}_{full,dispatch}.c with their -# .emitter.sha stamps). Decision 2026-09-30: the recompiled BIOS is -# committed and linked like the recompiled game; the player still -# supplies the retail image at run time. runtime.cmake's fingerprint -# check (PSXRECOMP_BIOS_STALE_FATAL in CI) refuses a stale stamp. +# 3. The framework's tracked BIOS backend is present and tracked in the +# submodule (psxrecomp/generated/OpenBIOS_{full,dispatch}.c with its +# .emitter.sha stamp). runtime.cmake's fingerprint check +# (PSXRECOMP_BIOS_STALE_FATAL in CI) refuses a stale stamp. +# SCPH1001 is local-only since #575 (generated from the developer's own +# dump, untracked): if present it must be complete; if absent it is +# skipped with a note. # 4. No BIOS dump is tracked (SCPH*.BIN / *.bin under bios/) in the title or # the submodule. # @@ -106,20 +107,31 @@ fi # 3. The framework's committed BIOS backends. fw="${ROOT}/psxrecomp" if [[ -d "${fw}" ]]; then - for stem in OpenBIOS SCPH1001; do - for f in "generated/${stem}_full.c" "generated/${stem}_dispatch.c" "generated/${stem}.emitter.sha"; do - if [[ ! -f "${fw}/${f}" ]]; then - echo "error: psxrecomp/${f} is missing -- the framework commits its BIOS backends;" >&2 - echo " this submodule pin predates that, or the checkout is not --recurse-submodules." >&2 - exit 1 - fi - if git -C "${fw}" rev-parse --is-inside-work-tree >/dev/null 2>&1 && - ! git -C "${fw}" ls-files --error-unmatch -- "${f}" >/dev/null 2>&1; then - echo "error: psxrecomp/${f} exists but is not tracked in the framework submodule." >&2 - exit 1 - fi - done + for f in generated/OpenBIOS_full.c generated/OpenBIOS_dispatch.c generated/OpenBIOS.emitter.sha; do + if [[ ! -f "${fw}/${f}" ]]; then + echo "error: psxrecomp/${f} is missing -- the framework commits its OpenBIOS backend;" >&2 + echo " this submodule pin predates that, or the checkout is not --recurse-submodules." >&2 + exit 1 + fi + if git -C "${fw}" rev-parse --is-inside-work-tree >/dev/null 2>&1 && + ! git -C "${fw}" ls-files --error-unmatch -- "${f}" >/dev/null 2>&1; then + echo "error: psxrecomp/${f} exists but is not tracked in the framework submodule." >&2 + exit 1 + fi done + # SCPH1001: optional, local-only (psxrecomp #575). Partial output is an error. + scph_have=0 + for f in generated/SCPH1001_full.c generated/SCPH1001_dispatch.c generated/SCPH1001.emitter.sha; do + [[ -f "${fw}/${f}" ]] && scph_have=$((scph_have + 1)) + done + if [[ "${scph_have}" -eq 3 ]]; then + scph_note="SCPH1001 backend present (local)" + elif [[ "${scph_have}" -eq 0 ]]; then + scph_note="SCPH1001 backend absent (local-only, skipped)" + echo "note: psxrecomp/generated/SCPH1001_* absent -- local-only since #575; skipped." >&2 + else + fail "psxrecomp/generated/SCPH1001_* is incomplete (${scph_have}/3 files) -- regenerate with tools/regen_bios.sh --config bios/SCPH1001.toml or remove them" + fi fi # 4. No BIOS dump tracked, in the title or the submodule. @@ -136,4 +148,4 @@ for repo in "${ROOT}" "${fw}"; do fi done -echo "generated C ok: generated/${boot}_dispatch.c + ${shards} full shard(s) tracked; framework BIOS backends present; no BIOS dump tracked" +echo "generated C ok: generated/${boot}_dispatch.c + ${shards} full shard(s) tracked; OpenBIOS backend tracked; ${scph_note:-no framework submodule}; no BIOS dump tracked" From dbb8a86eee5131e3d7002c137f106bac3e2536c5 Mon Sep 17 00:00:00 2001 From: Shokunin <30949000+tetrisgm@users.noreply.github.com> Date: Thu, 8 Oct 2026 00:02:45 -0700 Subject: [PATCH 2/3] Host sampler: include on macOS stops with #error unless _XOPEN_SOURCE is defined, so debug-tools runtime builds on macOS failed at host_sampler.c. The sampler only needs ucontext_t's machine context, which declares without the deprecated routines. Co-Authored-By: Claude Opus 5.5 --- runtime/src/host_sampler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/host_sampler.c b/runtime/src/host_sampler.c index e91919b2..5b1e891b 100644 --- a/runtime/src/host_sampler.c +++ b/runtime/src/host_sampler.c @@ -107,7 +107,11 @@ void host_sampler_start(void) { #elif defined(__linux__) || defined(__APPLE__) #include #include +#if defined(__APPLE__) +#include /* errors without _XOPEN_SOURCE */ +#else #include +#endif #include #include From fe8872702538468d36b9481a7791254810a3c764 Mon Sep 17 00:00:00 2001 From: Beman Date: Thu, 8 Oct 2026 18:20:49 +1000 Subject: [PATCH 3/3] Fix MSVC dynres probe tokenizer linkage --- runtime/src/debug_server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index a8e42dc7..f0d98988 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -73,6 +73,11 @@ #include #include +#if defined(_MSC_VER) +/* MSVC's three-argument reentrant tokenizer is named strtok_s. */ +# define strtok_r strtok_s +#endif + #ifndef DEFAULT_DEBUG_PORT #error DEFAULT_DEBUG_PORT must be defined by the runtime target. #endif