Bug 1470079 - Add fuzzing coverage build to taskcluster draft
authorrforbes <rforbes@mozilla.com>
Thu, 21 Jun 2018 14:57:28 -0700
changeset 809844 fccc0b628d3205955cafcd6f43b980fe6c89e5d0
parent 809312 96399298b72f804bc5ce8d7dbf2039d108acd49b
push id113828
push userbmo:rforbes@mozilla.com
push dateSat, 23 Jun 2018 08:59:15 +0000
bugs1470079
milestone62.0a1
Bug 1470079 - Add fuzzing coverage build to taskcluster MozReview-Commit-ID: 7FwYAjzHJJw
browser/config/mozconfigs/linux64/nightly-fuzzing-cov
taskcluster/ci/build/linux.yml
testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_cov.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
new file mode 100644
--- /dev/null
+++ b/browser/config/mozconfigs/linux64/nightly-fuzzing-cov
@@ -0,0 +1,38 @@
+MOZ_AUTOMATION_L10N_CHECK=0
+# We still need to build with debug symbols
+ac_add_options --disable-debug
+ac_add_options --enable-optimize="-O2 -gline-tables-only"
+
+#add-on signing is checked but not enforced
+MOZ_REQUIRE_SIGNING=0
+# Enable MOZ_ALLOW_LEGACY_EXTENSIONS
+ac_add_options "MOZ_ALLOW_LEGACY_EXTENSIONS=1"
+
+. $topsrcdir/build/mozconfig.stylo
+
+# ASan specific options on Linux
+ac_add_options --enable-valgrind
+
+. $topsrcdir/build/unix/mozconfig.asan
+ac_add_options --disable-elf-hack
+
+ac_add_options --disable-sandbox
+ac_add_options --disable-profiling
+ac_add_options --disable-warnings-as-errors
+ac_add_options --enable-coverage
+
+export CFLAGS="--coverage"
+export CXXFLAGS="--coverage"
+export LDFLAGS="--coverage"
+
+ac_add_options --enable-fuzzing
+unset MOZ_STDCXX_COMPAT
+
+# Package js shell.
+export MOZ_PACKAGE_JSSHELL=1
+
+# Need this to prevent name conflicts with the normal nightly build packages
+export MOZ_PKG_SPECIAL=asan-cov
+
+. "$topsrcdir/build/mozconfig.common.override"
+
--- a/taskcluster/ci/build/linux.yml
+++ b/taskcluster/ci/build/linux.yml
@@ -554,17 +554,16 @@ linux64-asan/opt:
         need-xvfb: true
     toolchains:
         - linux64-clang
         - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-sccache
 
-
 linux64-asan-fuzzing/opt:
     description: "Linux64 Fuzzing Opt ASAN"
     index:
         product: firefox
         job-name: linux64-fuzzing-asan-opt
     treeherder:
         platform: linux64/asan
         symbol: Bof
@@ -586,16 +585,47 @@ linux64-asan-fuzzing/opt:
         need-xvfb: true
     toolchains:
         - linux64-clang
         - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-sccache
 
+linux64-asan-fuzzing-ccov/opt:
+    description: "Linux64 Fuzzing Opt ASAN w/ Coverage"
+    index:
+        product: firefox
+        job-name: linux64-fuzzing-asan-opt-cov
+    treeherder:
+        platform: linux64/asan
+        symbol: Bocf
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        env:
+            PERFHERDER_EXTRA_OPTIONS: asan-fuzzing-ccov
+        max-run-time: 3600
+    run:
+        using: mozharness
+        actions: [get-secrets build check-test update]
+        config:
+            - builds/releng_base_firefox.py
+            - builds/releng_base_linux_64_builds.py
+        script: "mozharness/scripts/fx_desktop_build.py"
+        secrets: true
+        custom-build-variant-cfg: fuzzing-cov
+        tooltool-downloads: public
+        need-xvfb: true
+    toolchains:
+        - linux64-clang
+        - linux64-gcc
+        - linux64-rust
+        - linux64-rust-size
+        - linux64-sccache
+
 linux64-asan-reporter-nightly/opt:
     description: "Linux64 Opt ASAN Reporter Nightly"
     attributes:
         nightly: true
     index:
         product: firefox
         job-name: linux64-asan-reporter-opt
         type: nightly
new file mode 100644
--- /dev/null
+++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_cov.py
@@ -0,0 +1,30 @@
+import os
+
+config = {
+    'default_actions': [
+        'clobber',
+        'build',
+        'check-test',
+        # 'update',
+    ],
+    'stage_platform': 'linux64-fuzzing-cov',
+    #### 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': '%(abs_obj_dir)s',
+        'TINDERBOX_OUTPUT': '1',
+        'TOOLTOOL_CACHE': '/builds/tooltool_cache',
+        'TOOLTOOL_HOME': '/builds',
+        'MOZ_CRASHREPORTER_NO_REPORT': '1',
+        'LC_ALL': 'C',
+        'ASAN_OPTIONS': 'detect_leaks=0',
+        ## 64 bit specific
+        'PATH': '/usr/local/bin:/bin:\
+/usr/bin:/usr/local/sbin:/usr/sbin:/sbin',
+    },
+    'mozconfig_variant': 'nightly-fuzzing-cov',
+    #######################
+}
\ No newline at end of file
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -409,16 +409,17 @@ class BuildOptionParser(object):
         'cross-debug': 'builds/releng_sub_%s_configs/%s_cross_debug.py',
         'cross-debug-searchfox': 'builds/releng_sub_%s_configs/%s_cross_debug_searchfox.py',
         'cross-debug-artifact': 'builds/releng_sub_%s_configs/%s_cross_debug_artifact.py',
         'cross-noopt-debug': 'builds/releng_sub_%s_configs/%s_cross_noopt_debug.py',
         'cross-fuzzing-asan': 'builds/releng_sub_%s_configs/%s_cross_fuzzing_asan.py',
         'cross-artifact': 'builds/releng_sub_%s_configs/%s_cross_artifact.py',
         'debug': 'builds/releng_sub_%s_configs/%s_debug.py',
         'fuzzing-debug': 'builds/releng_sub_%s_configs/%s_fuzzing_debug.py',
+        'fuzzing-cov': 'builds/releng_sub_%s_configs/%s_fuzzing_cov.py',
         'asan-and-debug': 'builds/releng_sub_%s_configs/%s_asan_and_debug.py',
         'asan-tc-and-debug': 'builds/releng_sub_%s_configs/%s_asan_tc_and_debug.py',
         'lto-tc': 'builds/releng_sub_%s_configs/%s_lto_tc.py',
         'lto-tc-and-debug': 'builds/releng_sub_%s_configs/%s_lto_tc_and_debug.py',
         'stat-and-debug': 'builds/releng_sub_%s_configs/%s_stat_and_debug.py',
         'code-coverage-debug': 'builds/releng_sub_%s_configs/%s_code_coverage_debug.py',
         'code-coverage-opt': 'builds/releng_sub_%s_configs/%s_code_coverage_opt.py',
         'source': 'builds/releng_sub_%s_configs/%s_source.py',