Bug 1491967 - Translate arguments to |./mach build| to objdir paths when possible in the tup backend. r=firefox-build-system-reviewers,mshal

Differential Revision: https://phabricator.services.mozilla.com/D6084

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Chris Manchester 2018-09-21 20:20:49 +00:00
Родитель 4c389d3514
Коммит 2ca27f0e2a
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -301,6 +301,19 @@ class TupBackend(CommonBackend):
def build(self, config, output, jobs, verbose, what=None): def build(self, config, output, jobs, verbose, what=None):
if not what: if not what:
what = ['%s/<default>' % config.topobjdir] what = ['%s/<default>' % config.topobjdir]
else:
# Translate relsrcdir paths to the objdir when possible.
translated = []
topsrcdir = mozpath.normpath(config.topsrcdir)
for path in what:
path = mozpath.abspath(path)
if path.startswith(topsrcdir):
objdir_path = path.replace(topsrcdir, config.topobjdir)
if os.path.exists(objdir_path):
path = objdir_path
translated.append(path)
what = translated
args = [self.environment.substs['TUP'], 'upd'] + what args = [self.environment.substs['TUP'], 'upd'] + what
if self.environment.substs.get('MOZ_AUTOMATION'): if self.environment.substs.get('MOZ_AUTOMATION'):
args += ['--quiet'] args += ['--quiet']