Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.0
6.5.0
35 changes: 35 additions & 0 deletions bazel/external/flatbuffers_remove_rules_js_use.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index b4f015a0..70848962 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,5 +1,3 @@
-load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
-load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

licenses(["notice"])
@@ -8,12 +6,7 @@ package(
default_visibility = ["//visibility:public"],
)

-npm_link_all_packages(name = "node_modules")

-npm_link_package(
- name = "node_modules/flatbuffers",
- src = "//ts:flatbuffers",
-)

exports_files([
"LICENSE",
@@ -40,11 +33,9 @@ filegroup(
"BUILD.bazel",
"WORKSPACE",
"build_defs.bzl",
- "typescript.bzl",
"//grpc/src/compiler:distribution",
"//reflection:distribution",
"//src:distribution",
- "//ts:distribution",
] + glob([
"include/flatbuffers/*.h",
]),
409 changes: 409 additions & 0 deletions bazel/external/grpc-web_protobuf_v30_support.patch

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions bazel/external/grpc_go_toolchain.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl
index 4d8afa3131..514189f9a5 100644
--- a/bazel/grpc_extra_deps.bzl
+++ b/bazel/grpc_extra_deps.bzl
@@ -53,7 +53,7 @@ def grpc_extra_deps(ignore_version_differences = False):
@@ -63,7 +63,7 @@ def grpc_extra_deps(ignore_version_differences = False):
api_dependencies()

go_rules_dependencies()
- go_register_toolchains(version = "1.18")
- go_register_toolchains(version = "1.22.5")
+ go_register_toolchains()
gazelle_dependencies()

# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
13 changes: 0 additions & 13 deletions bazel/external/grpc_test_visibility.patch

This file was deleted.

19 changes: 16 additions & 3 deletions bazel/external/protobuf_javascript.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
diff --git a/generator/BUILD.bazel b/generator/BUILD.bazel
index ac7756d..a3480c8 100644
--- a/generator/BUILD.bazel
+++ b/generator/BUILD.bazel
@@ -2,7 +2,7 @@ genrule(
name = "generate_version_header",
srcs = ["//:package.json"],
outs = ["version.h"],
- cmd = "node $(location //:generate-version-header.js) $(OUTS)",
+ cmd = "/opt/px_dev/tools/node/bin/node $(location //:generate-version-header.js) $(OUTS)",
tools = ["//:generate-version-header.js"],
)

diff --git a/generator/js_generator.cc b/generator/js_generator.cc
index 97b5844..1351a54 100644
index 7ba8bf0..09b1391 100644
--- a/generator/js_generator.cc
+++ b/generator/js_generator.cc
@@ -3650,6 +3650,9 @@ void Generator::GenerateFile(const GeneratorOptions& options,
@@ -3647,6 +3647,9 @@ void Generator::GenerateFile(const GeneratorOptions& options,

for (int i = 0; i < file->dependency_count(); i++) {
const std::string& name = file->dependency(i)->name();
const std::string name = std::string(file->dependency(i)->name());
+ if (ModuleAlias(name) == "gogoproto_gogo_pb") {
+ continue;
+ }
Expand Down
68 changes: 21 additions & 47 deletions bazel/external/protobuf_text_format.patch
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index 594c8eac6..c7ef9437b 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -592,7 +592,7 @@ void CEscapeAndAppend(StringPiece src, std::string *dest) {
}
}

-std::string CEscape(const std::string &src) {
+std::string CEscape(StringPiece src) {
std::string dest;
CEscapeAndAppend(src, &dest);
return dest;
diff --git a/src/google/protobuf/stubs/strutil.h b/src/google/protobuf/stubs/strutil.h
index 9658abf90..9cf9cae83 100644
--- a/src/google/protobuf/stubs/strutil.h
+++ b/src/google/protobuf/stubs/strutil.h
@@ -328,7 +328,7 @@ PROTOBUF_EXPORT std::string UnescapeCEscapeString(const std::string& src);
//
// Escaped chars: \n, \r, \t, ", ', \, and !isprint().
// ----------------------------------------------------------------------
-PROTOBUF_EXPORT std::string CEscape(const std::string& src);
+PROTOBUF_EXPORT std::string CEscape(StringPiece src);

// ----------------------------------------------------------------------
// CEscapeAndAppend()
diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc
index 19110499d..0d116ee7e 100644
index 2c0a95d..1234567 100644
--- a/src/google/protobuf/text_format.cc
+++ b/src/google/protobuf/text_format.cc
@@ -81,6 +81,18 @@ inline bool IsOctNumber(const std::string& str) {
@@ -82,6 +82,18 @@ inline bool IsOctNumber(const std::string& str) {
(str[1] >= '0' && str[1] < '8'));
}
+// Returns true if truncatation occurred.
+bool TruncateString(int64_t max_length, StringPiece* s) {

+// Returns true if truncation occurred.
+bool TruncateString(int64_t max_length, absl::string_view* s) {
+ if (max_length > 0) {
+ int64_t excess = static_cast<int64_t>(s->size()) - max_length;
+ if (excess > 0) {
Expand All @@ -44,10 +18,10 @@ index 19110499d..0d116ee7e 100644
+ return false;
+}
+
} // namespace

namespace internal {
@@ -2555,20 +2567,22 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
// The number of fields that are redacted in AbslStringify.
std::atomic<int64_t> num_redacted_field{0};

@@ -2738,20 +2750,22 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
? reflection->GetRepeatedStringReference(message, field, index,
&scratch)
: reflection->GetStringReference(message, field, &scratch);
Expand All @@ -60,39 +34,39 @@ index 19110499d..0d116ee7e 100644
- "...<truncated>...";
- value_to_print = &truncated_value;
- }
+ StringPiece value_to_print(value);
+ absl::string_view value_to_print(value);
+ bool truncated = TruncateString(truncate_string_field_longer_than_, &value_to_print);
+
if (field->type() == FieldDescriptor::TYPE_STRING) {
- printer->PrintString(*value_to_print, generator);
+ if (truncated) {
+ printer->PrintString(StrCat(value_to_print, "...<truncated>..."), generator);
+ printer->PrintString(absl::StrCat(value_to_print, "...<truncated>..."), generator);
+ } else {
+ printer->PrintString(value, generator);
+ }
} else {
GOOGLE_DCHECK_EQ(field->type(), FieldDescriptor::TYPE_BYTES);
ABSL_DCHECK_EQ(field->type(), FieldDescriptor::TYPE_BYTES);
- printer->PrintBytes(*value_to_print, generator);
+ if (truncated) {
+ printer->PrintBytes(StrCat(value_to_print, "...<truncated>..."), generator);
+ printer->PrintBytes(absl::StrCat(value_to_print, "...<truncated>..."), generator);
+ } else {
+ printer->PrintBytes(value, generator);
+ }
}
break;
}
@@ -2708,7 +2722,14 @@ void TextFormat::Printer::PrintUnknownFields(
// This field is not parseable as a Message (or we ran out of
// recursion budget). So it is probably just a plain string.
generator->PrintMaybeWithMarker(": ", "\"");
- generator->PrintString(CEscape(value));
+ StringPiece value_to_print(value);
@@ -2937,7 +2951,14 @@ void TextFormat::Printer::PrintUnknownFields(
break;
}
generator->PrintMaybeWithMarker(MarkerToken(), ": ", "\"");
- generator->PrintString(absl::CEscape(value));
+ absl::string_view value_to_print(value);
+ bool truncated = TruncateString(truncate_string_field_longer_than_, &value_to_print);
+
+ if (truncated) {
+ generator->PrintString(CEscape(value_to_print) + "...<truncated>...");
+ generator->PrintString(absl::StrCat(absl::CEscape(value_to_print), "...<truncated>..."));
+ } else {
+ generator->PrintString(CEscape(value));
+ generator->PrintString(absl::CEscape(value));
+ }
if (single_line_mode_) {
generator->PrintLiteral("\" ");
Expand Down
16 changes: 8 additions & 8 deletions bazel/external/protobuf_warning.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ index 5e9a2c418..f95684bd1 100644
virtual_path = "";
disk_path = parts[i];
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
index 5f3427dc7..ab049c7c6 100644
index 7456d3c3d..ddcd08c17 100644
--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -8161,10 +8161,11 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
@@ -10410,10 +10410,11 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
if (is_error) {
AddError((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
error_message);
AddError(unused->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
make_error);
- } else {
- AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
- error_message);
- AddWarning(unused->name(), proto,
- DescriptorPool::ErrorCollector::IMPORT, make_error);
}
+ // else {
+ // AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
+ // error_message);
+ // AddWarning(unused->name(), proto,
+ // DescriptorPool::ErrorCollector::IMPORT, make_error);
+ // }
}
}
Expand Down
65 changes: 65 additions & 0 deletions bazel/external/tensorflow_disable_gpu_bazel_6.x.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/third_party/xla/third_party/gpus/cuda_configure.bzl b/third_party/xla/third_party/gpus/cuda_configure.bzl
index d110fa81460..80fccbfa234 100644
--- a/third_party/xla/third_party/gpus/cuda_configure.bzl
+++ b/third_party/xla/third_party/gpus/cuda_configure.bzl
@@ -278,7 +278,7 @@ def _cuda_include_path(repository_ctx, cuda_config):

def enable_cuda(repository_ctx):
"""Returns whether to build with CUDA support."""
- return int(get_host_environ(repository_ctx, "TF_NEED_CUDA", False))
+ return int(False)

def matches_version(environ_version, detected_version):
"""Checks whether the user-specified version matches the detected version.
diff --git a/third_party/xla/third_party/gpus/rocm_configure.bzl b/third_party/xla/third_party/gpus/rocm_configure.bzl
index 80c151cde4d..b044e061473 100644
--- a/third_party/xla/third_party/gpus/rocm_configure.bzl
+++ b/third_party/xla/third_party/gpus/rocm_configure.bzl
@@ -158,12 +158,6 @@ def _rocm_include_path(repository_ctx, rocm_config, bash_bin):
return inc_dirs

def _enable_rocm(repository_ctx):
- enable_rocm = get_host_environ(repository_ctx, "TF_NEED_ROCM")
- if enable_rocm == "1":
- if get_cpu_value(repository_ctx) != "Linux":
- auto_configure_warning("ROCm configure is only supported on Linux")
- return False
- return True
return False

def _amdgpu_targets(repository_ctx, rocm_toolkit_path, bash_bin):
diff --git a/third_party/xla/third_party/gpus/sycl_configure.bzl b/third_party/xla/third_party/gpus/sycl_configure.bzl
index ee63624f8e4..d60a10b10d6 100644
--- a/third_party/xla/third_party/gpus/sycl_configure.bzl
+++ b/third_party/xla/third_party/gpus/sycl_configure.bzl
@@ -63,7 +63,7 @@ def _sycl_include_path(repository_ctx, sycl_config, bash_bin):

def enable_sycl(repository_ctx):
"""Returns whether to build with SYCL support."""
- return int(get_host_environ(repository_ctx, "TF_NEED_SYCL", False))
+ return int(False)

def auto_configure_fail(msg):
"""Output failure message when auto configuration fails."""
diff --git a/third_party/xla/third_party/tensorrt/tensorrt_configure.bzl b/third_party/xla/third_party/tensorrt/tensorrt_configure.bzl
index 32c6d96f161..169df9b2a8b 100644
--- a/third_party/xla/third_party/tensorrt/tensorrt_configure.bzl
+++ b/third_party/xla/third_party/tensorrt/tensorrt_configure.bzl
@@ -154,7 +154,7 @@ def _create_dummy_repository(repository_ctx):

def enable_tensorrt(repository_ctx):
"""Returns whether to build with TensorRT support."""
- return int(get_host_environ(repository_ctx, _TF_NEED_TENSORRT, False))
+ return int(False)

def _get_tensorrt_static_path(repository_ctx):
"""Returns the path for TensorRT static libraries."""
@@ -284,7 +284,7 @@ def _py_tmpl_dict(d):
def _tensorrt_configure_impl(repository_ctx):
"""Implementation of the tensorrt_configure repository rule."""

- if get_host_environ(repository_ctx, _TF_TENSORRT_CONFIG_REPO) != None:
+ if False:
# Forward to the pre-configured remote repository.
remote_config_repo = repository_ctx.os.environ[_TF_TENSORRT_CONFIG_REPO]
repository_ctx.template("BUILD", config_repo_label(remote_config_repo, ":BUILD"), {})
74 changes: 53 additions & 21 deletions bazel/external/tensorflow_disable_llvm.patch
Original file line number Diff line number Diff line change
@@ -1,35 +1,67 @@
diff --git a/tensorflow/workspace1.bzl b/tensorflow/workspace1.bzl
index b6755a6e68b..9d6562457b5 100644
--- a/tensorflow/workspace1.bzl
+++ b/tensorflow/workspace1.bzl
@@ -4,7 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
load("@com_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
-load("@local_xla//third_party/llvm:setup.bzl", "llvm_setup")
+# load("@local_xla//third_party/llvm:setup.bzl", "llvm_setup")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("//third_party/android:android_configure.bzl", "android_configure")

@@ -15,7 +15,7 @@ def workspace(with_rules_cc = True):
Args:
with_rules_cc: Unused, to be removed soon.
"""
- llvm_setup(name = "llvm-project")
+ # llvm_setup(name = "llvm-project")
# native.register_toolchains("@local_config_python//:py_toolchain")
rules_pkg_dependencies()

diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index 18b63ab47fb..92993d7c341 100644
index e91df06041d..ce281ccf21c 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -14,7 +14,7 @@ load("//tensorflow/tools/toolchains/embedded/arm-linux:arm_linux_toolchain_confi
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
load("//third_party/clang_toolchain:cc_configure_clang.bzl", "cc_download_clang_toolchain")
load("//tensorflow/tools/def_file_filter:def_file_filter_configure.bzl", "def_file_filter_configure")
-load("//third_party/llvm:setup.bzl", "llvm_setup")
+#load("//third_party/llvm:setup.bzl", "llvm_setup")
@@ -475,7 +475,7 @@ def _tf_repositories():

# Import third party repository rules. See go/tfbr-thirdparty.
load("//third_party/FP16:workspace.bzl", FP16 = "repo")
@@ -530,7 +530,7 @@ def _tf_repositories():
urls = tf_mirror_urls("https://github.com/antirez/linenoise/archive/4ce393a66b10903a0ef52edf9775ed526a17395f.tar.gz"),
)
# Load the raw llvm-project. llvm does not have build rules set up by default,
# but provides a script for setting up build rules via overlays.
- llvm("llvm-raw")
+ # llvm("llvm-raw")

# Intel openMP that is part of LLVM sources.
tf_http_archive(
diff --git a/third_party/xla/workspace1.bzl b/third_party/xla/workspace1.bzl
index 05121708fc5..dfc5f2cedf3 100644
--- a/third_party/xla/workspace1.bzl
+++ b/third_party/xla/workspace1.bzl
@@ -4,12 +4,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
-load("//third_party/llvm:setup.bzl", "llvm_setup")
+# load("//third_party/llvm:setup.bzl", "llvm_setup")

# buildifier: disable=unnamed-macro
def workspace():
"""Loads a set of TensorFlow dependencies in a WORKSPACE file."""
- llvm_setup(name = "llvm-project")
+ # llvm_setup(name = "llvm-project")
native.register_toolchains("@local_config_python//:py_toolchain")
rules_pkg_dependencies()

# Intel openMP that is part of LLVM sources.
tf_http_archive(
diff --git a/tensorflow/workspace3.bzl b/tensorflow/workspace3.bzl
index a6c2c5c5835..3866493fcc9 100644
--- a/tensorflow/workspace3.bzl
+++ b/tensorflow/workspace3.bzl
@@ -38,7 +38,7 @@ def workspace():
diff --git a/third_party/xla/workspace2.bzl b/third_party/xla/workspace2.bzl
index 9e4166034d0..d34f643bd3f 100644
--- a/third_party/xla/workspace2.bzl
+++ b/third_party/xla/workspace2.bzl
@@ -376,7 +376,7 @@ def _tf_repositories():

# Load the raw llvm-project. llvm does not have build rules set up by default,
# but provides a script for setting up build rules via overlays.
- llvm("llvm-raw")
+ # llvm("llvm-raw")

# Alias so it can be loaded without assigning to a different symbol to prevent
# shadowing previous loads and trigger a buildifier warning.
# Intel openMP that is part of LLVM sources.
tf_http_archive(
Loading
Loading