Closed Bug 1292439 Opened 4 years ago Closed 4 years ago

Running test_toolchain_configure.py fails locally

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox51 fixed)

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cannot_cross
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_atypical_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_gcc_misc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_ppc_ppc64
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_sparc_sparc64
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_cross_x86_x64
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_guess_cross_cxx
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_overridden_cross_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxCrossCompileToolchainTest.test_overridden_unsupported_cross_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxSimpleCrossToolchainTest.test_cross_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxSimpleCrossToolchainTest.test_cross_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_absolute_path
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_atypical_name
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_guess_cxx
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_guess_cxx_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_mismatched_compiler
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_mismatched_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_mixed_compilers
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_no_supported_compiler
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_overridden_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_unsupported_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxToolchainTest.test_unsupported_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxX86_64CrossToolchainTest.test_cross_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | LinuxX86_64CrossToolchainTest.test_cross_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXCrossToolchainTest.test_cannot_osx_cross
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXCrossToolchainTest.test_osx_cross
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXToolchainTest.test_clang
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXToolchainTest.test_forced_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXToolchainTest.test_forced_unsupported_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXToolchainTest.test_not_gcc
TEST-PASS | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | OSXToolchainTest.test_unsupported_clang
TEST-UNEXPECTED-FAIL | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | Windows64ToolchainTest.test_cannot_cross, line 921: Tuples differ: (u'c_compiler', u'Target C com... != (u'c_compiler', u'Cannot find ...
FAIL: test_cannot_cross (__main__.Windows64ToolchainTest)
Traceback (most recent call last):
  File "python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py", line 921, in test_cannot_cross
  File "python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py", line 287, in do_toolchain_test
AssertionError: Tuples differ: (u'c_compiler', u'Target C com... != (u'c_compiler', u'Cannot find ...

First differing element 1:
Target C compiler target CPU (x86) does not match --target CPU (x86_64)
Cannot find the target C compiler

+ (u'c_compiler', u'Cannot find the target C compiler')
- (u'c_compiler',
-  u'Target C compiler target CPU (x86) does not match --target CPU (x86_64)')

TEST-UNEXPECTED-FAIL | python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | Windows64ToolchainTest.test_clang, line 867: environment can only contain strings
ERROR: test_clang (__main__.Windows64ToolchainTest)
Traceback (most recent call last):
  File "python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py", line 867, in test_clang
  File "python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py", line 269, in do_toolchain_test
  File "z:\mozilla-central\python\mozbuild\mozbuild\test\configure\common.py", line 265, in get_sandbox
    sandbox.include_file(os.path.join(topsrcdir, 'moz.configure'))
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 222, in include_file
    exec_(code, self)
  File "z:\mozilla-central\python\mozbuild\mozbuild\util.py", line 58, in exec_
    exec(object, globals, locals)
  File "z:/mozilla-central/moz.configure", line 7, in <module>
    include('build/moz.configure/init.configure')
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 477, in include_impl
    self.include_file(what)
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 222, in include_file
    exec_(code, self)
  File "z:\mozilla-central\python\mozbuild\mozbuild\util.py", line 58, in exec_
    exec(object, globals, locals)
  File "z:/mozilla-central/build/moz.configure/init.configure", line 86, in <module>
    @imports(_from='mozbuild.mozconfig', _import='MozconfigLoader')
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 458, in decorator
    self._value_for(dummy)
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 302, in _value_for
    return self._value_for_depends(obj)
  File "z:\mozilla-central\python\mozbuild\mozbuild\util.py", line 923, in method_call
    cache[args] = self.func(instance, *args)
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 329, in _value_for_depends
    return func(*resolved_args)
  File "z:\mozilla-central\python\mozbuild\mozbuild\configure\__init__.py", line 773, in wrapped
    return new_func(*args, **kwargs)
  File "z:/mozilla-central/build/moz.configure/init.configure", line 114, in mozconfig
    mozconfig = loader.read_mozconfig(mozconfig, moz_build_app=current_project)
  File "z:\mozilla-central\python\mozbuild\mozbuild\mozconfig.py", line 244, in read_mozconfig
    cwd=self.topsrcdir, env=env)
  File "c:\mozilla-build\python\Lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "c:\mozilla-build\python\Lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\mozilla-build\python\Lib\subprocess.py", line 958, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

etc.
While on automation, there is no MSVC to find through the registry, the
story is different on local builds, and that can interfere with tests.

Specifically, it breaks test_toolchain_configure.py because it's not
expecting the registry to provide a valid path to an almost valid
compiler, and then fails because that compiler doesn't match the
expected target CPU.

And because build/moz.configure/toolchain.configure also affects the PATH
environment variable, subsequent tests end up failing even earlier
because executing the empty mozconfig with the modified environment then
fails because of the unicode value of PATH.

This change implements enough of _winreg to make the get_registry_values
function return nothing.

Review commit: https://reviewboard.mozilla.org/r/69472/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/69472/
Attachment #8778093 - Flags: review?(cmanchester)
Comment on attachment 8778093 [details]
Bug 1292439 - Use a fake _winreg module during tests.

https://reviewboard.mozilla.org/r/69472/#review67246
Attachment #8778093 - Flags: review?(cmanchester) → review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/52b974676017
Use a fake _winreg module during tests. r=chmanchester
https://hg.mozilla.org/mozilla-central/rev/52b974676017
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.