fix(dev): a game folder's logs live beside the tree, so reclaim deletes it whole #2545
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!2545
Loading…
Reference in a new issue
No description provided.
Delete branch "dazemc/Longshot:fix/runtime-logs-beside"
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?
Summary
A game folder could never be deleted whole. The game writes its logs, frame traces and whole profiling folders into
logs/inside the folder it runs from (
game/game_layout.c,host/profiling.c), anddev.pymakes that folder a base's gamefolder, a runtime or
build-linux/game/. So reclaiming disk always meant picking files out of the tree, hashing them andkeeping them by hand, and it was done three times in one day.
On
main, make a runtime on a shared base (dev.py packs rt <base> <runtime>), play or profile it withHOS_PROFILE=1,then
rm -rf <runtime>: the runtime'slogs/longshot_log.txtandlogs/profile-*/go with it, and the only safe reclaimis per file.
This change makes the game's
logs/a link to a folder beside the tree,<tree>.logs(a junction on Windows), so a treeis deleted whole with
rm -rf <tree>and what its runs wrote stays; a runtime made again finds its old evidence. Itapplies where a game folder is made: a base (
packs.cmd_base), a runtime (packs.cmd_rt, and sodev.py rtanddev.py ab) anddev.py game(build.cmd_game). Alogs/that is already a real folder is never moved, and where a linkcannot be made the logs stay inside the tree as before.
Read
scripts/devtools/packs.pyfirst:logs_beside,drop_evidence, and the three call sites. Thentests/test_dev_packs.py'stest_logs_beside.Rebase status (2026-11-25, current):
a5bf9dd16→73846d555ontomain @ 8f7300756701b7c9a278e576bb075ac20e622a32. The PR's own diff is preserved: stable patch-idf6428de4e81f32760a392d682da1dec37502d710is unchanged. Main's old-base→new-main changes intersect this PR at tests/test_dev_packs.py. The earlier suite therefore does not settle the rebased tree: that box is unticked and a suite is queued with the single suite owner. Focused, in-game, Windows and measurement results below remain identified by the historical commit that produced them; no new run is claimed. Earlier rebase notes are history.Testing
Tested: Linux (this PC). A scripts-only change: no game binary is built or changed, so no in-game run applies. Run
python -I -B tests/test_dev_packs.pyat this head:test_dev_packs: ok.tests/test_dev_build.py24 tests OK andtests/test_dev_ab.py35 tests OK.The full suite ran at the pre-rebase head
a5bf9dd16(833 passed, 2 failed, 8 skipped; the two failures were the named base failures).Main now intersects
tests/test_dev_packs.py, so a fresh suite at73846d555is queued with the single suite owner; no result at the rebased head is claimed.Game-free test, both ways: at
7f1ede607(the pre-rebase main plus this test alone, no fix) it fails withand at this PR it passes. It checks the builder, a refresh,
shutil.rmtree(<tree>)leavinglogs/profile-*/all.txtandlongshot_log.txtin<tree>.logs, a runtime made again finding it, a reallogs/left untouched, and a dangling linkremade;
test_warmchecks a warm-up still takes the logs it wrote with it.Not repaired here, and not this branch's: on the older fork
main(971f77f52) three checks in this file were red(
test_caches_named_in_renderer,test_inputs_beside_the_objects,test_stamp_matches_build). They are green onthe pre-rebase main (
2e9e41cb0): #2286 moved the builder out ofnx2/and #2411 moved the game, and the test file followed.This branch is based on current
mainand changes none of them.Still to test:
mise run testat73846d555, queued with the single suite owner becausetests/test_dev_packs.pyintersects main's changes (by hand, suite owner).dev.py rt --empty, play it once,rm -rf build-linux/rt-base, expectingbuild-linux/rt-base.logs/longshot_log.txtto remain (by hand: needs a real base and a game run).rt-<name>.logsbeside it, made as a junction where this account cannot makesymbolic links (by hand).
Measurements
Nothing to measure: no renderer or game code changes, so no frame rate, frame time or memory; the disk effect is that a tree is deleted whole (1.2 GB of
logs/was inside 37 runtime trees on this PC, one profiling runtime alone 1.1 GB).Risks
logs/to be a real directory. All of them open paths under it(
dev.py update --logs,scripts/perf.py,scripts/profiling,scripts/devtools/ab.py), which follows the link.logs/, and its evidence is not moved.Checklist
Ready for review
main; the title is a Conventional Commit. — Rebased head73846d555is directly onmain @ 8f7300756701b7c9a278e576bb075ac20e622a32; the preserved diff is the single topic described in Summary.mise run testpasses (any failure that also fails onmainis named). — Unticked at73846d555: main changed a file in this PR's intersection; a fresh suite is queued with the suite owner. The earlier suite record is historical evidence, not a new run at this head. Suite ata5bf9dd16052224d817f261b537edfe9025247e2: 833 passed, 2 failed, 8 skipped in 504 s (linux, 5 at once), exit 1; logprrefresh-logs/suite-2545-a5bf9dd1.log, sha25601be667e95e6cee281a05e618ab71d8262820ef3d70d48607002053ba57fc382,.head= that sha,.start/.end/.exitand JUnit beside it. Passes against Amendment 1's CORE ∪ FLAKY plus the base failures of Amendment 2 — CORE/FLAKY: none; base-exempt:tests/test_display_startup_failure.py,tests/test_title_card_strips.py; same 8 skips. base failuretests/test_display_startup_failure.pyexempt: fails identically at the merge-basebe663a08a—display_startup_actual.inc:82:5: error: use of undeclared identifier 'bc_claim'; reproductionprrefresh-logs/base-be663a08a-two-ids.log, sha256a26e89fa21110e64aa11987f7acae1a9d166b3c6e1877e8335aa3c9b0b9ac257. base failuretests/test_title_card_strips.pyexempt: fails identically at the merge-basebe663a08a—ModuleNotFoundError: No module named 'oot_patches'; same reproduction, same sha256.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened:test_dev_packs.pygainstest_logs_beside; no existing check was changed.docs/dev/developing.md, thertandgamerows.Assisted-by:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold. — Awaiting CI on the current head; this update does not claim a CI run.WIP: fix(dev): a game folder's logs live beside the tree, so reclaim deletes it wholeto fix(dev): a game folder's logs live beside the tree, so reclaim deletes it wholea5bf9dd16073846d5559Rebased
a5bf9dd16to73846d555on main8f7300756; patch-id unchanged. Intersection tests/test_dev_packs.py means the old suite no longer settles the head: box unticked and suite queued; PR stays non-WIP while queued.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.