Bazel: Bazel MSVC CROSSTOOL is borken on Windows

Created on 24 Jan 2017  路  4Comments  路  Source: bazelbuild/bazel

After the fix of https://github.com/bazelbuild/bazel/issues/2402, a new error surfaced:

ERROR: C:/jenkins/workspace/bazel-tests/BAZEL_VERSION/HEAD/PLATFORM_NAME/windows-x86_64/third_party/BUILD:519:1: Couldn't build file third_party/libgtest.a: Linking of rule '//third_party:gtest' failed: msvc_link.bat failed: error executing command 
  cd C:/bazel_ci/temp/_bazel_SYSTEM/LhCiLHCO/execroot/windows-x86_64
  SET PATH=external/local_config_cc/wrapper/bin
    SET TMPDIR=c:\bazel_ci\temp
  external/local_config_cc/wrapper/bin/msvc_link.bat: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Traceback (most recent call last):
  File "C:\bazel_ci\temp\_bazel_SYSTEM\LhCiLHCO\execroot\windows-x86_64\external\local_config_cc\wrapper\bin\pydir\msvc_link.py", line 132, in <module>
    sys.exit(main(sys.argv[1:]))  # need to skip the first argument
  File "C:\bazel_ci\temp\_bazel_SYSTEM\LhCiLHCO\execroot\windows-x86_64\external\local_config_cc\wrapper\bin\pydir\msvc_link.py", line 128, in main
    return MsvcLinker().Run(argv[1:])
  File "C:\bazel_ci\temp\_bazel_SYSTEM\LhCiLHCO\execroot\windows-x86_64\external\local_config_cc\wrapper\bin\pydir\msvc_link.py", line 80, in Run
    raise msvc_tools.Error('No output file name specified!')
msvc_tools.Error: No output file name specified!

Looking at msvc_link.py, we can tell it's because no /OUT:<filename> is specified.

I bisected and found the culprit is 4cb32a994308e1b4921471e32a02c49d8ceffb84

//cc @mhlopko @laszlocsomor

P1 breakage windows release blocker bug

Most helpful comment

ETA: minutes :) Have the fix already.

All 4 comments

Very possible :) Feel free to roll back the culprit if possible, working on the fix already.

I can repro this on my machine:

>>>>> # //examples/cpp:hello-lib [action 'Linking examples/cpp/libhello-lib.a']
cd C:/tmp/_bazel_pcloudy/GYQDuV_U/execroot/bazel
  SET PATH=external/local_config_cc/wrapper/bin
  external/local_config_cc/wrapper/bin/msvc_link.bat
ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/examples/cpp/BUILD:3:1: Linking of rule '//examples/cpp:hello-lib' failed: msvc_link.bat failed: error executing command external/local_config_cc/wrapper/bin/msvc_link.bat: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

Looks like all arguments for msvc_link.bat disappeared after this change.

@mhlopko : What's the ETA for the fix? Is it on the order of an hour, a day? What'd be the cost of rolling it back?

ETA: minutes :) Have the fix already.

Was this page helpful?
0 / 5 - 0 ratings