Backout b0eedb4c140b (bug 1412983 part 6) for breaking local Windows builds; r=bustage; a=bustage
authorNathan Froyd <froydnj@mozilla.com>
Thu, 16 Nov 2017 09:53:34 -0500
changeset 392159 d49e40cb14e5de521fdade4a872d0fa804d7d400
parent 392158 92235deefc25008210fc2d433cb92174d6adf1b1
child 392160 2c78cf003670a4beeb8730a78daf1edf9e744c1c
push id32912
push usernfroyd@mozilla.com
push dateThu, 16 Nov 2017 14:55:14 +0000
treeherdermozilla-central@d49e40cb14e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage, bustage
bugs1412983
milestone59.0a1
backs outb0eedb4c140bcafafc82475b352355a7b5affd3b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout b0eedb4c140b (bug 1412983 part 6) for breaking local Windows builds; r=bustage; a=bustage
build/moz.configure/toolchain.configure
python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -409,27 +409,16 @@ def get_compiler_info(compiler, language
     check += dedent('''\
         #if _MSC_VER || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
         %ENDIANNESS "little"
         #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
         %ENDIANNESS "big"
         #endif
     ''')
 
-    # Try including a header to ensure that cross-compilers are set up
-    # correctly.
-    header = {
-        'C': 'stddef.h',
-        'C++': 'cstddef',
-    }[language]
-
-    check += dedent('''\
-        #include <%(header)s>
-    ''' % {'header': header})
-
     result = try_preprocess(compiler, language, check)
 
     if not result:
         raise FatalCheckError(
             'Unknown compiler or compiler not supported.')
 
     # Metadata emitted by preprocessors such as GCC with LANG=ja_JP.utf-8 may
     # have non-ASCII characters. Treat the output as bytearray.
@@ -807,37 +796,33 @@ def compiler(language, host_or_target, c
     # Normally, we'd use `var` instead of `_var`, but the interaction with
     # old-configure complicates things, and for now, we a) can't take the plain
     # result from check_prog as CC/CXX/HOST_CC/HOST_CXX and b) have to let
     # old-configure AC_SUBST it (because it's autoconf doing it, not us)
     compiler = check_prog('_%s' % var, what=what, progs=default_compilers,
                           input=provided_compiler.compiler,
                           paths=toolchain_search_path)
 
-    @depends(compiler, provided_compiler, compiler_wrapper, host_or_target,
-             extra_toolchain_flags)
+    @depends(compiler, provided_compiler, compiler_wrapper, host_or_target)
     @checking('whether %s can be used' % what, lambda x: bool(x))
     @imports(_from='mozbuild.shellutil', _import='quote')
     def valid_compiler(compiler, provided_compiler, compiler_wrapper,
-                       host_or_target, extra_flags):
+                       host_or_target):
         wrapper = list(compiler_wrapper or ())
         if provided_compiler:
             provided_wrapper = list(provided_compiler.wrapper)
             # When doing a subconfigure, the compiler is set by old-configure
             # and it contains the wrappers from --with-compiler-wrapper and
             # --with-ccache.
             if provided_wrapper[:len(wrapper)] == wrapper:
                 provided_wrapper = provided_wrapper[len(wrapper):]
             wrapper.extend(provided_wrapper)
             flags = provided_compiler.flags
         else:
             flags = []
-        toolchain_flags = []
-        if host_or_target_str == 'target' and extra_flags:
-            toolchain_flags = extra_flags
 
         # Ideally, we'd always use the absolute path, but unfortunately, on
         # Windows, the compiler is very often in a directory containing spaces.
         # Unfortunately, due to the way autoconf does its compiler tests with
         # eval, that doesn't work out. So in that case, check that the
         # compiler can still be found in $PATH, and use the file name instead
         # of the full path.
         if quote(compiler) != compiler:
@@ -849,30 +834,29 @@ def compiler(language, host_or_target, c
                     % quote(os.path.dirname(full_path)))
             if os.path.normcase(find_program(compiler)) != os.path.normcase(
                     full_path):
                 die('Found `%s` before `%s` in your $PATH. '
                     'Please reorder your $PATH.',
                     quote(os.path.dirname(found_compiler)),
                     quote(os.path.dirname(full_path)))
 
-        info = check_compiler(wrapper + [compiler] + flags + toolchain_flags,
-                              language, host_or_target)
+        info = check_compiler(wrapper + [compiler] + flags, language,
+                              host_or_target)
 
         # Check that the additional flags we got are enough to not require any
         # more flags. If we get an exception, just ignore it; it's liable to be
         # invalid command-line flags, which means the compiler we're checking
         # doesn't support those command-line flags and will fail one or more of
         # the checks below.
         try:
             if info.flags:
                 flags += info.flags
-                info = check_compiler(wrapper + [compiler] + flags +
-                                      toolchain_flags,
-                                      language, host_or_target)
+                info = check_compiler(wrapper + [compiler] + flags, language,
+                                      host_or_target)
         except FatalCheckError:
             pass
 
         if not info.target_cpu or info.target_cpu != host_or_target.cpu:
             raise FatalCheckError(
                 '%s %s compiler target CPU (%s) does not match --%s CPU (%s)'
                 % (host_or_target_str.capitalize(), language,
                    info.target_cpu or 'unknown', host_or_target_str,
--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
@@ -56,30 +56,16 @@ class CompilerPreprocessor(Preprocessor)
             for k, v in context.iteritems()
         )
         try:
             return Preprocessor.do_if(self, normalize_has_feature(expression),
                                       **kwargs)
         finally:
             self.context = context
 
-    def do_include(self, args, filters=True):
-        # We need to check headers during normal configure to make sure the
-        # user doesn't have a misconfigured environment.  But for the purposes
-        # of tests, we want to ignore headers.
-
-        # stddef.h and cstddef are the headers compiler configure checks use.
-        if type(args) in (str, unicode) and '<' in args:
-            if args in ('<stddef.h>', '<cstddef>'):
-                return
-            raise Preprocessor.Error(self, 'INVALID_INCLUDE_FILE', args)
-
-        # Pass everything else through.
-        Preprocessor.do_include(self, args, filters)
-
     class Context(dict):
         def __missing__(self, key):
             return None
 
     def filter_c_substitution(self, line):
         def repl(matchobj):
             varname = matchobj.group('VAR')
             if varname in self.context: