Bazel: Bazel doesn't seem to handle the Visual Studio 2019 toolchain layout

Created on 13 Apr 2019  路  9Comments  路  Source: bazelbuild/bazel

using Bazel release 0.24.1

set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC

bazel build ...
INFO: Analysed 2 targets (1 packages loaded, 46 targets configured).
INFO: Found 2 targets...
ERROR: BUILD:2:1: C++ compilation of rule '//:hello' failed (Exit 1)

The target you are compiling requires Visual C++ build tools.
Bazel couldn't find a valid Visual C++ build tools installation on your machine.

Visual C++ build tools seems to be installed at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC
But Bazel can't find the following tools:
VCVARSALL.BAT, cl.exe, link.exe, lib.exe, ml64.exe

Please check your installation following https://docs.bazel.build/versions/master/windows.html#using

INFO: Elapsed time: 0.275s, Critical Path: 0.04s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

area-Windows team-XProduct untriaged

Most helpful comment

rename 2019 to 2017
I use bazel to compile tensorflow,it works

All 9 comments

I can confirm it.

And I found this:
https://github.com/bazelbuild/bazel/pull/7686

I wonder if the change was in 0.24.1 and even Visual Studio 2017 works properly.

rename 2019 to 2017
I use bazel to compile tensorflow,it works

https://github.com/bazelbuild/bazel/pull/7872 fixed this.
Bazel 0.25.0 will have the fix.

Hi laszlocsomor,

But where can I get 0.25.0 now? When will you release it?

Thanks.

@raulftang : It's not released yet. Follow https://github.com/bazelbuild/bazel/issues/7498

rename 2019 to 2017
I use bazel to compile tensorflow,it works

worked for me.

rename 2019 to 2017
I use bazel to compile tensorflow,it works

I used bazel-0.21 & VS build tool 2019, meet the same problem.
And this resolution worked for me too.

rename 2019 to 2017
I use bazel to compile tensorflow,it works

I used bazel-0.21 & VS build tool 2019, meet the same problem.
And this resolution worked for me too.

Also works for me in order to build tensorflow 1.13.1 from source.

I had the same problem.
My visual studio is installed in a custom directory in another drive and initially, the C:\Program Files (x86)\Microsoft Visual Studio\2019\ directory didn't exist at all.

All the files that the error mentioned could be found in where my visual studio installed but Bazel still had errors.

Then I installed Build Tools for Visual Studio 2019 from here and changed the BAZEL_VC variable to the directory that was created in C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC and it fixed the problem. I hope this is helpful for others too.

Was this page helpful?
0 / 5 - 0 ratings