Fix make jobserver warning.
When running the make file with a number of jobs, the following warning was generated by the make process used to parse the dependency makefile generated by OpenSCAD: make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. With this change, the variables MAKELEVEL and MAKEFLAGS are removed from the environment before starting the child make process.
This commit is contained in:
parent
e232c40ef7
commit
fb72dca77a
2 changed files with 12 additions and 3 deletions
|
|
@ -15,8 +15,17 @@ def TemporaryDirectory():
|
|||
shutil.rmtree(dir)
|
||||
|
||||
|
||||
def command(args):
|
||||
process = subprocess.Popen(args)
|
||||
def command(args, remove_env = None):
|
||||
if remove_env is None:
|
||||
env = None
|
||||
else:
|
||||
env = dict(os.environ)
|
||||
|
||||
for i in remove_env:
|
||||
if i in env:
|
||||
del env[i]
|
||||
|
||||
process = subprocess.Popen(args, env = env)
|
||||
process.wait()
|
||||
|
||||
if process.returncode:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ def main(in_path, out_path, deps_path):
|
|||
|
||||
# Use make to parse the dependency makefile written by OpenSCAD.
|
||||
util.write_file(temp_mk_path, mk_content.encode())
|
||||
util.command(['make', '-s', '-B', '-f', temp_mk_path, '-f', temp_deps_path])
|
||||
util.command(['make', '-s', '-B', '-f', temp_mk_path, '-f', temp_deps_path], remove_env = ['MAKELEVEL', 'MAKEFLAGS'])
|
||||
|
||||
# All dependencies as paths relative to the project root.
|
||||
deps = set(map(relpath, util.read_file(temp_files_path).decode().splitlines()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue