fix(build): a failure after the game linked keeps the translation and the game's objects; only the renderer's go #1080
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1080
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/keep-lift-after-renderer-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: nothing yet (not built or run) · Needs: Linux, any GPU (a build with a renderer link error); Windows, any GPU
Why
When a build fails after the game itself has linked (for example, the renderer
longshot_vk.sohas an unresolved symbol from a mistake ingpu/vk), the next build translates and compiles the whole game again, as if nothing of the failed one could be trusted. That guard was added for Hookshot's #1197, where a stale cached object broke the game's link. But it fires on any failure after the compile, including ones that only involve the repository's renderer code. A one-line renderer mistake then costs a full lift and compile, which is up to an hour on a small PC. Reported by foolfool on Discord.How to reproduce
Seen on: Linux, RX 6750 XT (the reporter)
Settings and switches: defaults
Steps: in
gpu/vk, write anexternof one of the renderer's own functions inside an anonymous namespace (or call a host function that isn'tweak), then build withnx2/make_game.py.Expected: the build fails with
longshot_vk.so has N unresolved symbol(s); after the fix, the next build skips translating and recompiles only the renderer.Actual:
the build failed: the next one translates and compiles the game again (nothing of this one is reused).What changed
make_game.pynow notices whenbuild.pyreports that the game itself linked. A failure after that point can only come from the renderer's link or from its symbol check. In that case only the renderer's objects are forgotten; the translation and the game's objects are kept. A failure of the game's own link still forgets everything, as for #1197.compile_lineinnx2/make_game.pymatches build.py'slinked <...>/longshot[.exe]: N MB (line, which build.py prints before the renderer's link. It passes the result toforget_failed_build(..., game_linked).forget_renderer_objects()removessa/build/obj/vk_*(nx2/build.py'svk_jobs). It also removes their cached objects inobjcache/under the keys in their.sha1stamps, plus their copies in theLONGSHOT_OBJ_STOREstore. A stale cached renderer object can then never fail the link twice.tests/test_failed_compile_keeps_objects.py,test_after_the_game_linked_only_the_renderer_is_forgottenandtest_the_game_linked_is_told_by_build_pys_linecheck the cleanup and the line match. The match covers Linux and Windows paths with spaces, and doesn't matchlongshot_vk.soorlongshot_vk.dll.Measurements
Verdict: nothing measured. This changes which build outputs survive a failed build, not the game. The time saved is the lift plus the game's compile on the next try.
Flags and settings
None
Testing
Tested: nothing yet. The game-free checks haven't been run on my PC, and I haven't built the game with this change.
Not tested: the build in practice, on either platform, and whether the two new checks fail on
mainand pass here.Must be tested:
gpu/vk(e.g.namespace { extern int x_missing; }used from a function), then run a build. Expectthe build failed after the game linked, in the renderer: .... Remove the error and build again. Expectthe game was translated with these tools before(no lift) and onlyvk_*files compiled (Test Farm:@Beanstalklinux, a build with a deliberate renderer link error, then a fixed build).longshot_vk.dll link FAILED), expecting the same (Test Farm: windows).python -I -B tests/run_all.pypasses, and the two new checks fail onmain.Risks
What could break: if a failure after the game linked were really caused by the translation, the next build would fail the same way again instead of re-translating. Nothing after that line reads the translated code, so this shouldn't happen.
Turning it off: revert the commit.
Compatibility: nothing changes for a player after updating.
Issues
Fixes #1076
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Not run on my PC; still to run.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here. Added (its own commit before the fix); whether it fails onmainand passes here hasn't been run yet.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: fix(build): a failure after the game linked keeps the translation and the game's objects; only the renderer's goto fix(build): a failure after the game linked keeps the translation and the game's objects; only the renderer's go