Skip to content

Use -j$(nproc) for builds - #11313

Merged
dhalbert merged 4 commits into
adafruit:mainfrom
MakerClassCZ:ci-zephyr-tests-j4
Sep 5, 2026
Merged

Use -j$(nproc) for builds#11313
dhalbert merged 4 commits into
adafruit:mainfrom
MakerClassCZ:ci-zephyr-tests-j4

Conversation

@lynt-smitka

Copy link
Copy Markdown

The native_sim, bsim and the two bsim board builds in this job run with -j2 on a runner with 4 vCPUs, and ninja inherits the limit through the jobserver. Half the machine is idle for the build phase, about 11 of the job's 42 minutes (3.3 + 1.1 + 3.3 + 3.0). -j4 is what the other workflows use.

The ubuntu-24.04 runner has 4 vCPUs. The three native builds and the
bsim build run with -j2; the Zephyr build honours make's jobserver
(BUILD_JOB_SERVER_AWARE), so half the cores sit idle for the 3.3 minutes
each of them takes.

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about -j$(nproc) ?

@lynt-smitka

Copy link
Copy Markdown
Author

Absolutely, I'll push it in the next commit once the CI runs here and I check to see how it went.

@dhalbert

dhalbert commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

I would say change all -j<n> to -j$(nproc). There are quite a few -j4 elsewhere in .github. That way if GitHub bumps the CPUs for a runner we won't have to do anything.

Take the job count from the runner, so a change in runner CPUs needs
no edit here.
Same change for the unix tests, mpy-cross, docs, the custom board
build and the broadcom toolchain. The macOS job uses sysctl, which is
what that platform has.
@dhalbert dhalbert changed the title run-zephyr-tests: build with -j4 Use -j$(nproc) for builds Sep 5, 2026

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for making this uniform for all -j invocations.

@dhalbert
dhalbert merged commit 7688f95 into adafruit:main Sep 5, 2026
683 checks passed
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.

2 participants