Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel v5.0.0 #93

Merged
merged 5 commits into from
Feb 15, 2022
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
7 changes: 0 additions & 7 deletions .ci_support/migrations/grpc_cpp143.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions conda-forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ build_platform:
linux_ppc64le: linux_64
osx_arm64: osx_64
conda_forge_output_validation: true
provider:
linux_aarch64: default
linux_ppc64le: default
test: native
bot:
check_solvable: true
abi_migration_branches:
- 4.2.x
89 changes: 0 additions & 89 deletions recipe/0001-Parametrize-LIBPROTOBUF_VERSION.patch

This file was deleted.

8 changes: 4 additions & 4 deletions recipe/0001-allow-args-to-be-passed-to-bazel_build.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 009c53452eb8024f11dd5f8de7066bbe56f0da44 Mon Sep 17 00:00:00 2001
From e42bf84aca0667e43d81d79a7d86a9f7302be00c Mon Sep 17 00:00:00 2001
From: Jonathan Helmus <jjhelmus@gmail.com>
Date: Fri, 16 Mar 2018 12:10:51 -0500
Subject: [PATCH 1/2] allow args to be passed to bazel_build
Subject: [PATCH 1/8] allow args to be passed to bazel_build

Allow arguments to be passed to bazel_build via the BAZEL_BUILD_OPTS
environment variable.
Expand All @@ -10,7 +10,7 @@ environment variable.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compile.sh b/compile.sh
index d91583d277..ce49a1266e 100755
index d91583d..ce49a12 100755
--- a/compile.sh
+++ b/compile.sh
@@ -63,7 +63,7 @@ display "."
Expand All @@ -23,5 +23,5 @@ index d91583d277..ce49a1266e 100755
--host_platform=@local_config_platform//:host \
--platforms=@local_config_platform//:host \
--
2.20.1
2.35.0

Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
From 24fba481c5a6dcb951c02e2f477a88eec86f9d1b Mon Sep 17 00:00:00 2001
From 53aa39dcd4d056618cd383873b5fed83087a20f6 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwelk@xhochy.com>
Date: Sun, 21 Mar 2021 21:26:54 +0100
Subject: [PATCH] Build with native dependencies
Subject: [PATCH 2/8] Build with native dependencies

---
WORKSPACE | 43 ++-
src/BUILD | 29 +-
third_party/grpc/BUILD | 37 +--
third_party/ijar/BUILD | 17 +-
third_party/systemlibs/protobuf.BUILD | 141 +++++++++
third_party/systemlibs/protobuf.bzl | 436 ++++++++++++++++++++++++++
6 files changed, 659 insertions(+), 44 deletions(-)
WORKSPACE | 37 +-
.../java/com/google/devtools/build/lib/BUILD | 2 +-
third_party/grpc/BUILD | 23 +-
third_party/systemlibs/protobuf.BUILD | 141 ++++++
third_party/systemlibs/protobuf.bzl | 436 ++++++++++++++++++
third_party/systemlibs/protobuf_deps.bzl | 2 +
6 files changed, 623 insertions(+), 18 deletions(-)
create mode 100644 third_party/systemlibs/protobuf.BUILD
create mode 100644 third_party/systemlibs/protobuf.bzl
create mode 100644 third_party/systemlibs/protobuf_deps.bzl

diff --git a/WORKSPACE b/WORKSPACE
index 0878e18507..fcbe9c6336 100644
index 464a7a6..65a5f81 100755
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -93,17 +93,40 @@ bind(
@@ -95,12 +95,43 @@ bind(
actual = "@bazel_tools//tools/objc:xcrunwrapper",
)

-http_archive(
-dist_http_archive(
+new_local_repository(
name = "com_google_protobuf",
- patch_args = ["-p1"],
- patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
- patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
- patches = ["//third_party/protobuf:3.13.0.patch"],
- sha256 = "9b4ee22c250fe31b16f1a24d61467e40780a3fbb9b91c3b65be2a376ed913a1a",
- strip_prefix = "protobuf-3.13.0",
- urls = [
- "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz",
- "https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz",
+ path = "./third_party/systemlibs",
+ build_file = "./third_party/systemlibs/protobuf.BUILD",
+)
Expand All @@ -46,8 +40,8 @@ index 0878e18507..fcbe9c6336 100644
+ strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
+ sha256 = RULES_JVM_EXTERNAL_SHA,
+ url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
+)
+
)
+load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
+
+rules_jvm_external_deps()
Expand All @@ -66,17 +60,33 @@ index 0878e18507..fcbe9c6336 100644
+ ],
+ repositories = [
+ "https://repo1.maven.org/maven2",
+ ],
+ )
+
# This is a mock version of bazelbuild/rules_python that contains only
# @rules_python//python:defs.bzl. It is used by protobuf.
# TODO(#9029): We could potentially replace this with the real @rules_python.
diff --git a/src/main/java/com/google/devtools/build/lib/BUILD b/src/main/java/com/google/devtools/build/lib/BUILD
index ccf94eb..8441ea9 100755
--- a/src/main/java/com/google/devtools/build/lib/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/BUILD
@@ -371,7 +371,7 @@ java_library(
"//third_party:guava",
"//third_party:jsr305",
"@com_google_protobuf//:protobuf_java",
- "@com_google_protobuf//java/util",
+ "@com_google_protobuf//:protobuf_java_util",
],
)

