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 Build fails to find local_config_cc for gRPC #6813

Closed
JonMcDevitt opened this issue Nov 30, 2018 · 9 comments
Closed

Bazel Build fails to find local_config_cc for gRPC #6813

JonMcDevitt opened this issue Nov 30, 2018 · 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

@JonMcDevitt
Copy link

JonMcDevitt commented Nov 30, 2018

Description of the problem / feature request:

When calling bazel build :all, cannot find package '@local_config_cc'. Currently I am unsure whether this is a gRPC issue or whether this is an issue stemming from the Chocolatey installation of bazel.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Following the instructions in their build document, clone the gRPC repository (master branch).
  2. Follow the instructions for getting Bazel for Windows using Chocolatey.
  3. Follow the instructions for building C++ on Windows.
  4. From the gRPC build instructions, follow the instructions for building with bazel.

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
d:\perforce\jmcdevitt_development\apps\testapp\thirdparty\grpc/.bazelrc
d:\perforce\jmcdevitt_development\apps\testapp\thirdparty\grpc/tools/bazel.rc
release 0.19.2

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

Not applicable.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

git remote get-url origin - https://github.com/grpc/grpc
git rev-parse master - b88dfc227cd8c9ceeb7797b3265905a93880a077
git rev-parse HEAD - b88dfc227cd8c9ceeb7797b3265905a93880a077

Have you found anything relevant by searching the web?

I have tried a variety of google searches, but none of the results seem to be working as workarounds. In particular, issue 3063 seemed promising, but it is closed, and could specifically be XCode related.

Any other information, logs, or outputs that you want to share?

My bazel environment variables:

BAZEL_SH=C:\Windows\System32\bash.exe
BAZEL_VC=D:\dev\VisualStudio\VisualStudioPro2015\VC
BAZEL_VS=D:\dev\VisualStudio\VisualStudioPro2015

"Stack Trace"

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
d:\perforce\jmcdevitt_development\apps\testapp\thirdparty\grpc/.bazelrc
d:\perforce\jmcdevitt_development\apps\testapp\thirdparty\grpc/tools/bazel.rc
ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
        File "C:/users/jmcdevitt/_bazel_jmcdevitt/zxkq2hgi/external/bazel_tools/tools/cpp/cc_configure.bzl", line 51
                configure_windows_toolchain(repository_ctx)
        File "C:/users/jmcdevitt/_bazel_jmcdevitt/zxkq2hgi/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 342, in configure_windows_toolchain
                repository_ctx.template("CROSSTOOL", paths["@bazel_tools//..."], ...}": ""})
        File "C:/users/jmcdevitt/_bazel_jmcdevitt/zxkq2hgi/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 359, in repository_ctx.template
                _get_escaped_windows_msys_crosstool_content(repository_ctx)
        File "C:/users/jmcdevitt/_bazel_jmcdevitt/zxkq2hgi/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 41, in _get_escaped_windows_msys_crosstool_content
                auto_configure_fail(("Could not determine MSYS/Cygwi...))
        File "C:/users/jmcdevitt/_bazel_jmcdevitt/zxkq2hgi/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 109, in auto_configure_fail
                fail(("\n%sAuto-Configuration Error:%...))

Auto-Configuration Error: Could not determine MSYS/Cygwin root from BAZEL_SH (c:/windows/system32/bash.exe)
INFO: Elapsed time: 0.950s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

References

  1. gRPC Build Instructions
  2. Bazel Installation Instructions (Windows)
  3. Using Bazel on Windows
  4. Bazel 0.5.0 build fails on Mac OS X El Capitan
@JonMcDevitt
Copy link
Author

JonMcDevitt commented Nov 30, 2018

As an addendum, I've built this with three BAZEL environment configurations:

  1. BAZEL_VC defined, BAZEL_VS undefined
  2. BAZEL_VC undefined, BAZEL_VS defined
  3. Both defined

Unfortunately, it doesn't seem like any of the above are working, so I'm not sure there is a configuration problem?

@rongjiecomputer
Copy link
Contributor

rongjiecomputer commented Dec 1, 2018

The issue is not about your Visual C++ installation, it is caused by BAZEL_SH.

Auto-Configuration Error: Could not determine MSYS/Cygwin root from BAZEL_SH (c:/windows/system32/bash.exe)

I am guessing that c:/windows/system32/bash.exe is from WSL? WSL does not work with Bazel for now. Only MSYS2 is officially supported (though Git bash might work too).

@iirina iirina added area-Windows Windows-specific issues and feature requests untriaged labels Dec 3, 2018
@meteorcloudy
Copy link
Member

Starting from 0.20.0, Bazel won't fail when BAZEL_SH isn't set. See f66086d.
Please try upgrading Bazel to 0.20.0

@JonMcDevitt
Copy link
Author

JonMcDevitt commented Dec 3, 2018

Hi @rongjiecomputer,

I changed the BAZEL_SH to point to that, and I get the same message. I ran a clean --expunge, and then tried again with BAZEL_SH=D:\dev\MSYS2\64\msys2.exe, and it gave the following message:

Auto-Configuration Error: Could not determine MSYS/Cygwin root from BAZEL_SH (d:/dev/msys2/64/msys2.exe)
INFO: Elapsed time: 14.587s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded)

EDIT:

Sorry @meteorcloudy, I hadn't seen your post. I tried to update via chocolatey but this actually breaks and cannot find the python package.

Encountered error while reading extension file 'python/pip.bzl': no such package '@io_bazel_rules_python//python'

@meteorcloudy
Copy link
Member

meteorcloudy commented Dec 4, 2018

Can you try bazel clean --expunge? This is sometimes needed when you switch Bazel version.

@JonMcDevitt
Copy link
Author

Hi @meteorcloudy,

This was done after a clean --expunge; between every build or command I call that to make sure I'm working with a clean environment.

~Jon

@meteorcloudy
Copy link
Member

@JonMcDevitt Can you show me more error message?

@ghost
Copy link

ghost commented Oct 4, 2019

ME TOO,On linux

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

ME TOO,On linux

I tried clean --expunge but not work. Have you solved this problem?

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

6 participants