Files
psxrecomp/tools
Matthew Stanley 42a69624b1 fix(tools,docs): diagnose unconfigured recompiler build dirs in regen_bios
A contributor bringing up a new title hit four dead-ends in a row, three of
which were the same missing step wearing different masks: `regen_bios.sh`
builds the BIOS emitter but never configures it, and nothing said so.

- "no recompiler build dir found (set PSXRECOMP_BIOS_BUILD)" pointed at an
  env var when a fresh clone has no CMake tree to point it at. Both discovery
  failure and an explicit override now name the actual missing step and print
  the configure command.
- Setting PSXRECOMP_BIOS_BUILD skipped the CMakeCache.txt check that discovery
  applies, so an unconfigured directory reached `cmake --build` and died with
  cmake's bare "Error: could not load cache". Validate the override too.
- A CMake configure that FAILS still writes CMakeCache.txt — the cache lands
  before the generate step, which never runs after a FATAL_ERROR. So "has a
  cache" did not mean "is buildable": the directory left behind by his failed
  SDL and BIOS-backend configures had a cache and no build.ninja, and the
  build reported only `ninja: error: loading 'build.ninja': GetLastError() =
  2`. Read the generator out of the cache, check for its build files, and say
  what happened. Discovery skips such a directory and keeps looking rather
  than selecting it and dying; an unrecognized generator falls through to
  cmake instead of inventing a failure.

All errors now go to stderr (the old one went to stdout).

Docs: the README's framework build block configured the recompiler and jumped
straight to the runtime build, omitting the required BIOS regen between them —
exactly the hole he fell into. It is now the same numbered 1/2/3 sequence
docs/BUILDING.md already used. BUILDING.md gains troubleshooting entries for
the two CMake half-configured-directory errors, the fresh-clone "No recompiled
BIOS backend available", and PSXRECOMP_BIOS_BUILD being resolved relative to
the framework root rather than the shell's cwd.

Verified: both new failure paths and the half-configured-directory case
reproduce and now self-explain; discovery precedence (build-t2 over build),
explicit-override precedence, Ninja/Makefiles/unknown generators, and a CRLF
cache all behave; end-to-end `regen_bios.sh --config bios/OpenBIOS.toml`
still emits (Dispatch entries: 3911).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 18:03:03 -07:00
..
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00