You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@com_google_protobuf//:well_known_types_py_pb2_genproto is not in systemlibs #60667
However, this target is not added to tensorflow/third_party/systemlibs/protobuf.BUILD. So when building TensorFlow with export TF_SYSTEM_LIBS=com_google_protobuf, the following error occurs:
ERROR: tensorflow/compiler/xla/BUILD:83:17: no such target '@com_google_protobuf//:well_known_types_py_pb2_genproto': target 'well_known_types_py_pb2_genproto' not declared in package '' defined by external/com_google_protobuf/BUILD.bazel and referenced by '//tensorflow/compiler/xla:xla_data_proto_py_genproto'
ERROR: tensorflow/compiler/xla/BUILD:83:17: no such target '@com_google_protobuf//:well_known_types_py_pb2_genproto': target 'well_known_types_py_pb2_genproto' not declared in package '' defined by external/com_google_protobuf/BUILD.bazel and referenced by '//tensorflow/compiler/xla:xla_data_proto_py_genproto
If you are willing to contribute to fix this please feel free to raise a PR.
Sorry, I am not an expert in protobuf and am not sure how to fix this. That's the reason I submit the issue.
Below is what I tried to do
diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
index 4d05ab28d12..0bae75daa1d 100644
--- a/third_party/systemlibs/protobuf.BUILD+++ b/third_party/systemlibs/protobuf.BUILD@@ -111,3 +111,11 @@ py_library(
visibility = ["//visibility:public"],
deps = [dep + "_proto" for dep in proto[1][1]],
) for proto in WELL_KNOWN_PROTO_MAP.items()]
++py_proto_library(+ name = "well_known_types_py_pb2",+ include = ".",+ srcs = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()],+ visibility = ["//visibility:public"],+)+
But I got this error:
# Execution platform: @local_execution_config_platform//:platform
In file included from ./tensorflow/tsl/platform/status.h:37,
from ./tensorflow/tsl/c/tsl_status_internal.h:19,
from ./tensorflow/c/tf_status_internal.h:19,
from tensorflow/c/tf_status.cc:18:
bazel-out/k8-opt/bin/tensorflow/tsl/protobuf/error_codes.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
10 | #include <google/protobuf/port_def.inc>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Hi @njzjz
Building with systemlibs is not officially supported. We neither support it nore have any jobs which test them. I would also strongly discourage anyone relying on those to perform a build. Also we are planning even bigger changes soon (like hermetic python) which will break systemlibs build path even further.
Supporting those was purely on community (i believe @perfinion should know the most about it).
The following is just my personal opinion, not an official statement from TF team.
I don't think we can/should maintain systemlibs build path, as it is against hermetic philosophy of our build and prevents us from doing major changes in a build to simplify it (tensorflow build definitely needs a simplification). Also, we simply do not have any CI jobs to verify them, so they can break any time on any change. There is also no clear business need to have them.
I would strongly consider moving systemlibs to a separate fork and maintain it there, if it is possible to maintain, or drop otherwise. One of the reasons why it was not causing many problems before was that were were not making many updates in our deps before (protobuf dependency was 3 years old).
Reacted by Chuck Atkins, Gavin Zhao and Malik Shahzad Muzaffar
I will close this ticket as it is related to not officially supported feature. Feel free to reopen, if you believe it should be supported (in that case, please also clarify a reason).
I don't think we can/should maintain systemlibs build path, as it is against hermetic philosophy of our build and prevents us from doing major changes in a build to simplify it (tensorflow build definitely needs a simplification)
I agree that the build needs simplification, but removing the possibility to build against systemlibs is very hostile to any redistribution effort. Tensorflow is already a beast, and just requiring that it revendors the world is neither a feasible nor reasonable strategy (from the packaging POV).
Reacted by Alexander Grund, Chuck Atkins, Malik Shahzad Muzaffar and Gavin Zhao
In a world where tensorflow was a stand-alone application that would be fine. But as a library that gets used in other applications, not supporting external dependencies is problematic at best. Especially when it comes to building custom operators against the the TF C++ library that have to use external dependencies, an inherent conflict exist with libtensorflow using its "vendored" deps via bazel while the operator has to pull in code linked to other versions of said dependencies. It's already difficult enough as it is use external deps but I think making that work much better is far more conducive to TensorFlow "playing well with others" in an ecosystem where it doesn't control the entire stack than simply abandoning it entirely.
If it's a matter of build jobs and CI resources, I'd be happy to have a discussion out-of-band on providing that for the project.
Activity
SuryanarayanaY commentedon May 24, 2023
Hi @njzjz ,
Thanks for your time in reporting the issue. I have replicated the reported behaviour with current master branch.Attached logs below for reference.
If you are willing to contribute to fix this please feel free to raise a PR.
Thanks!
njzjz commentedon May 25, 2023
Sorry, I am not an expert in protobuf and am not sure how to fix this. That's the reason I submit the issue.
Below is what I tried to do
But I got this error:
SuryanarayanaY commentedon May 29, 2023
@vam-google
CC- @learning-to-play
vam-google commentedon May 30, 2023
Hi @njzjz
Building with systemlibs is not officially supported. We neither support it nore have any jobs which test them. I would also strongly discourage anyone relying on those to perform a build. Also we are planning even bigger changes soon (like hermetic python) which will break systemlibs build path even further.
Supporting those was purely on community (i believe @perfinion should know the most about it).
The following is just my personal opinion, not an official statement from TF team.
I don't think we can/should maintain systemlibs build path, as it is against hermetic philosophy of our build and prevents us from doing major changes in a build to simplify it (tensorflow build definitely needs a simplification). Also, we simply do not have any CI jobs to verify them, so they can break any time on any change. There is also no clear business need to have them.
I would strongly consider moving systemlibs to a separate fork and maintain it there, if it is possible to maintain, or drop otherwise. One of the reasons why it was not causing many problems before was that were were not making many updates in our deps before (protobuf dependency was 3 years old).
vam-google commentedon May 30, 2023
I will close this ticket as it is related to not officially supported feature. Feel free to reopen, if you believe it should be supported (in that case, please also clarify a reason).
google-ml-butler commentedon May 30, 2023
Are you satisfied with the resolution of your issue?
Yes
No
h-vetinari commentedon May 30, 2023
I agree that the build needs simplification, but removing the possibility to build against systemlibs is very hostile to any redistribution effort. Tensorflow is already a beast, and just requiring that it revendors the world is neither a feasible nor reasonable strategy (from the packaging POV).
chuckatkins commentedon Aug 28, 2023
In a world where tensorflow was a stand-alone application that would be fine. But as a library that gets used in other applications, not supporting external dependencies is problematic at best. Especially when it comes to building custom operators against the the TF C++ library that have to use external dependencies, an inherent conflict exist with libtensorflow using its "vendored" deps via bazel while the operator has to pull in code linked to other versions of said dependencies. It's already difficult enough as it is use external deps but I think making that work much better is far more conducive to TensorFlow "playing well with others" in an ecosystem where it doesn't control the entire stack than simply abandoning it entirely.
If it's a matter of build jobs and CI resources, I'd be happy to have a discussion out-of-band on providing that for the project.