From 900260f1fda4730c371b48834342ef26a2a35017 Mon Sep 17 00:00:00 2001 From: fkang Date: Fri, 3 Jun 2016 10:19:37 -0400 Subject: [PATCH] Bug 1271622 - migrate valgrind build to use mozharness r=kmoir --- .../releng_sub_linux_configs/64_valgrind.py | 49 +++++++++++++++++++ .../mozharness/mozilla/building/buildbase.py | 22 +++++++++ .../mozharness/scripts/fx_desktop_build.py | 1 + .../tasks/branches/base_job_flags.yml | 1 + .../taskcluster/tasks/branches/base_jobs.yml | 6 +++ .../tasks/builds/opt_linux64_valgrind.yml | 31 ++++++++++++ 6 files changed, 110 insertions(+) create mode 100644 testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py create mode 100644 testing/taskcluster/tasks/builds/opt_linux64_valgrind.yml diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py new file mode 100644 index 000000000000..97ffd84f8639 --- /dev/null +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py @@ -0,0 +1,49 @@ +import os + +MOZ_OBJDIR = 'obj-firefox' + +config = { + 'default_actions': [ + 'clobber', + 'clone-tools', + 'checkout-sources', + #'setup-mock', + 'build', + #'upload-files', + #'sendchange', + 'check-test', + 'valgrind-test', + #'generate-build-stats', + #'update', + ], + 'stage_platform': 'linux64-valgrind', + 'publish_nightly_en_US_routes': False, + 'build_type': 'valgrind', + 'tooltool_manifest_src': "browser/config/tooltool-manifests/linux64/\ +releng.manifest", + 'platform_supports_post_upload_to_latest': False, + 'enable_signing': False, + 'enable_talos_sendchange': False, + #### 64 bit build specific ##### + 'env': { + 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), + 'MOZ_AUTOMATION': '1', + 'DISPLAY': ':2', + 'HG_SHARE_BASE_DIR': '/builds/hg-shared', + 'MOZ_OBJDIR': 'obj-firefox', + 'TINDERBOX_OUTPUT': '1', + 'TOOLTOOL_CACHE': '/builds/tooltool_cache', + 'TOOLTOOL_HOME': '/builds', + 'MOZ_CRASHREPORTER_NO_REPORT': '1', + 'CCACHE_DIR': '/builds/ccache', + 'CCACHE_COMPRESS': '1', + 'CCACHE_UMASK': '002', + 'LC_ALL': 'C', + ## 64 bit specific + 'PATH': '/tools/buildbot/bin:/usr/local/bin:/usr/lib64/ccache:/bin:\ +/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/tools/git/bin:/tools/python27/bin:\ +/tools/python27-mercurial/bin:/home/cltbld/bin', + }, + 'src_mozconfig': 'browser/config/mozconfigs/linux64/valgrind', + ####################### +} diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 34b950172443..94fdc17fb853 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -369,6 +369,7 @@ class BuildOptionParser(object): 'android-test': 'builds/releng_sub_%s_configs/%s_test.py', 'android-checkstyle': 'builds/releng_sub_%s_configs/%s_checkstyle.py', 'android-lint': 'builds/releng_sub_%s_configs/%s_lint.py', + 'valgrind' : 'builds/releng_sub_%s_configs/%s_valgrind.py' } build_pool_cfg_file = 'builds/build_pool_specifics.py' branch_cfg_file = 'builds/branch_specifics.py' @@ -2025,6 +2026,27 @@ or run without that action (ie: --no-{action})" AUTOMATION_EXIT_CODES[::-1] ) + def valgrind_test(self): + '''Execute mach's valgrind-test for memory leaks''' + 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'], + cwd=self.query_abs_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] + ) + self.fatal("'mach valgrind-test' did not run successfully. Please check " + "log for errors.") + + + def _post_fatal(self, message=None, exit_code=None): if not self.return_code: # only overwrite return_code if it's 0 self.error('setting return code to 2 because fatal was called') diff --git a/testing/mozharness/scripts/fx_desktop_build.py b/testing/mozharness/scripts/fx_desktop_build.py index a3add7daa669..78b8aa178a6d 100755 --- a/testing/mozharness/scripts/fx_desktop_build.py +++ b/testing/mozharness/scripts/fx_desktop_build.py @@ -37,6 +37,7 @@ class FxDesktopBuild(BuildScript, object): 'upload-files', # upload from BB to TC 'sendchange', 'check-test', + 'valgrind-test', 'package-source', 'generate-source-signing-manifest', 'multi-l10n', diff --git a/testing/taskcluster/tasks/branches/base_job_flags.yml b/testing/taskcluster/tasks/branches/base_job_flags.yml index 3e8bf19f6ae3..ccc01d3cfced 100644 --- a/testing/taskcluster/tasks/branches/base_job_flags.yml +++ b/testing/taskcluster/tasks/branches/base_job_flags.yml @@ -99,6 +99,7 @@ flags: - linux64-artifact - linux64-asan - linux64-pgo + - linux64-valgrind - macosx64 - macosx64-st-an diff --git a/testing/taskcluster/tasks/branches/base_jobs.yml b/testing/taskcluster/tasks/branches/base_jobs.yml index 7a12ea160432..3bd91d6a58d5 100644 --- a/testing/taskcluster/tasks/branches/base_jobs.yml +++ b/testing/taskcluster/tasks/branches/base_jobs.yml @@ -78,6 +78,12 @@ builds: types: opt: task: tasks/builds/opt_linux64_pgo.yml + linux64-valgrind: + platforms: + - Linux64 Valgrind + types: + opt: + task: tasks/builds/opt_linux64_valgrind.yml macosx64: platforms: - MacOSX64 diff --git a/testing/taskcluster/tasks/builds/opt_linux64_valgrind.yml b/testing/taskcluster/tasks/builds/opt_linux64_valgrind.yml new file mode 100644 index 000000000000..90c24d47ef33 --- /dev/null +++ b/testing/taskcluster/tasks/builds/opt_linux64_valgrind.yml @@ -0,0 +1,31 @@ +$inherits: + from: 'tasks/builds/base_linux64.yml' + variables: + build_name: 'linux64-valgrind' + build_type: 'opt' +task: + metadata: + name: '[TC] Linux64 Valgrind Opt' + description: 'Linux64 Valgrind Opt' + + routes: + - 'index.buildbot.branches.{{project}}.linux64-valgrind' + - 'index.buildbot.revisions.{{head_rev}}.{{project}}.linux64-valgrind' + + workerType: opt-linux64 + + payload: + env: + MH_CUSTOM_BUILD_VARIANT_CFG: 'valgrind' + MOZHARNESS_ACTIONS: 'get-secrets build valgrind-test generate-build-stats' + + maxRunTime: 72000 + + extra: + treeherder: + groupSymbol: tc + groupName: Submitted by taskcluster + symbol: V + machine: + # see https://github.com/mozilla/treeherder/blob/master/ui/js/values.js + platform: linux64 \ No newline at end of file