Is it possible to "pass-through" GNU make jobserver environment to a submake served via a 3rd-party (non-make) -
when running gnu-make rules -jn
make creates jobserver managing job-count across submakes. additionally can "pass jobserver environment" make recipe prefixing +
- eg:
target : +./some/complex/call/to/another/make target
now instead of sub-make have (python) script runs complex packaging actions (too complex make). 1 of actions can run can spawn off make
command.
package.stamp : $(deps) +./packaging.py $(args) touch $@
now when make command invoked inside packaging.py
make[1]: warning: jobserver unavailable: using -j1. add `+' parent make rule.
this makes sense because whatever environment setup make, may not being honoured or passed through python.
is possible pass through jobserver
references through python program sub-make - if so, how?
there 2 aspects jobserver must preserved: first actual environment variable, make uses send options sub-makes. value being preserved properly, or else make not know should jobserver , not see warning message.
the second aspect 2 open file descriptors passed children of make. script must preserve these 2 descriptors , leave them open when invokes sub-make.
you don't show python code being used invoke sub-make. default, subprocess
module not close file descriptors, can provide close_fds=true
option have so... should not use option if want parallel make invocations work jobserver.
if you're not using subprocess
, you'll have show are doing.
you should mark python
tag it's python question.