bug 1162519 - use winrm for mach clobber on Windows. r=gps

--HG--
extra : commitid : AGLwgeTmbKQ
extra : rebase_source : 9aac8bdcfd685bb8d08f877c256c56ccba98b665
This commit is contained in:
Ted Mielczarek 2015-07-01 11:47:03 -04:00
Родитель 1c421efa41
Коммит d47a94a095
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -295,12 +295,22 @@ class MozbuildObject(ProcessExecutionMixin):
return False
return Clobberer(self.topsrcdir, self.topobjdir).clobber_needed()
def have_winrm(self):
# `winrm -h` should print 'winrm version ...' and exit 1
p = subprocess.Popen(['winrm.exe', '-h'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
return p.wait() == 1 and p.stdout.read().startswith('winrm')
def remove_objdir(self):
"""Remove the entire object directory."""
# We use mozfile because it is faster than shutil.rmtree().
# mozfile doesn't like unicode arguments (bug 818783).
rmtree(self.topobjdir.encode('utf-8'))
if sys.platform.startswith('win') and self.have_winrm():
subprocess.check_call(['winrm', '-rf', self.topobjdir])
else:
# We use mozfile because it is faster than shutil.rmtree().
# mozfile doesn't like unicode arguments (bug 818783).
rmtree(self.topobjdir.encode('utf-8'))
def get_binary_path(self, what='app', validate_exists=True, where='default'):
"""Obtain the path to a compiled binary for this build configuration.