Bug 927672 - Force pymake to fall back to mozmake when run on build slaves. r=gps

This commit is contained in:
Mike Hommey 2014-03-25 15:51:13 +09:00
parent 87638a0888
commit 3fd5ad6bb2

View File

@ -12,6 +12,20 @@ import pymake.command, pymake.process
import gc
if __name__ == '__main__':
if 'TINDERBOX_OUTPUT' in os.environ:
# When building on mozilla build slaves, execute mozmake instead. Until bug
# 978211, this is the easiest, albeit hackish, way to do this.
import subprocess
mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
'mozmake.exe')
if os.path.exists(mozmake):
cmd = [mozmake]
cmd.extend(sys.argv[1:])
shell = os.environ.get('SHELL')
if shell and not shell.lower().endswith('.exe'):
cmd += ['SHELL=%s.exe' % shell]
sys.exit(subprocess.call(cmd))
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)