-
Notifications
You must be signed in to change notification settings - Fork 50
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
[Feature] Configuring the number of parallel jobs #152
Comments
Makes sense indeed, could you make a PR to add that option please? |
Sorry, I currently do not possess the necessary skills to write typescript, otherwise I would certainly submit a PR request instead of an issue. |
I am a little bit confused why you can't pass the |
I haven't found any options in package.json that allow me to pass meson flags, nor any environment variables in meson's documentation. So I am currently creating a wrapper script for ninja as a workaround, but if you know of any such options, please enlighten me. |
@tristan957 We have settings to set |
Sounds like a pretty easy feature to add, since it is basically copy-paste. |
Issue
Ninja, the build system used by Meson, currently uses all available hardware threads + 2 (i.e. logical CPU count + 2) to run compilation jobs in parallel.
This is unsafe on hardware with a high logical CPU count and relatively low available memory. (e.g. on a system with 32 hardware threads but only 32 GiB of memory). As it can cause the following problem
As stated in ninja-build/ninja#1441, there is no mechanism in Ninja where an environment variable can be used to control the number of parallel jobs. So
tasks.options.env
cannot be used to work around this problem.Based on my limited and possibly inaccurate observations, the Ninja project won't be adding support for configuring the number of parallel jobs or passing flags via environment variables in the foreseeable future.
My apologies if there are any inaccuracies in the above statements.
Conclusion
In light of the above, it may be considered reasonable and to introduce an option in this extension to conveniently limit the number of parallel jobs in Ninja.
Possible workarounds
-j
flagNotes
tasks.runOptions.instanceLimit
is unrelated to limiting parallel Ninja jobsThank you very much for generously volunteering your time and skills to contribute to this important project.
The text was updated successfully, but these errors were encountered: