Skip to content

scripts: build-local.sh / .ps1 -- a runner for this machine, path printed last - #2

Merged
TechnicallyComputers merged 1 commit into
mainfrom
feat/build-local
Sep 27, 2026
Merged

TechnicallyComputers merged 1 commit into
mainfrom
feat/build-local

Conversation

@TechnicallyComputers

Copy link
Copy Markdown
Member

Adds scripts/build-local.sh (Linux, macOS) and scripts/build-local.ps1 (Windows/MSVC). Each builds retro-core-runner for the host machine into out/local/<platform>/. The last line printed is RETRO_CORE_RUNNER=<abs path>, ready to pass to a title app's --runner or to a port's local.env. This is one slice of the title-app work; the contract is n64lle docs/TITLE-APP.md §7.

  • Configures the same way package-release.sh does: libstdc++/libgcc static on Linux, /MT on MSVC. A local build needs no version string, SDL3 prefix or 7z.
  • SDL3 is optional (--no-sdl or --sdl3-prefix). A non-system SDL3 is copied beside the runner and found through $ORIGIN (Linux) or @loader_path (macOS).
  • Before printing the path, the script checks the copied runner's --version: it must show game_package 1, version dev and the commit, with -dirty if tracked files are modified.

Verified on linux-x86_64:

  • ctest 11/11.
  • Built with and without SDL3.
  • Runs from any working directory.
  • A non-system SDL3 still loads after the output folder is moved.
  • shellcheck is clean, and the .ps1 parses under pwsh 7.4.

Not run: the macOS path and every Windows path. The README says so.

🤖 Generated with Claude Code

…nted last

For local development: build retro-core-runner for the host OS and hand it to
a port or app as an explicit runner (--runner, RETRO_CORE_RUNNER). Release by
default (--debug), copied with LICENSE into out/local/<platform>/, stamped
"version dev" with the git commit (+ -dirty for modified tracked files).

- SDL3 optional, found as CMakeLists.txt finds it; --sdl3-prefix names one,
  --no-sdl goes without. The output says whether --gl is available. A shared
  SDL3 from outside the system library directories is copied beside the
  runner, found through RUNPATH $ORIGIN (Linux) / @loader_path (macOS), set
  by installing through CMAKE_INSTALL_RPATH. Windows copies SDL3.dll.
- Kept from package-release.sh: static libstdc++/libgcc on Linux, /MT on
  Windows. Not kept: its gates, the pinned SDL3, 7z, a required version.
- The copy's --version must run and say game_package 1 (and version dev,
  the expected commit) before RETRO_CORE_RUNNER=<abs path> is printed as the
  last stdout line. Build output goes to stderr.
- A build dir reconfigured with other SDL/generator choices starts afresh.
- .ps1: enters Visual Studio's dev shell via vswhere when cl.exe is missing;
  Ninja if on PATH, else the VS generator.

Verified on Linux x86_64 only. The macOS path of build-local.sh and all of
build-local.ps1 are unrun (the .ps1 parses under pwsh 7.4 and refuses
non-Windows hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechnicallyComputers
TechnicallyComputers merged commit a1d807f into main Sep 27, 2026
6 checks passed
TechnicallyComputers added a commit that referenced this pull request Sep 27, 2026
… 1.1) and #2 (build-local)

runner_main.cpp: keep main's pkg_sha (declared outside the package block,
for the state keeper) and --describe's exemption from the package
requirement. build-local.sh --test: 18/18; --describe on n64lle's generic
core with the Pokemon Stadium package prints 76 options and 16 inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant