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

Parallel recipe-dir sub-builds #1276

Open
ihnorton opened this issue Dec 17, 2024 · 4 comments
Open

Parallel recipe-dir sub-builds #1276

ihnorton opened this issue Dec 17, 2024 · 4 comments

Comments

@ihnorton
Copy link

For large "forge"-style builds, it would be useful to allow recipe-dir sub-builds to run in parallel on a large build system. @-wolfv mentioned that "It would be relatively straightforward to do, the pieces are there" on Discord. Oversubscribing the build system is always a risk, but combining manual control over the number of concurrent sub-builds along with the ninja jobserver build would go a long way to preventing this.

@wolfv
Copy link
Member

wolfv commented Dec 17, 2024

Does ninjas have a job server?
Our idea was to start all builds. Once we see one taking all the CPU we could send SIGHALT to all other processes and then pick them up again once the other build is done. Would need some experimentation though :)

@ihnorton
Copy link
Author

ihnorton commented Dec 18, 2024

Does ninjas have a job server?

There is a ninja soft fork from kitware with jobserver support (which is the source for the ninja package on pypi). There has been some recent activity on getting it upstreamed.

Once we see one taking all the CPU we could send SIGHALT to all other processes

😰


Another thought was to require all (cmake) build scripts to set the subninja prefix, and don't run the build command right away in the build script. Rattler could generate a top-level file to combine the subninja files at each level of the sorted build tree, and run one ninja -jN invocation against that. (but that starts to look like some of what bazel/buck2)

@wolfv
Copy link
Member

wolfv commented Dec 18, 2024

Ah great, a job server was one of the pieces that would be great for something like this. But then you still end up, to some degree, with the problem of ninja, make, cargo, pip and others potentially running at the same time. But still .. could be great!

I would be very curious about trying things with Linux processes and stopping / resuming them. Not sure if it can work.

@traversaro
Copy link

traversaro commented Dec 19, 2024

I just launched a ros-humble rebuild on a 128-core server and it would be quite cool to have this at some point. : )

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

No branches or pull requests

3 participants