-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 0.13.0 adds a strict requirement to have a c compiler locally (even for RE) #5133
Comments
All of the other arguments are not needed, this error is reproducible by running only:
|
Okay, managed to build bazel from head and test that, it's a similar error:
|
Okay, debugged further. Once I remove the following lines from tools/cpp/cc_configure.bzl, the build continues until a cc_library target is built:
One of these I added in f5c8c0b, the first is there since the file was first created. |
@mhlopko, do we intend to support the case of Bazel with no CC compiler? If so, we need a better way to entirely turn off cc_configure, I think. |
This failure also exists in 0.12.0. I'm not sure we've ever supported this case very well. |
I see this does work with 0.12.0, I had misunderstood the specific problem. In 0.12.0, you cannot build cc_library targets, but everything else works fine even if cc autoconfiguration fails. |
#4691 (comment) gave me the impression that not requiring a C++ toolchain if no C++ targets are requested is a goal. |
please note that for remote execution (or for local docker sandbox), even if c++ targets are requested, having a c/c++ compiler installed locally is not a requirement, so having any kind of hard check that there is a local c compiler (unless the local cc toolchain is explicitly requested) is problematic |
Would having a environment variable (e.g. DISABLE_CC_AUTOCONF) that will disable cc_configre solve this issue? |
although its not the most elegant solution, I think it should work and sounds easy enough to implement. |
@katre, will the env var thing work when the WORKSPACE file will still have the register_toolchains entry? What we want is a way to disable this statement: https://source.bazel.build/bazel/+/master:tools/cpp/cc_configure.bzl;l=84?q=register_toolchains correct? |
friendly ping @katre |
Sorry, was out on vacation until today. @mhlopko, as long as the As long as the environment variable causes an empty |
Hi all, please post the cherrypick requests in #5056 with a summary of the regression, I haven't really followed the whole discussion. Thanks! |
…N=1 is present This is useful e.g. when all C++ builds happen remotely and there's no C++ toolchain installed on the host machine. Fixes #5133. RELNOTES: None. PiperOrigin-RevId: 196798471
…N=1 is present This is useful e.g. when all C++ builds happen remotely and there's no C++ toolchain installed on the host machine. Fixes #5133. RELNOTES: None. PiperOrigin-RevId: 196798471
…N=1 is present This is useful e.g. when all C++ builds happen remotely and there's no C++ toolchain installed on the host machine. Fixes #5133. RELNOTES: None. PiperOrigin-RevId: 196798471
Description of the problem / feature request:
Bazel 0.13.0 adds a strict requirement to have a c compiler installed, even for remote builds (which should not require a c compiler locally installed - and did not with bazel 0.12.0 or earlier)
Feature requests: what underlying problem are you trying to solve with this feature?
started noticing issues with their remote execution builds since Bazel 0.13.0 was released.
If no c compiler is present locally, the following error is produced:
ERROR: Analysis of target 'xxx' failed; build aborted: no such package '@local_config_cc//': Traceback (most recent call last):
File ".../external/bazel_tools/tools/cpp/cc_configure.bzl", line 41
configure_unix_toolchain(repository_ctx, cpu_value, overriden...)
File ".../external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 413, in configure_unix_toolchain
find_cc(repository_ctx, overriden_tools)
File ".../external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 404, in find_cc
fail(("Cannot find gcc or CC%s, eithe...))
Cannot find gcc or CC, either correct your path or set the CC environment variable
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run bazel from a container that has no C compiler installed, using appropriate remote execution flags.
Example repro steps (with RE instance specific details removed):
What operating system are you running Bazel on?
debian9 (http://gcr.io/cloud-marketplace/google/debian9)
What's the output of
bazel info release
?release 0.13.0
Have you found anything relevant by searching the web?
consulted with katre@ about the issue. From conversation:
Before 0.13.0, not having CC set caused an error only if you actually used CC compilation, which [does not happen with remote execution]. This is because Bazel never tries to load the @local_config_cc// package [with RE].
After 0.13.0, the toolchains from cc autoconfiguration are always registered, so Bazel always tries to load @local_config_cc//.
The text was updated successfully, but these errors were encountered: