Bug 1429342 - Ignore `mach file-info` arguments that don't resolve to paths; r=froydnj
authorGregory Szorc <gps@mozilla.com>
Tue, 16 Jan 2018 16:40:30 -0800
changeset 453919 99a0da207fc3524654a74a0d0f4cbe8434b62137
parent 453918 1e723381da62b08b15147357610b989aecc853e4
child 453920 7140b4a3c47adf5094187fbea6d321154033cbb1
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1429342
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1429342 - Ignore `mach file-info` arguments that don't resolve to paths; r=froydnj Without this, e.g. `mach file-info bugzilla-component build/does-not-exist` reports the bug component is `Core :: Build Config`. Because paths in CI have `build/` prefixes, people were typing `build/` paths into `mach file-info` and reporting bugs against `Core :: Build Config`. MozReview-Commit-ID: 8Zp6cnuw0Sh
python/mozbuild/mozbuild/frontend/mach_commands.py
--- a/python/mozbuild/mozbuild/frontend/mach_commands.py
+++ b/python/mozbuild/mozbuild/frontend/mach_commands.py
@@ -300,16 +300,21 @@ class MozbuildFileCommands(MachCommandBa
         # Expand wildcards.
         # One variable is for ordering. The other for membership tests.
         # (Membership testing on a list can be slow.)
         allpaths = []
         all_paths_set = set()
         for p in relpaths:
             if '*' not in p:
                 if p not in all_paths_set:
+                    if not os.path.exists(mozpath.join(self.topsrcdir, p)):
+                        print('(%s does not exist; ignoring)' % p,
+                              file=sys.stderr)
+                        continue
+
                     all_paths_set.add(p)
                     allpaths.append(p)
                 continue
 
             if rev:
                 raise InvalidPathException('cannot use wildcard in version control mode')
 
             # finder is rooted at / for now.