diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl index bcf1f6e7472..3f7669eb962 100644 --- a/tensorflow/workspace2.bzl +++ b/tensorflow/workspace2.bzl @@ -158,7 +158,7 @@ def _tf_repositories(): tf_http_archive( name = "cudnn_frontend_archive", build_file = "//third_party:cudnn_frontend.BUILD", - patch_file = "//third_party:cudnn_frontend_header_fix.patch", + patch_file = ["//third_party:cudnn_frontend_header_fix.patch"], sha256 = "fdf4234e9c9c481b3b3a80ad404bc278e6ecb761c5574beb4d3a2cde4a9002ad", strip_prefix = "cudnn-frontend-73210a930333eaf66b42b01693bce7b70719c354", urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/73210a930333eaf66b42b01693bce7b70719c354.zip"), @@ -193,7 +193,7 @@ def _tf_repositories(): sha256 = "8322ed2e135999569082a95e7fbb2fa87786ffb1c67935b3ef71e00b53f2c887", strip_prefix = "ComputeLibrary-21.11", build_file = "//third_party/compute_library:BUILD", - patch_file = "//third_party/compute_library:compute_library.patch", + patch_file = ["//third_party/compute_library:compute_library.patch"], urls = tf_mirror_urls("https://github.com/ARM-software/ComputeLibrary/archive/v21.11.tar.gz"), ) @@ -289,7 +289,7 @@ def _tf_repositories(): tf_http_archive( name = "png", build_file = "//third_party:png.BUILD", - patch_file = "//third_party:png_fix_rpi.patch", + patch_file = ["//third_party:png_fix_rpi.patch"], sha256 = "ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307", strip_prefix = "libpng-1.6.37", system_build_file = "//third_party/systemlibs:png.BUILD", @@ -308,7 +308,7 @@ def _tf_repositories(): tf_http_archive( name = "gif", build_file = "//third_party:gif.BUILD", - patch_file = "//third_party:gif_fix_strtok_r.patch", + patch_file = ["//third_party:gif_fix_strtok_r.patch"], sha256 = "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd", strip_prefix = "giflib-5.2.1", system_build_file = "//third_party/systemlibs:gif.BUILD", @@ -454,7 +454,7 @@ def _tf_repositories(): tf_http_archive( name = "com_google_protobuf", - patch_file = "//third_party/protobuf:protobuf.patch", + patch_file = ["//third_party/protobuf:protobuf.patch"], sha256 = "cfcba2df10feec52a84208693937c17a4b5df7775e1635c1e3baffc487b24c9b", strip_prefix = "protobuf-3.9.2", system_build_file = "//third_party/systemlibs:protobuf.BUILD", @@ -502,7 +502,7 @@ def _tf_repositories(): sha256 = "b956598d8cbe168b5ee717b5dafa56563eb5201a947856a6688bbeac9cac4e1f", strip_prefix = "grpc-b54a5b338637f92bfcf4b0bc05e0f57a5fd8fadd", system_build_file = "//third_party/systemlibs:grpc.BUILD", - patch_file = "//third_party/grpc:generate_cc_env_fix.patch", + patch_file = ["//third_party/grpc:generate_cc_env_fix.patch"], system_link_files = { "//third_party/systemlibs:BUILD": "bazel/BUILD", "//third_party/systemlibs:grpc.BUILD": "src/compiler/BUILD", @@ -590,7 +590,7 @@ def _tf_repositories(): tf_http_archive( name = "nccl_archive", build_file = "//third_party:nccl/archive.BUILD", - patch_file = "//third_party/nccl:archive.patch", + patch_file = ["//third_party/nccl:archive.patch"], sha256 = "3ae89ddb2956fff081e406a94ff54ae5e52359f5d645ce977c7eba09b3b782e6", strip_prefix = "nccl-2.8.3-1", urls = tf_mirror_urls("https://github.com/nvidia/nccl/archive/v2.8.3-1.tar.gz"), @@ -848,7 +848,7 @@ def _tf_repositories(): sha256 = "90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571", strip_prefix = "pybind11-2.6.0", build_file = "//third_party:pybind11.BUILD", - patch_file = "//third_party:pybind11.patch", + patch_file = ["//third_party:pybind11.patch"], system_build_file = "//third_party/systemlibs:pybind11.BUILD", ) diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl index c02209c7b3b..8ac3d89e33d 100644 --- a/third_party/absl/workspace.bzl +++ b/third_party/absl/workspace.bzl @@ -16,7 +16,7 @@ def repo(): sha256 = ABSL_SHA256, build_file = "//third_party/absl:com_google_absl.BUILD", # TODO(mihaimaruseac): Remove the patch when https://github.com/abseil/abseil-cpp/issues/326 is resolved - patch_file = "//third_party/absl:com_google_absl_fix_mac_and_nvcc_build.patch", + patch_file = ["//third_party/absl:com_google_absl_fix_mac_and_nvcc_build.patch"], strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT), urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)), ) diff --git a/third_party/farmhash/workspace.bzl b/third_party/farmhash/workspace.bzl index 2f3c1e7bf76..f273313891d 100644 --- a/third_party/farmhash/workspace.bzl +++ b/third_party/farmhash/workspace.bzl @@ -22,7 +22,7 @@ def repo(): tf_http_archive( name = "farmhash_gpu_archive", build_file = "//third_party/farmhash:farmhash_gpu.BUILD", - patch_file = "//third_party/farmhash:farmhash_support_cuda.patch", + patch_file = ["//third_party/farmhash:farmhash_support_cuda.patch"], sha256 = FARMHASH_SHA256, strip_prefix = "farmhash-{commit}".format(commit = FARMHASH_COMMIT), urls = tf_mirror_urls("https://github.com/google/farmhash/archive/{commit}.tar.gz".format(commit = FARMHASH_COMMIT)), diff --git a/third_party/icu/workspace.bzl b/third_party/icu/workspace.bzl index b7047382389..ab8455dff82 100644 --- a/third_party/icu/workspace.bzl +++ b/third_party/icu/workspace.bzl @@ -10,5 +10,5 @@ def repo(): urls = tf_mirror_urls("https://github.com/unicode-org/icu/archive/release-64-2.zip"), build_file = "//third_party/icu:icu.BUILD", system_build_file = "//third_party/icu:BUILD.system", - patch_file = "//third_party/icu:udata.patch", + patch_file = ["//third_party/icu:udata.patch"], ) diff --git a/third_party/llvm/Bazel-update-build-files-for.patch b/third_party/llvm/Bazel-update-build-files-for.patch new file mode 100644 index 00000000000..08258cfcda6 --- /dev/null +++ b/third_party/llvm/Bazel-update-build-files-for.patch @@ -0,0 +1,33 @@ +From eeed24e766a1cfbcf7f6240662b0ed5ff41a69e0 Mon Sep 17 00:00:00 2001 +From: Krasimir Georgiev +Date: Sun, 19 Dec 2021 14:37:05 +0100 +Subject: [PATCH] [Bazel] update build files for + https://github.com/llvm/llvm-project/commit/65d7fd0239bf301c5dcaa26ed474200845966136 + +--- + utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +index b44ee1a40945..7c31359fb4ed 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +@@ -426,7 +426,6 @@ cc_library( + deps = [ + ":BinaryFormat", + ":DebugInfoCodeView", +- ":ProfileData", + ":Support", + ":config", + ":ir_headers", +@@ -840,6 +839,7 @@ cc_library( + copts = llvm_copts, + deps = [ + ":Core", ++ ":DebugInfoDWARF", + ":Support", + ":config", + ], +-- +2.34.1.307.g9b7440fafd-goog + diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 4f69d23b457..1d172a85ec3 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -16,6 +16,6 @@ def repo(name): "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT), ], build_file = "//third_party/llvm:llvm.BUILD", - patch_file = "//third_party/llvm:macos_build_fix.patch", + patch_file = ["//third_party/llvm:macos_build_fix.patch", "//third_party/llvm:Bazel-update-build-files-for.patch"], link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"}, ) diff --git a/third_party/repo.bzl b/third_party/repo.bzl index 41b59b4be94..795f0b00b98 100644 --- a/third_party/repo.bzl +++ b/third_party/repo.bzl @@ -61,16 +61,18 @@ def _tf_http_archive_impl(ctx): build_file = ctx.attr.system_build_file, )) else: - patch_file = ctx.attr.patch_file - patch_file = ctx.path(Label(patch_file)) if patch_file else None ctx.download_and_extract( url = ctx.attr.urls, sha256 = ctx.attr.sha256, type = ctx.attr.type, stripPrefix = ctx.attr.strip_prefix, ) - if patch_file: - ctx.patch(patch_file, strip = 1) + patch_files = ctx.attr.patch_file + if patch_files: + for patch_file in patch_files: + patch_file = ctx.path(Label(patch_file)) if patch_file else None + if patch_file: + ctx.patch(patch_file, strip = 1) for dst, src in link_dict.items(): ctx.delete(dst) @@ -83,7 +85,7 @@ _tf_http_archive = repository_rule( "urls": attr.string_list(mandatory = True), "strip_prefix": attr.string(), "type": attr.string(), - "patch_file": attr.string(), + "patch_file": attr.string_list(), "build_file": attr.string(), "system_build_file": attr.string(), "link_files": attr.string_dict(), diff --git a/third_party/tensorrt/workspace.bzl b/third_party/tensorrt/workspace.bzl index fcb76932140..be383ee69ea 100644 --- a/third_party/tensorrt/workspace.bzl +++ b/third_party/tensorrt/workspace.bzl @@ -17,5 +17,5 @@ def repo(name = "tensorrt_oss_archive"): "https://github.com/NVIDIA/TensorRT/archive/{commit}.tar.gz".format(commit = TRT_OSS_COMMIT), ], build_file = "//third_party/tensorrt/plugin:BUILD", - patch_file = "//third_party/tensorrt/plugin:tensorrt_oss.patch", + patch_file = ["//third_party/tensorrt/plugin:tensorrt_oss.patch"], )