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

Environment variable controlling max number of jobs #922

Closed
scheib opened this issue Mar 2, 2015 · 3 comments
Closed

Environment variable controlling max number of jobs #922

scheib opened this issue Mar 2, 2015 · 3 comments

Comments

@scheib
Copy link

scheib commented Mar 2, 2015

I'd like to propose an environment variable NINJA_JOBS as an alternative to the command line argument -j.

This would allow systems where the default configuration isn't appropriate to have a single setup step to correct for it but simplify all future command line executions. E.g. environments where distributed build tools such as distcc or goma are used.

Happy to code patch if there's agreement.

@nico
Copy link
Collaborator

nico commented Mar 3, 2015

dupe of #816, related to #797

(if you want this, can't you just alias pninja=ninja -j $FOO?)

@scheib
Copy link
Author

scheib commented Mar 3, 2015

A different name for ninja requires all other aliases, cut-n-paste command lines, and manual entry to conform. I'd rather set an environment variable once and not think about it again.

A same name alias mostly works, alias ninja=which ninja -j 123, but trips up if a -j is ever entered. This is (almost) my current work around, but the environment variable seems cleaner.

(Ok, my actual work around has some platform detection

alias ninja='`ninja-detect-goma`'
alias ninja-detect-goma='if [ -e ~/goma ]; then if [ `uname` == "Darwin" ]; then echo ninja -j 100; else echo ninja -j 1024; fi; else echo ninja; fi'

)

@nico
Copy link
Collaborator

nico commented Nov 12, 2015

Let's close this as dupe of #816, which we think we don't want to do.

@nico nico closed this as completed Nov 12, 2015
nicolasdespres added a commit to nicolasdespres/ninja that referenced this issue Dec 20, 2015
When ninja invokes ninja (for instance when building a sub-project) it
is useful to have a way to control the flags used by the sub-ninja
process. If I pass '-d explain' or '-v' when starting
ninja from the command line on the top project, I expect these flags
to be forwarded to the sub-ninja process.

Note that this patch has limited parsing capabilities of the
NINJA_FLAGS environment variables but that should be enough for our
use case.

Fixes ninja-build#797, ninja-build#922 and ninja-build#816.
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

2 participants