Add 'CPUS' as make BOARD=X argument #842
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a nifty way permitting us to limit ressource allocation if desired (CIs).
From experiementations, there is no way to limit ressource consumption on CircleCI but to pay to have more resources.
In our use case, with cache now being built when boards builds successfully for the same modules/* and patches/* hashes, a cache is built. It fallsback to taking the last available built cache for musl-cross-make having been built for its own specific module signature and existing patches.
The problem we had recently in CI was linked to the addition of coreboot 4.12 board (librem_mini-NoTPM) which, for some obscure reason, failed building with OOM being invoked. GCC expects each thread to have 1GB available, and CircleCI's guaranteed resource allocation is of 4Gb ram, with 32 softcores. So Heads magically taking nproc made explode the coreboot build toolstack for the first time.
This PR introduces the possibility of passing CPUS=X on command line, where that variable is then passed to all submodules, where nproc is taken if not defined. This seems to resolve the current failed PR builds and already passed previous failing point https://app.circleci.com/pipelines/github/tlaurion/heads/447/workflows/d1138321-3a1d-4ffb-9165-e8803d9648ac/jobs/480, where the successfull build will produce a new cache that will be picked up with following builds not touching modules/* nor patches/*
@MrChromebox