|
| 1 | +Index: tensorflow/tools/def_file_filter/BUILD |
| 2 | +IDEA additional info: |
| 3 | +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| 4 | +<+>UTF-8 |
| 5 | +=================================================================== |
| 6 | +diff --git a/tensorflow/tools/def_file_filter/BUILD b/tensorflow/tools/def_file_filter/BUILD |
| 7 | +--- a/tensorflow/tools/def_file_filter/BUILD (revision 5e5cc35b4c0f629a1e092b540fdf2b63367aa5ad) |
| 8 | ++++ b/tensorflow/tools/def_file_filter/BUILD (date 1629063191558) |
| 9 | +@@ -12,3 +12,8 @@ |
| 10 | + name = "symbols_pybind", |
| 11 | + srcs = ["symbols_pybind.txt"], |
| 12 | + ) |
| 13 | ++ |
| 14 | ++filegroup( |
| 15 | ++ name = "symbols_java", |
| 16 | ++ srcs = ["symbols_java.txt"], |
| 17 | ++) |
| 18 | +Index: tensorflow/BUILD |
| 19 | +IDEA additional info: |
| 20 | +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| 21 | +<+>UTF-8 |
| 22 | +=================================================================== |
| 23 | +diff --git a/tensorflow/BUILD b/tensorflow/BUILD |
| 24 | +--- a/tensorflow/BUILD (revision 5e5cc35b4c0f629a1e092b540fdf2b63367aa5ad) |
| 25 | ++++ b/tensorflow/BUILD (date 1629063361078) |
| 26 | +@@ -1069,13 +1069,20 @@ |
| 27 | + # the dynamic libraries of custom ops can find it at runtime. |
| 28 | + genrule( |
| 29 | + name = "tensorflow_filtered_def_file", |
| 30 | +- srcs = [":tensorflow_def_file"], |
| 31 | ++ srcs = [ |
| 32 | ++ ":tensorflow_def_file", |
| 33 | ++ ":java_symbol_target_libs_file", |
| 34 | ++ ":win_lib_files_for_java_exported_symbols", |
| 35 | ++ "//tensorflow/tools/def_file_filter:symbols_java", |
| 36 | ++ ], |
| 37 | + outs = ["tensorflow_filtered_def_file.def"], |
| 38 | + cmd = select({ |
| 39 | + "//tensorflow:windows": """ |
| 40 | + $(location @local_config_def_file_filter//:def_file_filter) \\ |
| 41 | + --input $(location :tensorflow_def_file) \\ |
| 42 | +- --output $@ |
| 43 | ++ --output $@ \\ |
| 44 | ++ --symbols $(location //tensorflow/tools/def_file_filter:symbols_java) \\ |
| 45 | ++ --lib_paths_file $(location :java_symbol_target_libs_file) |
| 46 | + """, |
| 47 | + "//conditions:default": "touch $@", # Just a placeholder for Unix platforms |
| 48 | + }), |
| 49 | +@@ -1083,6 +1090,34 @@ |
| 50 | + visibility = ["//visibility:public"], |
| 51 | + ) |
| 52 | + |
| 53 | ++# Write to a file a list of all cc_library targets that we need for exporting symbols on Windows. |
| 54 | ++genrule( |
| 55 | ++ name = "java_symbol_target_libs_file", |
| 56 | ++ srcs = [":win_lib_files_for_java_exported_symbols"], |
| 57 | ++ outs = ["java_symbol_target_libs_file.txt"], |
| 58 | ++ cmd = select({ |
| 59 | ++ "//tensorflow:windows": """ |
| 60 | ++ for SRC in $(SRCS); do |
| 61 | ++ echo $$SRC | sed 's/third_party\\///g' >> $@ |
| 62 | ++ done |
| 63 | ++ """, |
| 64 | ++ "//conditions:default": "touch $@", # Just a placeholder for Unix platforms |
| 65 | ++ }), |
| 66 | ++ visibility = ["//visibility:public"], |
| 67 | ++) |
| 68 | ++ |
| 69 | ++filegroup( |
| 70 | ++ name = "win_lib_files_for_java_exported_symbols", |
| 71 | ++ srcs = [ |
| 72 | ++ "//tensorflow/cc:scope", |
| 73 | ++ "//tensorflow/cc:grad_op_registry", |
| 74 | ++ "//tensorflow/c:tf_status_helper", |
| 75 | ++ "//tensorflow/cc:ops" |
| 76 | ++ ], |
| 77 | ++ visibility = ["//visibility:private"], |
| 78 | ++) |
| 79 | ++ |
| 80 | ++ |
| 81 | + # The interface library (tensorflow.dll.if.lib) for linking tensorflow DLL library (tensorflow.dll) on Windows. |
| 82 | + # To learn more about import library (called interface library in Bazel): |
| 83 | + # https://docs.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=vs-2017#linking-implicitly |
| 84 | +Index: tensorflow/tools/def_file_filter/BUILD.tpl |
| 85 | +IDEA additional info: |
| 86 | +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| 87 | +<+>UTF-8 |
| 88 | +=================================================================== |
| 89 | +diff --git a/tensorflow/tools/def_file_filter/BUILD.tpl b/tensorflow/tools/def_file_filter/BUILD.tpl |
| 90 | +--- a/tensorflow/tools/def_file_filter/BUILD.tpl (revision 5e5cc35b4c0f629a1e092b540fdf2b63367aa5ad) |
| 91 | ++++ b/tensorflow/tools/def_file_filter/BUILD.tpl (date 1629063191583) |
| 92 | +@@ -18,3 +18,8 @@ |
| 93 | + name = "symbols_pybind", |
| 94 | + srcs = ["symbols_pybind.txt"], |
| 95 | + ) |
| 96 | ++ |
| 97 | ++filegroup( |
| 98 | ++ name = "symbols_java", |
| 99 | ++ srcs = ["symbols_java.txt"], |
| 100 | ++) |
| 101 | +Index: tensorflow/tools/def_file_filter/symbols_java.txt |
| 102 | +IDEA additional info: |
| 103 | +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| 104 | +<+>UTF-8 |
| 105 | +=================================================================== |
| 106 | +diff --git a/tensorflow/tools/def_file_filter/symbols_java.txt b/tensorflow/tools/def_file_filter/symbols_java.txt |
| 107 | +new file mode 100644 |
| 108 | +--- /dev/null (date 1629063607794) |
| 109 | ++++ b/tensorflow/tools/def_file_filter/symbols_java.txt (date 1629063607794) |
| 110 | +@@ -0,0 +1,26 @@ |
| 111 | ++[//tensorflow/cc:scope] # scope |
| 112 | ++tensorflow::Scope::graph |
| 113 | ++tensorflow::Scope::ok |
| 114 | ++tensorflow::Scope::UpdateBuilder |
| 115 | ++tensorflow::Scope::GetUniqueNameForOp |
| 116 | ++tensorflow::Scope::ExitOnError |
| 117 | ++tensorflow::Scope::WithDevice |
| 118 | ++tensorflow::Scope::WithNoControlDependencies |
| 119 | ++tensorflow::Scope::WithControlDependencies |
| 120 | ++tensorflow::Scope::NewSubScope |
| 121 | ++tensorflow::Scope::NewRootScope |
| 122 | ++tensorflow::Scope::operator= |
| 123 | ++tensorflow::Scope::~Scope |
| 124 | ++tensorflow::Scope::Scope |
| 125 | ++ |
| 126 | ++[//tensorflow/cc:ops] |
| 127 | ++tensorflow::Operation::Operation |
| 128 | ++ |
| 129 | ++[//tensorflow/cc:grad_op_registry] # custom gradients for graph |
| 130 | ++tensorflow::ops::GradOpRegistry::Global |
| 131 | ++tensorflow::ops::GradOpRegistry::Lookup |
| 132 | ++tensorflow::ops::GradOpRegistry::Register |
| 133 | ++ |
| 134 | ++[//tensorflow/c:tf_status_helper] # status helpers |
| 135 | ++tensorflow::Set_TF_Status_from_Status |
| 136 | ++tensorflow::StatusFromTF_Status |
| 137 | +=================================================================== |
| 138 | +diff --git a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl |
| 139 | +--- a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl (revision 919f693420e35d00c8d0a42100837ae3718f7927) |
| 140 | ++++ b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl (date 1632048268359) |
| 141 | +@@ -143,8 +143,8 @@ |
| 142 | + re_filter_comp = re.compile(r"{}".format(re_filter)) |
| 143 | + |
| 144 | + # Filter out symbol from the split line (`sym_split` in the for loop below). |
| 145 | +- sym_line_filter = r".*\s+\| (.*) \(.*" |
| 146 | +- sym_line_filter_anomaly = r".*\s+\| (.*)" |
| 147 | ++ sym_line_filter = r".*\s+\| (.*?) \(.*" |
| 148 | ++ sym_line_filter_anomaly = r".*\s+\| (.*?)" |
| 149 | + |
| 150 | + for sym_line in sym_split: |
| 151 | + if re_filter_comp.search(sym_line): |
0 commit comments