From 0b747dd41e5c38ad5b6cdbfaca439c97176a7b18 Mon Sep 17 00:00:00 2001 From: Rob Thijssen Date: Fri, 2 Dec 2016 16:40:36 +0000 Subject: [PATCH] Bug 1317976 - enable generate-build-stats on tc win builds r=gps,ted MozReview-Commit-ID: 7iDpPfRFibW --HG-- extra : rebase_source : 4e2c37e517420890e50e4dadaa25892f9bf87e02 --- .../builds/taskcluster_firefox_windows_32_debug.py | 1 + .../builds/taskcluster_firefox_windows_32_opt.py | 1 + .../builds/taskcluster_firefox_windows_64_debug.py | 1 + .../builds/taskcluster_firefox_windows_64_opt.py | 1 + .../mozharness/mozilla/building/buildbase.py | 14 ++++++++++++++ 5 files changed, 18 insertions(+) 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 ed53474ad675..ac4cd26ec6f3 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py @@ -16,6 +16,7 @@ config = { 'clone-tools', 'build', 'check-test', + 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, 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 4a6502dce0d8..e5fc23386683 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py @@ -16,6 +16,7 @@ config = { 'clone-tools', 'build', 'check-test', + 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, 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 687cf13c69be..548423b1b73a 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py @@ -16,6 +16,7 @@ config = { 'clone-tools', 'build', 'check-test', + 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, 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 ba9cc9350396..bd27eef794b6 100644 --- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py +++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py @@ -16,6 +16,7 @@ config = { 'clone-tools', 'build', 'check-test', + 'generate-build-stats' ], 'exes': { 'python2.7': sys.executable, diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 6aa19b0af002..720720de948c 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -1888,6 +1888,12 @@ or run without that action (ie: --no-{action})" return data + def get_firefox_version(self): + versionFilePath = os.path.join( + self.query_abs_dirs()['abs_src_dir'], 'browser/config/version.txt') + with open(versionFilePath, 'r') as versionFile: + return versionFile.readline().strip() + def generate_build_stats(self): """grab build stats following a compile. @@ -1918,12 +1924,20 @@ or run without that action (ie: --no-{action})" # then assume we are using MOZ_SIMPLE_PACKAGE_NAME, which means the # package is named one of target.{tar.bz2,zip,dmg}. if not packageName: + firefox_version = self.get_firefox_version() dist_dir = os.path.join(dirs['abs_obj_dir'], 'dist') for ext in ['apk', 'dmg', 'tar.bz2', 'zip']: name = 'target.' + ext if os.path.exists(os.path.join(dist_dir, name)): packageName = name break + # if we are not using MOZ_SIMPLE_PACKAGE_NAME, check for the + # default package naming convention + name = 'firefox-{}.en-US.{}.{}'.format( + firefox_version, c.get('platform'), ext) + if os.path.exists(os.path.join(dist_dir, name)): + packageName = name + break else: self.fatal("could not determine packageName")