-
Notifications
You must be signed in to change notification settings - Fork 160
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
New feature to execute BuildPackages.sh in parallel mode by adding --parallel #3922
New feature to execute BuildPackages.sh in parallel mode by adding --parallel #3922
Conversation
Now using some parts of #3624 -- adding a MAKEFLAGS, and also running no more than 4 packages in parallel (these could be made configurable). The parallelisation limiter uses |
I tried it on an older Thinkpad I have laying around (latest Arch Linux, i5-2520M 2core 2.5GHz, 8GB RAM) and it worked finde there (nothing crashes or explodes). Only I noticed that |
I can try it on a Raspberry Pi 3 too later if that helps. |
Thanks, that sounds promising! I think I've adjusted it so it shouldn't go crazy and kill things now. |
I've tried it on my raspi. Works as well as in the raps still lives. With
And with the standard 4.11.0 install only
fail. Might be because of arm though I don't know it was just the weakest computer I have. |
@ChrisJefferson maybe take a look at #3624 for some inspiration -- in particular, I found that for me, a tiny number of packages dominate the overall build time, and it therefore helps to not just build multiple packages in parallel, but also to let packages use more than one CPU. The trick bit is to coordinate this. That said, I really am sad that we still have to put lipstick on this pig of a script. I hope we can soon work towards moving this functionality into PackageManager, and improving it there, and using that to install and build packages... and perhaps even eventually discard the monolithic package distribution... |
In particular, one can use |
5491c36
to
8eeb53f
Compare
Sorry, didn't push an update. Now I use MAKEFLAGS, and do a slightly cheap thing to limit parallelisation too. As you say, it would be nice to replace this altogether. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisJefferson Do you plan to add changes? IMO we can merge this in as it is.
I'm happy with this as is. It could obviously be better, but it's (for me at least) better for now. |
Ok. Then someone (@fingolfin ?) needs to press the button since I'm not authorized to merge things. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we just merge this? Is there anything left to be done?
Ah I just saw the most recent comment by @ChrisJefferson somehow missed it before. Will merge it then. Of course one could make the job numbers (3 for make and 4 globally) adjustable, but for now this seem fine. |
Backported to stable-4.11 in commit 0b8e439 |
@@ -278,7 +285,19 @@ do | |||
echo | |||
warning "$PKG does not seem to be a package directory, skipping" | |||
fi | |||
) & | |||
if [ "x$PARALLEL" != "xyes" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errr, wait, this check is the wrong way around, isn't it?
This PR adds a --parallel to BuildPackages.sh. It just builds all packages in parallel at the same time.
It would be better to build packages with a more configurable limit, but that would add a lot more code, and probably require some extra dependancy which not all OSes would have (gnu parallel has to be installed, many machines don't have an xargs with -P yet).
On my machine, this speeds up running BuildPackages.sh from 3 minutes 49 seconds to 58 seconds.