add runMain to avoid spawning subprocesses for recursive building