Bug 1499915 - Use elfhack from the build for Android xpcshell tests r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 24 Oct 2018 13:45:50 +0000
changeset 491232 fbe393405a4ac2fccae94a26d173fc9fbe30e276
parent 491231 550a527e90ee52ce0ec3095b2fd977446ee2f5f2
child 491233 2ab590b3ed3f6534c07bae569ec3c84311b1e82b
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersfroydnj
bugs1499915
milestone65.0a1
Bug 1499915 - Use elfhack from the build for Android xpcshell tests r=froydnj Android xpcshell tests run `elfhack -r`, and do so by using an elfhack binary from an archive downloaded via tooltool (which contains other things). Instead, we just put the elfhack binary in the target.common.tests.tar.gz archive, and make the xpcshell harness use it from there instead, allowing to pick in-tree changes to elfhack. Depends on D9623 Differential Revision: https://phabricator.services.mozilla.com/D9624
python/mozbuild/mozbuild/action/test_archive.py
testing/xpcshell/remotexpcshelltests.py
--- a/python/mozbuild/mozbuild/action/test_archive.py
+++ b/python/mozbuild/mozbuild/action/test_archive.py
@@ -298,17 +298,25 @@ ARCHIVE_FILES = {
             ],
             'dest': 'bin/components',
         },
         {
             'source': buildconfig.topsrcdir,
             'base': 'build/pgo/certs',
             'pattern': '**',
             'dest': 'certs',
-        }
+        },
+        {
+            'source': buildconfig.topobjdir,
+            'base': 'build/unix/elfhack',
+            'patterns': [
+                'elfhack%s' % buildconfig.substs['BIN_SUFFIX'],
+            ],
+            'dest': 'bin',
+        },
     ],
     'cppunittest': [
         {
             'source': STAGE,
             'base': '',
             'pattern': 'cppunittest/**',
         },
         # We don't ship these files if startup cache is disabled, which is
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -425,22 +425,19 @@ class XPCShellRemote(xpcshell.XPCShellTe
             remoteFile = posixpath.join(self.remoteBinDir,
                                         os.path.basename(self.options['localAPK']))
             self.device.push(self.options['localAPK'], remoteFile)
             self.device.chmod(remoteFile, root=True)
 
         self.pushLibs()
 
     def pushLibs(self):
-        elfhack = None
-        xrePath = self.options.get('xrePath')
-        if xrePath:
-            elfhack = os.path.join(xrePath, 'elfhack')
-            if not os.path.exists(elfhack):
-                elfhack = None
+        elfhack = os.path.join(self.localBin, 'elfhack')
+        if not os.path.exists(elfhack):
+            elfhack = None
         pushed_libs_count = 0
         if self.options['localAPK']:
             try:
                 dir = tempfile.mkdtemp()
                 for info in self.localAPKContents.infolist():
                     if info.filename.endswith(".so"):
                         print("Pushing %s.." % info.filename, file=sys.stderr)
                         remoteFile = posixpath.join(self.remoteBinDir,