-
Notifications
You must be signed in to change notification settings - Fork 10.5k
swift_build_support/cmake.py: parallelize default CMake build #66212
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
Conversation
CMake's bootstrapping script can't infer a number of parallel build jobs from the number of CPU cores on its own, which means that it's not parallelized by default. Let's get the value of CPU cores when `build_jobs` is not explicitly set.
@swift-ci smoke test |
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.
Sounds like a good idea to me!
I think that using .format
would be nicer to be more modern python but 🤷♂️ that is a nit.
For modern Python I'd prefer an f-string, which seems to me like a thing closest to Swift string interpolation, but I don't think we started requiring specific minor Python versions yet, right? I assume we have to support Python 3.0 in these scripts? |
Pretty sure that we want Python 3.9 as that is what Xcode and Visual Studio already ship with. The question is, do the oldest Linux distributions that we support have that python version? |
@swift-ci smoke test |
@swift-ci python lint |
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.
Seems reasonable to me. I'm someone curious how much improvement we get here because make -j
should impose no limit on the number of jobs running simultaneously. Were we over-provisioning jobs? Anyway, seems reasonable.
|
…ang#66212) CMake's bootstrapping script can't infer a number of parallel build jobs from the number of CPU cores on its own, which means that it's not parallelized by default. Let's get the value of CPU cores when `build_jobs` argument is not explicitly set. `make -j` only has an effect on CMake's post-bootstrap build jobs, while a substantial amount of time was spent building code sequentially in CMake's bootstrap script without that `--parallelize` option, which is called on a line preceding the `make -j` invocation.
CMake's bootstrapping script can't infer a number of parallel build jobs from the number of CPU cores on its own, which means that it's not parallelized by default. Let's get the value of CPU cores when
build_jobs
argument is not explicitly set.