-
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
action_env variables (sometimes?) ignored in cc_library rules #12059
Comments
Potentially related to #12049 |
In examining the output I've seen that Does this help? What is this "configuration" and how is it influenced? |
Likely to be #4008. |
I'm not sure it is the same because in my case it is not a genrule that fails but a cc_library. But let's see: Building TF with 1 process only it fails on '//tensorflow/cc:cc_op_gen_main' which is
That is only used by
So there it is in |
I think you can use |
That is I noticed that for Edit: My best trace so far is the change in "configuration" I mentioned in #12059 (comment) |
Ok, it looks like you were on the right track with #4008. I bisected the TF sources between 2.2 and 2.3 to find the commit which introduced the breaking changed and found it to be this one: tensorflow/tensorflow@f827c02 The parent commit 3006330ea0c3e88651195ac7c7de654291377ebb works. However in that case it isn't "tools" but "exec_tools" where the former worked. It would be awesome if there could be some quick fix so action_env variables are passed through to dependencies build through exec_tools dependency |
Is still something we need to work on? |
Yes. As you noticed in tensorflow/tensorflow#43156 (comment) it isn't clear why and when tools or exec_tools are to be used and if exec_tools would be correct then there needs to be some way to pass environment variables through to it. Otherwise it will be impossible to build e.g. TF on some systems |
It's possible we no longer need |
Follow up to tensorflow#43156 Based on bazelbuild/bazel#12059 (comment) exec_tools might no longer be needed and hence can be replaced by tools. This fixes various build failures caused by missing environment variables in environments where they are required, e.g. using custom compilers.
Follow up to tensorflow#43156 Based on bazelbuild/bazel#12059 (comment) exec_tools might no longer be needed and hence can be replaced by tools. This fixes various build failures caused by missing environment variables in environments where they are required, e.g. using custom compilers.
Follow up to tensorflow#43156 Based on bazelbuild/bazel#12059 (comment) exec_tools might no longer be needed and hence can be replaced by tools. This fixes various build failures caused by missing environment variables in environments where they are required, e.g. using custom compilers.
Follow up to tensorflow#43156 Based on bazelbuild/bazel#12059 (comment) exec_tools might no longer be needed and hence can be replaced by tools. This fixes various build failures caused by missing environment variables in environments where they are required, e.g. using custom compilers.
This seems to be still an issue with Bazel 4.2.2, noticed with TF 2.8.4 when using CUDA where sometimes the
This is really annoying especially as it is pretty much impossible to debug and/or isolate |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Description of the problem / feature request:
I'm setting some env variables via
action_env
but they are sometimes ignored when building a library.Feature requests: what underlying problem are you trying to solve with this feature?
In this specific case I'm trying to build TensorFlow 2.3.0 with Bazel 3.4.1 and am setting CPATH via action_env but the compilation fails to find some headers and by inspecting the output I see CPATH not being passed to all compiler invocations.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Build TensorFlow according to instructions and set
--action_env=CPATH=/foo
and observe the outputAny other information, logs, or outputs that you want to share?
I observed the issue for
tensorflow/python/tools/BUILD:226:10 C++ compilation of rule '//tensorflow/core/platform/default:mutex'
. The definition for that is at https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/core/platform/default/BUILD#L206:Log output:
As you can see only the default env vars are set but none of my action_envs (I set more than CPATH)
As the cc_library rule invocation is as simple as can be and I see that with other such invocations too (e.g. tensorflow/tensorflow#37861 (comment)) I assume a bug in Bazel or a misunderstanding of the rules by the TF team or me. In that case I'd kindly ask for clarification.
I've also checked that with TF 2.1.0 and Bazel 0.29.1 this was not an issue but worked as it should for the same file (at least the rule invocation was not changed)
However for other compilations it seems to work. E.g. for
SUBCOMMAND: # @com_google_absl//absl/strings:strings [action 'Compiling external/com_google_absl/absl/strings/internal/memutil.cc', configuration: cab848d308c51b34c791977a9ba0d73e541cabe37f3e6da7b163b34d8bf29b6b, execution platform: @local_execution_config_platform//:platform]
I see all my action_env variables being passed and that is also added withcc_library
: https://github.com/abseil/abseil-cpp/blob/df3ea785d8c30a9503321a3d35ee7d35808f190d/absl/strings/BUILD.bazel#L30What could be the reason for that?
The text was updated successfully, but these errors were encountered: