Mark
Mark

Reputation: 5499

Bazel no longer working after upgrading Visual Studio

I recently upgraded the Visual Studio on my system and bazel build ... no longer works. For example,

C:\Users\marki\plasty>bazel build labeling:semantic_seg
INFO: Analyzed target //labeling:semantic_seg (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/users/marki/plasty/util/BUILD:59:1: C++ compilation of rule '//util:image' failed (Exit -1). Note: Remote connection/protocol failed with: execution failed
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/process.cc(199): CreateProcessW("C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\cl.exe" /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-fastbuild/bin /Ibazel-out/x64_windows-fastbuild/bin/third_party/stb/_virtual_includes/stb_image /showIncludes /MD /Od /Z7 /wd4117 "-D__DATE__=\"redacted\"" "-D__TIMESTAMP__=\"redacted\"" "-D_(...)): The system cannot find the file specified.
 (error: 2)
Target //labeling:semantic_seg failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.438s, Critical Path: 0.02s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

The directory C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702 does not exist (anymore?) on my system. However, I found the directory C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105. But I'm not sure what setting I need to change in Bazel to make it use the new directory.

Upvotes: 1

Views: 1237

Answers (1)

Mark
Mark

Reputation: 5499

After finding this thread https://github.com/bazelbuild/bazel/issues/8589, I set the environment variable BAZEL_VC_FULL_VERSION to 14.23.28105 and that seems to fix the issue.

Upvotes: 2

Related Questions