Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tlemo opened this issue Apr 12, 2019 · 9 comments
Closed

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

tlemo opened this issue Apr 12, 2019 · 9 comments
Labels
area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged

Comments

@tlemo
Copy link

tlemo commented Apr 12, 2019

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

@cg31
Copy link

cg31 commented Apr 13, 2019

I can confirm it.

And I found this:
#7686

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

@yrwy
Copy link

yrwy commented Apr 13, 2019

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

@jin jin added area-Windows Windows-specific issues and feature requests untriaged labels Apr 14, 2019
@laszlocsomor
Copy link
Contributor

#7872 fixed this.
Bazel 0.25.0 will have the fix.

@raulftang
Copy link

Hi laszlocsomor,

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

Thanks.

@laszlocsomor
Copy link
Contributor

@raulftang : It's not released yet. Follow #7498

@liao1995
Copy link

liao1995 commented Aug 8, 2019

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

worked for me.

@ys10
Copy link

ys10 commented Aug 13, 2019

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.

@fighttiger25
Copy link

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.

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@amuuu
Copy link

amuuu commented Aug 3, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged
Projects
None yet
Development

No branches or pull requests