Bug 1603561 - [mozbuild] Ignore all potential objdirs in BuildReader._relevant_mozbuild_finder, r=firefox-build-system-reviewers,chmanchester

Currently BuildReader._relevant_mozbuild_finder attempted to exclude objdirs by
ignoring the pattern 'obj*'. However this can cause problems for developers who
don't prefix their objdirs with the string 'obj'. This attempts to ignore all
objdirs by looking for 'config.status' files in the topsrcdir.

This wasn't a huge issue before because BuildReader._relevant_mozbuild_finder
was only used in a handful of obscure edge cases. But now it's being invoked by
the taskgraph and consequently |mach try|. So we'll see this issue pop up for
people more frequently.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-12-17 01:35:05 +00:00
Родитель ebaa98b111
Коммит 68fc6af908
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -850,6 +850,11 @@ class BuildReader(object):
self._relevant_mozbuild_finder = FileFinder(self.config.topsrcdir,
ignore=ignores)
# Also ignore any other directories that could be objdirs, they don't
# necessarily start with the string 'obj'.
for path, f in self._relevant_mozbuild_finder.find('**/config.status'):
self._relevant_mozbuild_finder.ignore.add(os.path.dirname(path))
max_workers = cpu_count()
self._gyp_worker_pool = ProcessPoolExecutor(max_workers=max_workers)
self._gyp_processors = []