[go: nahoru, domu]

Skip to content

Commit

Permalink
Backport Bazel BUILD file fix for LLVM
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 417520712
Change-Id: I5bb9ee0457b9b2bd289828f2996a3bd796975333
  • Loading branch information
joker-eph authored and tensorflower-gardener committed Dec 21, 2021
1 parent 733d8d1 commit 2d34c7e
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 18 deletions.
16 changes: 8 additions & 8 deletions tensorflow/workspace2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
)

Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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",
)

Expand Down
2 changes: 1 addition & 1 deletion third_party/absl/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)
2 changes: 1 addition & 1 deletion third_party/farmhash/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion third_party/icu/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
33 changes: 33 additions & 0 deletions third_party/llvm/Bazel-update-build-files-for.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From eeed24e766a1cfbcf7f6240662b0ed5ff41a69e0 Mon Sep 17 00:00:00 2001
From: Krasimir Georgiev <krasimir@google.com>
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

2 changes: 1 addition & 1 deletion third_party/llvm/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
)
12 changes: 7 additions & 5 deletions third_party/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion third_party/tensorrt/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)

0 comments on commit 2d34c7e

Please sign in to comment.