Skip to content

Bound the native build to four jobs so cold CI builds stop killing the runner - #165

Merged
ninjudd merged 1 commit into
mainfrom
ci/bound-native-parallelism
Sep 6, 2026
Merged

ninjudd merged 1 commit into
mainfrom
ci/bound-native-parallelism

Conversation

@ninjudd

@ninjudd ninjudd commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

build:native passed a bare -j to cmake --build, which Make reads as unlimited parallelism. That was harmless while the Actions cache carried the JUCE build, but GitHub evicts caches unused for a week, nothing ran between Aug 13 and Aug 31 (the Actions budget was spent on Aug 13), and the first two runs in September both died the same way: main at 106de1c, and adopt-projector at e8b9040, which touches no native code. Each reached pnpm build:native, compiled every translation unit at once, had cc1plus OOM-killed, and lost the runner VM under it, so the step ends as "The operation was canceled" with no test having run. A killed job never saves the cache, so every later push was cold too and the failure fed itself.

Four is the hosted runner's core count. Locally the cost lands on cold builds only: 122 s on an M3 Max at four jobs, measured on a fresh checkout, and incremental builds touch too few files to notice. The workflow gains a comment recording the incident so the bound is not read as an oversight and removed.

Caches saved by a pull request branch are restorable only by that branch, so this fixes the queue in two steps: this merges, main's push run builds cold at four jobs and goes green, and the next run on any branch restores main's cache and is back to the three-minute job it was through Aug 12.

Testing

From the repository root, on a machine with cmake and a compiler, force a cold build and time it:

rm -rf native/audiod/build
time pnpm build:native

You should see the build end with [100%] Built target field-fixture_VST3 after about two minutes on an M3 Max, and never more than four cc1plus processes in top while it runs. It leaves native/audiod/build/ behind, which is gitignored. Before this change the same command finished faster locally, because the machine has the memory for an unbounded build; the failure only shows on the four-core, sixteen-gigabyte runner, and it is visible in the run that motivated this:

gh run view 34052143004 --log | grep -n 'Killed signal\|received a shutdown signal'

That prints c++: fatal error: Killed signal terminated program cc1plus at 18:46:52 followed by the runner's shutdown signal; main's own run 34051892537 died the same way at 18:37:49.

The check that would show this bound is not enough is this pull request's own CI run, which is a cold build because the cache is empty: if its pnpm build:native step still ends in "The operation was canceled", four jobs is still too many. After the merge, main's push run should go green, and the next run on any branch should show Cache restored from key: audiod-Linux-... in the actions/cache step and finish in about three minutes.

pnpm typecheck passes and git diff --check is clean; the diff carries no TypeScript.

https://claude.ai/code/session_01NoEbsFdeYWukgsVcNBLUzL

…e runner

`build:native` passed a bare `-j` to `cmake --build`, which Make reads as unlimited parallelism. That was harmless while the Actions cache carried the JUCE build, but GitHub evicts caches unused for a week, nothing ran between Aug 13 and Aug 31, and the first two runs in September (main at 106de1c, and adopt-projector at e8b9040, which touches no native code) both compiled every translation unit at once, had cc1plus OOM-killed, and lost the runner VM under them. A killed job never saves the cache, so the state was self-sustaining.

Four is the hosted runner's core count. Locally the cost is a cold build only: 122 s on an M3 Max at four jobs, and incremental builds touch too few files to notice. The workflow comment records the incident so the bound is not read as an oversight and removed.

Claude-Session: https://claude.ai/code/session_01NoEbsFdeYWukgsVcNBLUzL
@ninjudd
ninjudd merged commit fce8138 into main Sep 6, 2026
1 check passed
@ninjudd
ninjudd deleted the ci/bound-native-parallelism branch September 6, 2026 18:58
ninjudd added a commit that referenced this pull request Oct 10, 2026
Brings chunk 2 up to date with its parent, which now carries main.

One conflict, in package.json's build:native: main bounded the native
build to four jobs (#165) on the same line where this branch added
--config Release. The resolution keeps both:

  cmake --build native/audiod/build --parallel 4 --config Release

Either side alone breaks something. Unbounded -j brings back the cold
CI builds that killed the runner, and dropping --config Release makes
MSVC put the binary outside field-audiod_artefacts/Release/, where
daemonBinary() looks. Single-config generators ignore --config, so the
line is right on all three platforms.

server.cpp auto-merged: main's recording ops, including the ::getpid()
in hello, land inside the POSIX #else arm, and server.h is unchanged
on main, so the Windows stub still defines every public member.
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