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

Forward flags to sub processes. #1079

Closed

Conversation

nicolasdespres
Copy link
Contributor

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

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.
@nico
Copy link
Collaborator

nico commented Dec 29, 2015

As mentioned on the mailing list, I don't think we should make recursive ninja a thing. I don't think this is a good change.

@nico nico closed this Dec 29, 2015
@nocnokneo
Copy link
Contributor

@nico, Could you link to the mailing list discussion you're referring to?

@nico
Copy link
Collaborator

nico commented Feb 2, 2016

https://groups.google.com/forum/#!searchin/ninja-build/%22recursive$20ninja%22 finds a few threads, and I think there are several threads on a jobserver where it's also been discussed.

@nocnokneo
Copy link
Contributor

Okay, I'd found some of those. In particular these two (for anyone else stumbling across this PR):

https://groups.google.com/forum/#!searchin/ninja-build/"recursive$20ninja"/ninja-build/niYOkWjkPW8/LSgArOH_ZZoJ
https://groups.google.com/forum/#!searchin/ninja-build/jobserver/ninja-build/PUlsr7-jpI0/Ga19TOg1c14J

But I guess I was expecting to find a thread that ended in some kind of definitive solution or consensus.

For the parallel jobs problem it seems like the current stance from the Ninja team can be summed up as: ALL the world should migrate to Ninja together and start using subninja. Changes like making Ninja jobserver-aware to ease the transition from a Makefile-dominated world are unacceptable because it wouldn't showcase all of Ninjas awesome performance optimizations.

In the case where both parent and child project are CMake-based the proposed solution to teach CMake to use the subninja command definitely makes sense and that work has begun here:

http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15364

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

Successfully merging this pull request may close these issues.

3 participants