No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!673
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-builder-jobs"
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?
Closes #605. Closes #531.
What
Compilation on Linux was already parallel (
nx2/build.pyruns oneclangprocess per worker), but the Linux builder window chose far fewer workers than Windows:make_game.default_jobs)min(4, threads / 2), at most one per threadtoolchain.default_jobs(3.5))That fits the 29% CPU in #531 and the comment in #605.
builder/linux/hookshot_builder.py: withoutHOOKSHOT_JOBSorRX_JOBSthe window passes no--jobs, somake_gamechooses.HOOKSHOT_JOBSandRX_JOBSwork as before; a badRX_JOBSnow shows the error dialog instead of an uncaught exception.nx2/make_game.py:min(4, threads / 2)stays Windows' only. Its own comment says "Windows pages rather than fails"; Linux stops a compiler that does not fit, andbuild.pycompiles that file again alone, so on Linux the free memory alone decides.--jobsnorHOOKSHOT_JOBSis given. The "build: N compilers at once" line used to be printed even with--jobs, with a number the build did not use (on Linux, always).HOOKSHOT_JOBSor a negative--jobsstops with a message instead of a traceback.readme.md: the Linux section describes the automatic choice.Why the two rules differed
From the history, the Linux rule fell behind rather than being chosen:
0440738(11-06):toolchain.default_jobs(3.5)arrives with the a64-kit (after SkyboundTotk PR 14), to avoid running 16 GB machines out of memory.8301bf1(11-07): the AppImage's window uses it. Windows then usedthreads / 2, so at that point Linux was the cautious one.6036423(11-07, #418): Windows moves to free memory / 2 GB with a floor. Onlymake_game.default_jobschanges.fa22c2d(11-08): Windows tries 3.5 GB per compiler after an out-of-memory compile, andbuild.pystarts compiling failed files again alone.3adfb63(11-08): Windows goes back to / 2 GB with the floor, because at 3.5 GB 16 GB PCs got 1-2 compilers and builds took hours (#502, #503, #511).The Linux window calls a different function and never followed steps 3-5. It kept the 3.5 GB rule that step 5 dropped, on top of 80% of total memory.
Test
python -I -B tests/test_linux_builder_jobs.py: 15 tests OK. The window tests are updated (no--jobswhen nothing is set,RX_JOBSstill honoured, badRX_JOBSstops before any side effect). New tests coverdefault_jobson Linux and Windows (same count, floor Windows-only, one per thread at most) and the--jobs→HOOKSHOT_JOBS→ automatic order. This file already runs in Game-free source regressions.python -I -B tests/test_make_game_cache.py: OK.nx2/make_game.pyrun directly: without--jobsit prints the count it uses; with--jobs 3it prints none;--jobs -1andHOOKSHOT_JOBS=nstop with a message.3adfb63.Thanks!