Bug 1497350 - Fix |./mach xpcshell-test| in the tup backend. r=ted,firefox-build-system-reviewers
authorChris Manchester <cmanchester@mozilla.com>
Tue, 09 Oct 2018 19:25:36 +0000
changeset 496063 5bdbf3c25285fb446af25ce28ec945b856a29bb4
parent 496062 9ed28d8b07dff3da4cf92af113211b2715560841
child 496064 dd418f0ef29cf4082b1379211b601fcf950836da
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, firefox-build-system-reviewers
bugs1497350
milestone64.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 1497350 - Fix |./mach xpcshell-test| in the tup backend. r=ted,firefox-build-system-reviewers Differential Revision: https://phabricator.services.mozilla.com/D8040
python/mozbuild/mozbuild/controller/building.py
python/mozbuild/mozbuild/testing.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1359,24 +1359,18 @@ class BuildDriver(MozbuildObject):
     def install_tests(self, test_objs):
         """Install test files."""
 
         if self.is_clobber_needed():
             print(INSTALL_TESTS_CLOBBER.format(
                   clobber_file=os.path.join(self.topobjdir, 'CLOBBER')))
             sys.exit(1)
 
-        if not test_objs:
-            # If we don't actually have a list of tests to install we install
-            # test and support files wholesale.
-            self._run_make(target='install-test-files', pass_thru=True,
-                           print_directory=False)
-        else:
-            install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir,
-                               '_tests', test_objs)
+        install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir,
+                           '_tests', test_objs)
 
     def _clobber_configure(self):
         # This is an optimistic treatment of the CLOBBER file for when we have
         # some trust in the build system: an update to the CLOBBER file is
         # interpreted to mean that configure will fail during an incremental
         # build, which is handled by removing intermediate configure artifacts
         # and subsections of the objdir related to python and testing before
         # proceeding.
--- a/python/mozbuild/mozbuild/testing.py
+++ b/python/mozbuild/mozbuild/testing.py
@@ -198,27 +198,25 @@ def _resolve_installs(paths, topobjdir, 
                     manifest.add_pattern_link(*install_info)
                 if len(install_info) == 2:
                     manifest.add_link(*install_info)
             except ValueError:
                 # A duplicate value here is pretty likely when running
                 # multiple directories at once, and harmless.
                 pass
 
-def install_test_files(topsrcdir, topobjdir, tests_root, test_objs):
-    """Installs the requested test files to the objdir. This is invoked by
-    test runners to avoid installing tens of thousands of test files when
-    only a few tests need to be run.
-    """
+
+def _make_install_manifest(topsrcdir, topobjdir, test_objs):
+
     flavor_info = {flavor: (root, prefix, install)
                    for (flavor, root, prefix, install) in TEST_MANIFESTS.values()}
-    objdir_dest = mozpath.join(topobjdir, tests_root)
 
     converter = SupportFilesConverter()
     install_info = TestInstallInfo()
+
     for o in test_objs:
         flavor = o['flavor']
         if flavor not in flavor_info:
             # This is a test flavor that isn't installed by the build system.
             continue
         root, prefix, install = flavor_info[flavor]
         if not install:
             # This flavor isn't installed to the objdir.
@@ -247,27 +245,45 @@ def install_test_files(topsrcdir, topobj
         if dest in install_info.external_installs:
             continue
         manifest.add_link(source, dest)
     for base, pattern, dest in install_info.pattern_installs:
         manifest.add_pattern_link(base, pattern, dest)
 
     _resolve_installs(install_info.deferred_installs, topobjdir, manifest)
 
+    return manifest
+
+
+def install_test_files(topsrcdir, topobjdir, tests_root, test_objs):
+    """Installs the requested test files to the objdir. This is invoked by
+    test runners to avoid installing tens of thousands of test files when
+    only a few tests need to be run.
+    """
+
+    if test_objs:
+        manifest = _make_install_manifest(topsrcdir, topobjdir, test_objs)
+    else:
+        # If we don't actually have a list of tests to install we install
+        # test and support files wholesale.
+        manifest = InstallManifest(mozpath.join(topobjdir, '_build_manifests',
+                                                'install', '_test_files'))
+
     harness_files_manifest = mozpath.join(topobjdir, '_build_manifests',
                                           'install', tests_root)
+
     if os.path.isfile(harness_files_manifest):
         # If the backend has generated an install manifest for test harness
         # files they are treated as a monolith and installed each time we
         # run tests. Fortunately there are not very many.
         manifest |= InstallManifest(harness_files_manifest)
 
     copier = FileCopier()
     manifest.populate_registry(copier)
-    copier.copy(objdir_dest,
+    copier.copy(mozpath.join(topobjdir, tests_root),
                 remove_unaccounted=False)
 
 
 # Convenience methods for test manifest reading.
 def read_manifestparser_manifest(context, manifest_path):
     path = manifest_path.full_path
     return manifestparser.TestManifest(manifests=[path], strict=True,
                                        rootdir=context.config.topsrcdir,