Bug 1340637 - Skip geckodriver in hazard builds; r=ted
One of the Rust crates that is built as part of geckodriver's dependency
chain uses a build script to compile some C code.
Because mozbuild does not yet pass the compiler wrapper down to where
the gcc crate can find it, we need to avoid building on geckodriver when
this is the case.
When compiling the browser for the rooting hazard analysis build (labelled
H on Treeherder), the MOZ_HAZARD environment variable will be set and
available to moz.build descriptions.
MozReview-Commit-ID: GprFKtvXvOE
--- a/browser/config/mozconfigs/linux64/hazards
+++ b/browser/config/mozconfigs/linux64/hazards
@@ -2,16 +2,18 @@
# analysis build (labeled H on treeherder). See
# https://wiki.mozilla.org/Javascript:SpiderMonkey:ExactStackRooting
# Do NOT include build/unix/mozconfig.linux because it points directly at the
# tooltool-installed gcc, and the analysis works by wrapping the gcc invocation
# with a script that invokes the real gcc with -fplugin and its configuration
# directives. Instead, duplicate the contents of that mozconfig here:
+MOZ_HAZARD=1
+
MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_L10N_CHECK=0
MOZ_AUTOMATION_PACKAGE=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_UPLOAD=0
. "$topsrcdir/build/mozconfig.common"
ac_add_options --enable-elf-hack
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -135,16 +135,19 @@ set_config('MOZ_USING_SCCACHE', using_sc
option(env='SCCACHE_VERBOSE_STATS', help='Print verbose sccache stats after build')
@depends(using_sccache, 'SCCACHE_VERBOSE_STATS')
def sccache_verbose_stats(using_sccache, verbose_stats):
return using_sccache and bool(verbose_stats)
set_config('SCCACHE_VERBOSE_STATS', sccache_verbose_stats)
+option(env='MOZ_HAZARD', help='Build for the GC rooting hazard analysis')
+set_config('MOZ_HAZARD', depends_if('MOZ_HAZARD')(lambda _: True))
+
@depends('--with-compiler-wrapper', ccache)
@imports(_from='mozbuild.shellutil', _import='split', _as='shell_split')
def compiler_wrapper(wrapper, ccache):
if wrapper:
raw_wrapper = wrapper[0]
wrapper = shell_split(raw_wrapper)
wrapper_program = find_program(wrapper[0])
if not wrapper_program:
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -149,22 +149,25 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']
DIRS += ['/addon-sdk']
if CONFIG['ENABLE_MARIONETTE']:
DIRS += [
'/testing/firefox-ui',
'/testing/marionette',
]
- # Disable building of geckodriver for artifcat builds and in
- # environments where cross compiling occurs (macOS and Android).
+ # Disable building of geckodriver for artifact builds and in
+ # environments where cross compiling occurs (macOS and Android),
+ # and on hazard builds.
#
# https://bugzilla.mozilla.org/show_bug.cgi?id=1341041
# https://bugzilla.mozilla.org/show_bug.cgi?id=1329737
- if CONFIG['COMPILE_ENVIRONMENT'] and not CONFIG['CROSS_COMPILE']:
+ if CONFIG['COMPILE_ENVIRONMENT'] and \
+ not CONFIG['CROSS_COMPILE'] and \
+ not CONFIG['MOZ_HAZARD']:
DIRS += ['/testing/geckodriver']
DIRS += [
'/tools/quitter',
'/media/gmp-clearkey/0.1',
]
if CONFIG['ENABLE_TESTS']: