Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'CPUS' as make BOARD=X argument #842

Merged
merged 3 commits into from
Sep 29, 2020

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Sep 25, 2020

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

…to be used if desired, else the default is detected in Makefile and pushed to submodules. If nothing specified, uses nproc and pass it to submodules. CircleCI forced to CPUS=2
…reads/memory is 1/1024Mb, CircleCI supposedly reserving 4Gb for medium (free). Build time will increase, unfortunately, when compared to nproc returning 32 cores.
…oot 4.12 built boards currently failing for lack of memory in other builds (make error 137).
Copy link
Contributor

@MrChromebox MrChromebox left a comment

Choose a reason for hiding this comment

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

if it fixes CI building under coreboot 4.12 then LGTM

@tlaurion tlaurion merged commit f009acb into linuxboot:master Sep 29, 2020
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