From 68fc6af9089a1e8b87c68363c948acafea181d10 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Tue, 17 Dec 2019 01:35:05 +0000 Subject: [PATCH] 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 --- python/mozbuild/mozbuild/frontend/reader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py index 76ba8f11e41b..2d9cefac056e 100644 --- a/python/mozbuild/mozbuild/frontend/reader.py +++ b/python/mozbuild/mozbuild/frontend/reader.py @@ -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 = []