Skip to content

feat(build): record the CPU flags used by the game - #2608

Draft
JooaoPedro15 wants to merge 1 commit into
NotRexed:mainfrom
JooaoPedro15:fix/record-build-flags
Draft

JooaoPedro15 wants to merge 1 commit into
NotRexed:mainfrom
JooaoPedro15:fix/record-build-flags

Conversation

@JooaoPedro15

@JooaoPedro15 JooaoPedro15 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

A built game currently cannot say which CPU target and compilation flags produced it. This makes reports hard to compare and leaves an updater without a record of the original build choices (#2576).

Record the CPU argument list and the normalized base flags for lifted code, hot code and host runtime in hookshot_build_flags.json. The executable embeds exactly the same JSON and prints it near the start of hookshot_log.txt; the game folder receives the file beside hookshot_version.txt, including packaged builds with the executable in bin/. Publication uses a temporary file and replacement, after successful linking.

The CPU list preserves -march, optional -mtune, and -ffp-contract=off. The other fields use the existing object-key normalization: include paths omitted, temporary sysroot paths normalized. These are the game's base flags; they do not describe a separately built renderer or optional per-file library defines. Reusing the recorded CPU choices during an update (#2577) is a separate change; this PR does not add RX_CPU_FLAGS or alter the selected CPU flags.

Validation:

  • Compiled metadata fixture checks that the C macro prints exactly the published JSON, including quotes, backslashes, control characters and non-ASCII input.
  • Tests preserve the previous record after a failed replacement, and preserve the installed game/image/metadata after an interrupted metadata staging copy.
  • Updated the existing Windows/development and packaged Linux installation fixtures to require and verify the new root-level file.
  • Related local suites pass (build flags, finish output, build times, build log, cleanup scope, and version). Windows-only fixture cases and the packaged Linux case require their CI platforms.
  • Full macOS suite before the Linux-specific fixture adjustment: 377 passed, 24 failed, 72 skipped. Failures include Python 3.9 API gaps, Linux/GNU assumptions, unavailable optional packages, macOS temporary-directory canonicalization, and main's existing HOS_FPS_LOG source-check failure. No dependencies installed; no game run or GPU performance measurement.
  • git diff --check passes.

CI: all six game-free jobs passed on Windows and Linux, on main 55b976c0 plus this change and the pending #2575. That separate validation branch differs from this PR only in host/oot_high_fps.c, the environment-switch fix from #2575. Both Python shards on both OSes, the SPIR-V fixtures, and workflow lint passed.

Current status: #2575 has merged. Rebased onto main b157c3e8 (seven focused local suites pass); the full fork CI is being repeated on this updated branch. The combined CI above records the earlier tested snapshot, not this latest rebase.

Overlap: #2673, opened later for the same request, reports a complete Linux game build/run. Only one implementation should land; this remains a draft pending maintainer choice and a real game build/run, which is unavailable on this Mac. This implementation keeps the existing CPU choices, does not introduce RX_CPU_FLAGS, and publishes the record produced by the child build after successful linking.

Fixes #2576
Related: #2577, #2505.

Work is recorded in docs/worklist.md; Discord coordination was unavailable in this environment.

Assisted-by: OpenAI Codex
Co-Authored-By: Codex noreply@openai.com

Publish normalized build flags beside the game version and embed the same JSON in the startup log. Keep the CPU arguments as a list, distinguish lifted/hot/host base flags, and publish only after successful linking. Updates do not restore these settings yet (issue NotRexed#2577).

Refs NotRexed#2576

Assisted-by: OpenAI Codex
Co-Authored-By: Codex <noreply@openai.com>
@JooaoPedro15
JooaoPedro15 force-pushed the fix/record-build-flags branch from 8826458 to b805e27 Compare November 12, 2026 16:52
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.

Record the compile flags a build actually used

1 participant