|
| 1 | +--- third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl |
| 2 | ++++ third_party/xla/third_party/tsl/tsl/platform/default/build_config.bzl |
| 3 | +@@ -4,1 +4,1 @@ |
| 4 | +-load("@com_google_protobuf//:protobuf.bzl", "proto_gen") |
| 5 | ++# Removed load of missing proto_gen |
| 6 | +@@ -848,2 +848,45 @@ |
| 7 | + def tf_cuda_libdevice_path_deps(): |
| 8 | + return tf_platform_deps("cuda_libdevice_path") |
| 9 | ++def proto_gen_disabled(name, srcs = [], outs = [], gen_cc = 0, includes = [], **kwargs): |
| 10 | ++ pass |
| 11 | ++def proto_gen(name, srcs = [], outs = [], gen_cc = 0, includes = [], **kwargs): |
| 12 | ++ if not srcs: |
| 13 | ++ native.filegroup(name = name, srcs = kwargs.get("deps", [])) |
| 14 | ++ return |
| 15 | ++ protoc = "@com_google_protobuf//:protoc" |
| 16 | ++ pkg = native.package_name() |
| 17 | ++ cmd = "" |
| 18 | ++ for s in srcs: |
| 19 | ++ if type(s) == "string" and s.startswith(":"): |
| 20 | ++ loc = "$(location " + s + ")" |
| 21 | ++ else: |
| 22 | ++ loc = "$(locations " + s + ")" |
| 23 | ++ cmd += "for f in " + loc + "; do " |
| 24 | ++ cmd += "rel=\"$$f\"; " |
| 25 | ++ cmd += "if [[ \"$$f\" == external/org_tensorflow/third_party/xla/* ]]; then rel=\"$${f#external/org_tensorflow/third_party/xla/}\"; repo=\"external/org_tensorflow/third_party/xla\"; " |
| 26 | ++ cmd += "elif [[ \"$$f\" == external/org_tensorflow/* ]]; then rel=\"$${f#external/org_tensorflow/}\"; repo=\"external/org_tensorflow\"; " |
| 27 | ++ cmd += "elif [[ \"$$f\" == external/local_tsl/* ]]; then rel=\"$${f#external/local_tsl/}\"; repo=\"external/local_tsl\"; " |
| 28 | ++ cmd += "elif [[ \"$$f\" == external/local_xla/* ]]; then rel=\"$${f#external/local_xla/}\"; repo=\"external/local_xla\"; " |
| 29 | ++ cmd += "else rel=\"$$f\"; repo=\".\"; fi; " |
| 30 | ++ cmd += "h_file=\"$${rel%.proto}.pb.h\"; " |
| 31 | ++ cmd += "cc_file=\"$${rel%.proto}.pb.cc\"; " |
| 32 | ++ cmd += "mkdir -p \"$(RULEDIR)/$$(dirname \"$$rel\")\"; " |
| 33 | ++ cmd += "$(location " + protoc + ") -I$$repo -I. -Iexternal/org_tensorflow -Iexternal/local_tsl -Iexternal/local_xla -Iexternal/org_tensorflow/third_party/xla -Iexternal/com_google_protobuf/src --cpp_out=$(RULEDIR) $$rel; " |
| 34 | ++ cmd += "if [[ -n \"" + pkg + "\" ]]; then " |
| 35 | ++ cmd += " if [[ \"$(RULEDIR)/$$h_file\" != \"$(RULEDIR)/$${h_file#\"" + pkg + "\"/}\" ]]; then mv \"$(RULEDIR)/$$h_file\" \"$(RULEDIR)/$${h_file#\"" + pkg + "\"/}\"; fi; " |
| 36 | ++ cmd += " if [[ \"$(RULEDIR)/$$cc_file\" != \"$(RULEDIR)/$${cc_file#\"" + pkg + "\"/}\" ]]; then mv \"$(RULEDIR)/$$cc_file\" \"$(RULEDIR)/$${cc_file#\"" + pkg + "\"/}\"; fi; " |
| 37 | ++ cmd += "fi; done; " |
| 38 | ++ stripped_outs = [] |
| 39 | ++ for o in outs: |
| 40 | ++ if pkg and o.startswith(pkg + "/"): |
| 41 | ++ stripped_outs.append(o[len(pkg)+1:]) |
| 42 | ++ else: |
| 43 | ++ stripped_outs.append(o) |
| 44 | ++ native.genrule( |
| 45 | ++ name = name, |
| 46 | ++ srcs = srcs, |
| 47 | ++ outs = stripped_outs, |
| 48 | ++ cmd = cmd, |
| 49 | ++ tools = [protoc], |
| 50 | ++ tags = ["no-sandbox"], |
| 51 | ++ ) |
0 commit comments