Bug 1361912 - Resolve mach arguments in mozharness action, not in configs; r=ted
authorGregory Szorc <gps@mozilla.com>
Wed, 03 May 2017 18:04:00 -0700
changeset 576513 402ef9d842a347123d2ba8acf22679272b330f8c
parent 576512 22e82ca6c1155483303bed7ed67a6cb412a999d2
child 576514 23050ffaf6490bb3d7811d586eb174b3c85fd4d6
push id58380
push usergszorc@mozilla.com
push dateThu, 11 May 2017 19:43:38 +0000
reviewersted
bugs1361912, 1279011
milestone55.0a1
Bug 1361912 - Resolve mach arguments in mozharness action, not in configs; r=ted Every TaskCluster Windows mozharness config was defining an identical executable entry for "mach-build." For something that's used exactly once and is identical, this is not necessary. This commit moves the login inline into the mozharness Python module. It assumes that if MOZILLABUILD is defined that it points to a MozillaBuild path and we should invoke mach through it using the same mechanism that was defined in the config files. This commit changes behavior on buildbot because it also defines MOZILLABUILD but didn't define "mach-build" before. For whatever reason, TC configs involved bash.exe from their moment of inception (5f379c98b962 / bug 1279011). This commit restores consistency between the environments. I do question whether bash.exe needs to be involved at all. But that's for another commit. MozReview-Commit-ID: I5GXHRJ1Eq0
testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
@@ -24,21 +24,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
@@ -20,21 +20,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
@@ -20,21 +20,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': False,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
@@ -26,21 +26,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': False,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
@@ -25,21 +25,16 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
-        'mach-build': [
-            os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
-            os.path.join(os.getcwd(), 'build', 'src', 'mach'),
-            '--log-no-times', 'build', '-v'
-        ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': False,
     'vcs_share_base': os.path.join('y:', os.sep, 'hg-shared'),
     'objdir': 'obj-firefox',
     'tooltool_script': [
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1633,22 +1633,26 @@ or run without that action (ie: --no-{ac
         dirs = self.query_abs_dirs()
         buildprops = os.path.join(dirs['base_work_dir'], 'buildprops.json')
         # not finding buildprops is not an error outside of buildbot
         if os.path.exists(buildprops):
             self.copyfile(
                 buildprops,
                 os.path.join(dirs['abs_work_dir'], 'buildprops.json'))
 
-        # use mh config override for mach build wrapper, if it exists
-        python = self.query_exe('python2.7')
-        default_mach_build = [python, 'mach', '--log-no-times', 'build', '-v']
-        mach_build = self.query_exe('mach-build', default=default_mach_build)
+        if 'MOZILLABUILD' in os.environ:
+            mach = [
+                os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
+                os.path.join(dirs['abs_src_dir'], 'mach')
+            ]
+        else:
+            mach = [self.query_exe('python2.7'), 'mach']
+
         return_code = self.run_command_m(
-            command=mach_build,
+            command=mach + ['--log-no-times', 'build', '-v'],
             cwd=dirs['abs_src_dir'],
             env=env,
             output_timeout=self.config.get('max_build_output_timeout', 60 * 40)
         )
         if return_code:
             self.return_code = self.worst_level(
                 EXIT_STATUS_DICT[TBPL_FAILURE],  self.return_code,
                 AUTOMATION_EXIT_CODES[::-1]