diff --git a/third_party/grpc/BUILD b/third_party/grpc/BUILD
index 3bd85ba6b3..8c5ba7605e 100644
index 00d1533..ce1e971 100755
--- a/third_party/grpc/BUILD
+++ b/third_party/grpc/BUILD
@@ -70,28 +70,23 @@ distrib_cc_binary(
@@ -73,28 +73,23 @@ distrib_cc_binary(
deps = ["//third_party/protobuf:protoc_lib"],
)

-alias(
+genrule(
name = "cpp_plugin",
Expand All @@ -89,7 +99,7 @@ index 3bd85ba6b3..8c5ba7605e 100644
+ executable = 1,
+ visibility = ["//visibility:public"],
)

alias(
name = "grpc++_codegen_proto",
- actual = select({
Expand All @@ -98,7 +108,7 @@ index 3bd85ba6b3..8c5ba7605e 100644
- }),
+ actual = "grpc++_unsecure",
)

-alias(
+cc_library(
name = "grpc++_unsecure",
Expand All @@ -109,11 +119,11 @@ index 3bd85ba6b3..8c5ba7605e 100644
+ linkopts = ["-lgrpc++_unsecure", "-lgrpc_unsecure","-lgpr"],
+ visibility = ["//visibility:public"],
)

filegroup(
diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
new file mode 100644
index 0000000000..3e42a1bf31
index 0000000..3e42a1b
--- /dev/null
+++ b/third_party/systemlibs/protobuf.BUILD
@@ -0,0 +1,141 @@
Expand Down Expand Up @@ -260,7 +270,7 @@ index 0000000000..3e42a1bf31
+) for proto in WELL_KNOWN_PROTO_MAP.items()]
diff --git a/third_party/systemlibs/protobuf.bzl b/third_party/systemlibs/protobuf.bzl
new file mode 100644
index 0000000000..8b3a16e7cf
index 0000000..8b3a16e
--- /dev/null
+++ b/third_party/systemlibs/protobuf.bzl
@@ -0,0 +1,436 @@
Expand Down Expand Up @@ -700,6 +710,14 @@ index 0000000000..8b3a16e7cf
+ current = apple_common.dotted_version(native.bazel_version)
+ if current.compare_to(expected) < 0:
+ fail("Bazel must be newer than 0.5.4")
diff --git a/third_party/systemlibs/protobuf_deps.bzl b/third_party/systemlibs/protobuf_deps.bzl
new file mode 100644
index 0000000..aafd89b
--- /dev/null
+++ b/third_party/systemlibs/protobuf_deps.bzl
@@ -0,0 +1,2 @@
+def protobuf_deps():
+ pass
--
2.24.3 (Apple Git-128)
2.35.0

27 changes: 27 additions & 0 deletions recipe/0003-Parametrize-LIBPROTOBUF_VERSION.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From be69d3c157557ae01e6b9e78beec4fe271632d8c Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Thu, 28 Oct 2021 11:28:13 +0200
Subject: [PATCH 3/8] Parametrize LIBPROTOBUF_VERSION

---
WORKSPACE | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/WORKSPACE b/WORKSPACE
index 65a5f81..486b7b0 100755
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -124,8 +124,8 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
# TODO: Use installed protobuf version
maven_install(
artifacts = [
- "com.google.protobuf:protobuf-java:3.15.6",
- "com.google.protobuf:protobuf-java-util:3.15.6",
+ "com.google.protobuf:protobuf-java:LIBPROTOBUF_VERSION",
+ "com.google.protobuf:protobuf-java-util:LIBPROTOBUF_VERSION",
],
repositories = [
"https://repo1.maven.org/maven2",
--
2.35.0

Loading