From d40158788407d64ac8049ce9b460207748a6a459 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 3 May 2017 18:10:33 -0700 Subject: [PATCH] Bug 1361912 - Stop defining python2.7 executable as sys.executable; r=ted The "python2.7" executable is always defined as sys.executable in mozharness configs. This abstraction is not necessary. This commit removes the "python2.7" executable from mozharness configs and just inlines sys.executable instead. MozReview-Commit-ID: 4xiEkoFwekr --HG-- extra : source : a7a7eb83f9cbf1e6dda8472af8aa35fda2edff88 extra : histedit_source : 9075cf31c84937bbc0d05886ee8a5636de1c3c06%2C50f817f93d1436ff46c670b09321523b8c27ab55 --- .../builds/releng_base_mac_64_builds.py | 1 - .../builds/releng_base_mac_64_cross_builds.py | 1 - .../builds/releng_base_windows_32_builds.py | 1 - .../builds/releng_base_windows_64_builds.py | 1 - .../releng_sub_mac_configs/64_artifact.py | 1 - .../64_debug_artifact.py | 1 - .../builds/taskcluster_firefox_win32_clang.py | 1 - .../taskcluster_firefox_win32_clang_debug.py | 1 - .../taskcluster_firefox_win32_qr_debug.py | 1 - .../taskcluster_firefox_win32_qr_opt.py | 1 - .../taskcluster_firefox_win64_asan_debug.py | 1 - .../taskcluster_firefox_win64_asan_opt.py | 1 - .../builds/taskcluster_firefox_win64_clang.py | 1 - .../taskcluster_firefox_win64_clang_debug.py | 1 - .../taskcluster_firefox_win64_qr_debug.py | 1 - .../taskcluster_firefox_win64_qr_opt.py | 1 - ...skcluster_firefox_windows_32_addondevel.py | 1 - .../taskcluster_firefox_windows_32_debug.py | 1 - .../taskcluster_firefox_windows_32_opt.py | 1 - ...skcluster_firefox_windows_64_addondevel.py | 1 - .../taskcluster_firefox_windows_64_debug.py | 1 - .../taskcluster_firefox_windows_64_opt.py | 1 - .../mozharness/configs/single_locale/win32.py | 1 - .../mozharness/configs/single_locale/win64.py | 1 - .../mozharness/mozilla/building/buildbase.py | 23 +++++++------------ .../mozharness/mozilla/l10n/locales.py | 3 +-- testing/mozharness/scripts/desktop_l10n.py | 3 +-- .../scripts/desktop_partner_repacks.py | 3 +-- testing/mozharness/scripts/repackage.py | 6 ++--- 29 files changed, 13 insertions(+), 49 deletions(-) diff --git a/testing/mozharness/configs/builds/releng_base_mac_64_builds.py b/testing/mozharness/configs/builds/releng_base_mac_64_builds.py index 6309d1e54e48..777c02bd22d9 100644 --- a/testing/mozharness/configs/builds/releng_base_mac_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_mac_64_builds.py @@ -19,7 +19,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": "/tools/buildbot/bin/buildbot", }, 'app_ini_path': '%(obj_dir)s/dist/bin/application.ini', diff --git a/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py b/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py index 2adf4646eb07..aa68d3850633 100644 --- a/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py +++ b/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py @@ -16,7 +16,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": "/tools/buildbot/bin/buildbot", }, 'app_ini_path': '%(obj_dir)s/dist/bin/application.ini', diff --git a/testing/mozharness/configs/builds/releng_base_windows_32_builds.py b/testing/mozharness/configs/builds/releng_base_windows_32_builds.py index ab56666f6a81..8735f9a7cad0 100644 --- a/testing/mozharness/configs/builds/releng_base_windows_32_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_32_builds.py @@ -23,7 +23,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": [ sys.executable, 'c:\\mozilla-build\\buildbotve\\scripts\\buildbot' diff --git a/testing/mozharness/configs/builds/releng_base_windows_64_builds.py b/testing/mozharness/configs/builds/releng_base_windows_64_builds.py index 47d0fc1d4de9..cb30e0b11e07 100644 --- a/testing/mozharness/configs/builds/releng_base_windows_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_64_builds.py @@ -23,7 +23,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": [ sys.executable, 'c:\\mozilla-build\\buildbotve\\scripts\\buildbot' diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py index 1f094748c5b7..f619386c14f7 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py @@ -15,7 +15,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": "/tools/buildbot/bin/buildbot", }, 'app_ini_path': '%(obj_dir)s/dist/bin/application.ini', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py index ae01b1575c0c..041ef491ba48 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py @@ -17,7 +17,6 @@ config = { ], "buildbot_json_path": "buildprops.json", 'exes': { - 'python2.7': sys.executable, "buildbot": "/tools/buildbot/bin/buildbot", }, 'app_ini_path': '%(obj_dir)s/dist/bin/application.ini', diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py index 3c71730cf0ae..06b2ff08e326 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py index e2a6ff934058..95cfc7186245 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py index 53a26a1670e5..42d390854fb4 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py index c02fa0eacd2b..51aff5a37b3e 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py index 9664a8b8f51f..5e8d974f3382 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py index c57451500c6f..8702bed13fa4 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py index 11740deae8c4..8e1950eaf2cc 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py index a12155f0d7aa..6c9d8ae24fc2 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py @@ -22,7 +22,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py index 94472e05749d..dcd0bb4fe8ea 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py @@ -18,7 +18,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py index c056176a65df..1b331a5bf95a 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py @@ -18,7 +18,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py index cc3b3af011ab..2409d966c3cb 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py index c2820ed083c2..0ac94f57e683 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py index 73399348f2da..c1bcd37f5ab7 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py index c4fc7ae4462a..e84374b205b3 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py @@ -24,7 +24,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py index a36abf812c96..868af9176bdc 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py index b79a4576182d..8e2fc27887ca 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py @@ -23,7 +23,6 @@ config = { 'check-test', ], 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, os.path.join( diff --git a/testing/mozharness/configs/single_locale/win32.py b/testing/mozharness/configs/single_locale/win32.py index a4dd185e86fe..f6780ec1b3f7 100644 --- a/testing/mozharness/configs/single_locale/win32.py +++ b/testing/mozharness/configs/single_locale/win32.py @@ -68,7 +68,6 @@ config = { # use mozmake? "enable_mozmake": True, 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, 'c:/mozilla-build/buildbotve/virtualenv.py' diff --git a/testing/mozharness/configs/single_locale/win64.py b/testing/mozharness/configs/single_locale/win64.py index fcc51e2bb1f0..6a859e8c7279 100644 --- a/testing/mozharness/configs/single_locale/win64.py +++ b/testing/mozharness/configs/single_locale/win64.py @@ -68,7 +68,6 @@ config = { # use mozmake? "enable_mozmake": True, 'exes': { - 'python2.7': sys.executable, 'virtualenv': [ sys.executable, 'c:/mozilla-build/buildbotve/virtualenv.py' diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 67897ae1272f..db3a7e4a47c9 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -750,9 +750,8 @@ or run without that action (ie: --no-{action})" app_ini_path = dirs['abs_app_ini_path'] if (os.path.exists(print_conf_setting_path) and os.path.exists(app_ini_path)): - python = self.query_exe('python2.7') cmd = [ - python, os.path.join(dirs['abs_src_dir'], 'mach'), 'python', + sys.executable, os.path.join(dirs['abs_src_dir'], 'mach'), 'python', print_conf_setting_path, app_ini_path, 'App', prop ] @@ -1135,9 +1134,8 @@ or run without that action (ie: --no-{action})" return self.warning(ERROR_MSGS['tooltool_manifest_undetermined']) tooltool_manifest_path = os.path.join(dirs['abs_src_dir'], c['tooltool_manifest_src']) - python = self.query_exe('python2.7') cmd = [ - python, '-u', + sys.executable, '-u', os.path.join(dirs['abs_src_dir'], 'mach'), 'artifact', 'toolchain', @@ -1305,9 +1303,8 @@ or run without that action (ie: --no-{action})" dirs['abs_app_ini_path']), level=error_level) self.info("Setting properties found in: %s" % dirs['abs_app_ini_path']) - python = self.query_exe('python2.7') base_cmd = [ - python, os.path.join(dirs['abs_src_dir'], 'mach'), 'python', + sys.executable, os.path.join(dirs['abs_src_dir'], 'mach'), 'python', print_conf_setting_path, dirs['abs_app_ini_path'], 'App' ] properties_needed = [ @@ -1644,7 +1641,7 @@ or run without that action (ie: --no-{action})" os.path.join(dirs['abs_src_dir'], 'mach') ] else: - mach = [self.query_exe('python2.7'), 'mach'] + mach = [sys.executable, 'mach'] return_code = self.run_command_m( command=mach + ['--log-no-times', 'build', '-v'], @@ -1768,9 +1765,8 @@ or run without that action (ie: --no-{action})" def _execute_postflight_build_mach_command(self, mach_command_args): env = self.query_build_env() env.update(self.query_mach_build_env()) - python = self.query_exe('python2.7') - command = [python, 'mach', '--log-no-times'] + command = [sys.executable, 'mach', '--log-no-times'] command.extend(mach_command_args) self.run_command_m( @@ -1787,11 +1783,10 @@ or run without that action (ie: --no-{action})" """generates source archives and uploads them""" env = self.query_build_env() env.update(self.query_mach_build_env()) - python = self.query_exe('python2.7') dirs = self.query_abs_dirs() self.run_command_m( - command=[python, 'mach', '--log-no-times', 'configure'], + command=[sys.executable, 'mach', '--log-no-times', 'configure'], cwd=dirs['abs_src_dir'], env=env, output_timeout=60*3, halt_on_failure=True, ) @@ -1843,9 +1838,8 @@ or run without that action (ie: --no-{action})" env = self.query_build_env() env.update(self.query_check_test_env()) - python = self.query_exe('python2.7') cmd = [ - python, 'mach', + sys.executable, 'mach', '--log-no-times', 'build', '-v', @@ -2216,9 +2210,8 @@ or run without that action (ie: --no-{action})" env = self.query_build_env() env.update(self.query_mach_build_env()) - python = self.query_exe('python2.7') return_code = self.run_command_m( - command=[python, 'mach', 'valgrind-test'], + command=[sys.executable, 'mach', 'valgrind-test'], cwd=self.query_abs_dirs()['abs_src_dir'], env=env, output_timeout=self.config.get('max_build_output_timeout', 60 * 40) ) diff --git a/testing/mozharness/mozharness/mozilla/l10n/locales.py b/testing/mozharness/mozharness/mozilla/l10n/locales.py index 4812fd41966a..23f4794470bf 100755 --- a/testing/mozharness/mozharness/mozilla/l10n/locales.py +++ b/testing/mozharness/mozharness/mozilla/l10n/locales.py @@ -146,11 +146,10 @@ class LocalesMixin(ChunkingMixin): def run_compare_locales(self, locale, halt_on_failure=False): dirs = self.query_abs_dirs() env = self.query_l10n_env() - python = self.query_exe('python2.7') compare_locales_error_list = list(PythonErrorList) self.rmtree(dirs['abs_merge_dir']) self.mkdir_p(dirs['abs_merge_dir']) - command = [python, 'mach', 'compare-locales', + command = [sys.executable, 'mach', 'compare-locales', '--merge-dir', dirs['abs_merge_dir'], '--l10n-ini', os.path.join(dirs['abs_locales_src_dir'], 'l10n.ini'), '--l10n-base', dirs['abs_l10n_dir'], locale] diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 44218a27d1c3..1cafe4f50f57 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -698,8 +698,7 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin, return self._mach(target=target, env=env) def _get_mach_executable(self): - python = self.query_exe('python2.7') - return [python, 'mach'] + return [sys.executable, 'mach'] def _get_make_executable(self): config = self.config diff --git a/testing/mozharness/scripts/desktop_partner_repacks.py b/testing/mozharness/scripts/desktop_partner_repacks.py index ff07dffc8438..5064117d0c1b 100755 --- a/testing/mozharness/scripts/desktop_partner_repacks.py +++ b/testing/mozharness/scripts/desktop_partner_repacks.py @@ -172,8 +172,7 @@ class DesktopPartnerRepacks(ReleaseMixin, BuildbotMixin, PurgeMixin, def repack(self): """creates the repacks""" - python = self.query_exe("python2.7") - repack_cmd = [python, "partner-repacks.py", + repack_cmd = [sys.executable, "partner-repacks.py", "-v", self.config['version'], "-n", str(self.config['build_number'])] if self.config.get('platform'): diff --git a/testing/mozharness/scripts/repackage.py b/testing/mozharness/scripts/repackage.py index a9c6d2b53fb8..bde89ae5f669 100644 --- a/testing/mozharness/scripts/repackage.py +++ b/testing/mozharness/scripts/repackage.py @@ -78,10 +78,9 @@ class Repackage(BaseScript): def repackage(self): config = self.config dirs = self.query_abs_dirs() - python = self.query_exe('python2.7') infile = os.path.join(config['input_home'], config['input_filename']) outfile = os.path.join(dirs['abs_upload_dir'], config['output_filename']) - command = [python, 'mach', '--log-no-times', 'repackage', + command = [sys.executable, 'mach', '--log-no-times', 'repackage', '--input', infile, '--output', outfile] return self.run_command( @@ -135,8 +134,7 @@ class Repackage(BaseScript): def _run_configure(self): dirs = self.query_abs_dirs() - python = self.query_exe('python2.7') - command = [python, 'mach', '--log-no-times', 'configure'] + command = [sys.executable, 'mach', '--log-no-times', 'configure'] return self.run_command( command=command, cwd=dirs['abs_mozilla_dir'],