question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-Configuration Error: Visual C++ build tools not found on your machine.

See original GitHub issue

Description of the problem / feature request / question:

Visual C++ build tools seem to be needed even though the project does not do anything related to C++. It would be helpful that this were not the case, as visual studio is a separate and very large install.

This is important for Node/Typescript projects (https://github.com/bazelbuild/rules_nodejs / https://github.com/bazelbuild/rules_typescript) that do not have a C++/Java/Python build.

If possible, provide a minimal example to reproduce the problem:

mkdir bazel-repro
touch WORKSPACE
touch f.txt
echo "filegroup(name=\"foo\", srcs=[\"t.txt\"])" > BUILD.bazel
bazel run :foo
kamik@T460p MINGW64 /d/sandbox/bazel-repro
$ bazel build :foo
DEBUG: C:/users/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/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/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/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/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for Visual C++ through registry
.
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
        File "C:/users/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/external/bazel_tools/tools/cpp/cc_configure.bzl", line 34
                configure_windows_toolchain(repository_ctx)
        File "C:/users/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 316, in configure_windows_toolchain
                _find_vc_path(repository_ctx)
        File "C:/users/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 165, in _find_vc_path
                auto_configure_fail("Visual C++ build tools not foun...")
        File "C:/users/kamik/appdata/local/temp/_bazel_kamik/bgcwgegb/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 30, in auto_configure_fail
                fail(("\n%sAuto-Configuration Error:%...)))

Auto-Configuration Error: Visual C++ build tools not found on your machine.

Environment info

  • Operating System: Windows 10

  • Bazel version (output of bazel info release): release 0.6.0

/cc @alexeagle

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
aehligcommented, Oct 2, 2017

The underlying problem seems to be that the built-in autoconfiguration unconditionally searches for the C toolchain. In fact that also happens for other platforms (but having a cc is not that much of a problem there).

@lberki @mhlopko Can you have a look? Maybe we should take the idea of less implicit magic and explicitly configure what is requested/needed more seriously.

1reaction
meteorcloudycommented, Oct 18, 2017

@alexeagle @filipesilva Good news, I’ve already sent a change to avoid the hard dependency on VC, See https://bazel-review.googlesource.com/#/c/bazel/+/19050/

As long as you don’t build C++ rules without VC installed, you should not get VC error anymore.

With this change, installing Bazel on Windows using chocolatey is just one step:

  • choco install bazel (Installing bazel+msys+python)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Bazel does not find Visual C++ Build Tools?
Go to Start Menu > Settings. ... Look at the list on the top (“User variables for ”), and click the “New…” button...
Read more >
Unable to install Visual C++ build tools - Microsoft Q&A
It seems that your installation package is corrupted or damaged. Please try to download the Visual C++ Build Tools from Microsoft download page ......
Read more >
Spring Native documentation
Using Spring Boot Buildpacks support to generate a lightweight container containing a native executable. Using the Native Build Tools to ...
Read more >
Build Tools v143 not found - Visual Studio Feedback
Thank you for your feedback. Please make sure MSVC Build Tools is installed, such as MSVC v143-VS 2022 C++ x64/86 build tools (Latest)....
Read more >
Troubleshoot Automated configuration and additional ...
Automated configuration tool operations can sometimes produce errors. When this ... The usual cause is machines that were not found in Active Directory....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found