bazelbuild / migration-tooling

Migration tools for Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

\VCVARSALL.BAT doesn't exist, please check your VC++ installation

cnmade opened this issue · comments

D:\workspace\netroby\migration-tooling [master ≡]
λ  bazel run //generate_workspace
......................
DEBUG: C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: 'BAZEL_VC' is not set, start looking for the latest Visual C++ installed.
DEBUG: C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for VS%VERSION%COMNTOOLS environment variables,eg. VS140COMNTOOLS
DEBUG: C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for Visual C++ through registry
DEBUG: C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Visual C++ build tools found at D:\soft\Microsoft Visual Studio\2017\Community\\VC
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
        File "C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/cc_configure.bzl", line 37
                configure_windows_toolchain(repository_ctx)
        File "C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 323, in configure_windows_toolchain
                _find_env_vars(repository_ctx, vc_path)
        File "C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 194, in _find_env_vars
                _find_vcvarsall_bat_script(repository_ctx, vc_path)
        File "C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 188, in _find_vcvarsall_bat_script
                auto_configure_fail((vcvarsall + " doesn't exist, pl..."))
        File "C:/users/huzhifeng/appdata/local/temp/_bazel_huzhifeng/g1u2avra/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 30, in auto_configure_fail
                fail(("\n%sAuto-Configuration Error:%...)))

Auto-Configuration Error: D:\soft\Microsoft Visual Studio\2017\Community\\VC\Auxiliary\Build\VCVARSALL.BAT doesn't exist, please check your VC++ installation
INFO: Elapsed time: 5.008s
FAILED: Build did NOT complete successfully (2 packages loaded)
ERROR: Build failed. Not running target

Does this file exist on your machine?

@netroby Did you install Visual Studio 2017 and then removed it?
There might be some remaining registry info that confused Bazel.

@laszlocsomor, in this case, the migration tools doesn't need VC++. If there's no VC installation at all, Bazel should ignore the VC configuration, but there might also be a wrong VC installation there which blocks the configuration.
I think we can do more to let user bypass the VC configuration. For example, let users set BAZEL_NO_VC=1 ?

@meteorcloudy : I dislike the idea of having one more configuration variable. Can we do this in a smarter way? I think a broken installation is as good as a non-existing one, so Bazel should just ignore it. What do you and @netroby think?

I agree, we can defer the error message to execution time when we really need the compiler tools.

I had vs 2017 community installed, (not uninstall) . I can confirm it exists in my disk.

Do you mean D:\soft\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\VCVARSALL.BAT does exist?

Oh, i see. I installed Visual Studio community, but i had not select cpp development tools(I only installed C#)

But i want to using bazel to build my java project. not cpp. so why you still check the cpp tools?

@netroby : You're right, Bazel should just work in that case too. And Sir @meteorcloudy is working on that already! :)