Commit Graph

95 Commits

Author SHA1 Message Date
Richard Belleville 7e7b4fd1a4 Fix breakage when built against protobuf head (#34945)
This PR is required in order to upgrade to the `master` branch version of protobuf. To do this, we upgrade to the latest version of `rules_python` by:

- Adding in explicit dependencies on all PyPi Bazel test dependencies
  - Resolving the circular dependency this creates for `xds-protos` by giving it a Bazel build
    - Generating the Python code for `xds-protos` as part of `generate-projects.sh` since doing so directly in Bazel would be highly fragily, dependent on many other projects' Bazel builds

Closes #34945

PiperOrigin-RevId: 599875020
2024-01-19 12:43:14 -08:00
Esun Kim 45aecbe355 [Tool] Added Bazel 7 basic support (#35362)
- Added Bazel 7 to the support bazel versions.
- Changed the default Bazel version to 7.
- Fixed Android Binder build issue.

Closes #35362

PiperOrigin-RevId: 592946781
2023-12-21 14:13:56 -08:00
Esun Kim 594d370819 [Build] Prepared for Bazel 7 (#35374)
This is a prerequisite change to start supporting Bazel 7. Changes are

- Disabled bzlmod which Bazel 7 begins to enable by default. This eventually needs to be done to support bzlmod but not now.
- Upgraded some bazel rule dependencies which are required to support Bazel 7.
- Using Python 3 explcitly as Bazel 7 begins to reject Python 2.

Note that this isn't enough to enable Bazel 7 by default and another PR will follow for that.

Closes #35374

PiperOrigin-RevId: 592931675
2023-12-21 13:02:38 -08:00
Adam Cozzette 016ed921ce
[deps] Upgrade protobuf version to v25.0 (#34513)
This commit upgrades gRPC to protobuf v25.0 and makes some fixes to
account for upb changes. One major change is that upb has been merged
into the protobuf repo, so we can now drop the separate `@upb`
dependency. Another is that `.upb.c` files no longer exist and there are
new `.upb_minitable.h` and `.upb_minitable.c` files. The longer
filenames exceeded a Windows restriction, so to work around that I
renamed the `upb-generated` directory to just `upb-gen`, and likewise
for `upbdefs-generated`.
2023-11-10 00:11:09 -08:00
Stanley Cheung e66cb7f2de
[GSM Observability] Update opentelemetry cpp bazel deps (#34290)
This is needed for the upcoming work for GSM Observability integration
testing.
2023-09-12 11:02:02 -07:00
AJ Heller 107e4dc0b6
[deps] Upgrade google/benchmark dependency (#33736)
Some command line arguments have changed, and the public docs no longer
describe how to use the 1-year-old version.
2023-07-17 15:45:57 -07:00
Esun Kim 3bd6c38650
[Infra] Use Bazel 6 and drop Bazel 4 (Part 2) (#32910)
Oops I missed important changes from
https://github.com/grpc/grpc/pull/32712. And it turned out that there
are two problems that I couldn't fix at this point.
- Windows Bazel RBE Linker Error: This may be caused by how new Bazel 6
invokes build tools chain but it's not clear. I put workaround to use
Bazel 5 by using `OVERRIDE_BAZEL_VERSION=5.4.1`
- Rule `rules_pods` to fetch CronetFramework from CocoaPod has
incompatibility with sort of built-in apple toolchain.
(https://github.com/bazel-xcode/PodToBUILD/issues/232): I couldn't find
a workaround to fix this so I ended up disabling all tests depending
this target.
2023-04-21 15:53:52 -07:00
Jan Tattermusch 0f1afec5a8
[protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.

This is best reviewed commit-by-commit, I tried to group changes in
logical areas.

Notable changes:
- the upgrade of third_party/protobuf submodule, the bazel protobuf
dependency itself
- upgrade of UPB dependency to 22.x (in the past, we used to always
upgrade upb to "main", but upb now has release branch as well). UPB
needs to be upgraded atomically with protobuf since there's a de-facto
circular dependency (new protobuf depends on new upb, which depends on
new protobuf for codegen).
- some protobuf and upb bazel rules are now aliases, so `
extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py`
had to be modified to be able to follow aliases and reach the actual
aliased targets.
- some protobuf public headers were renamed, so especially
`src/compiler` needed to be updated to use the new headers.
- protobuf and upb now both depend on utf8_range project, so since we
bundle upb with grpc in some languages, we now have to bundle utf8_range
as well (hence changes in build for python, PHP, objC, cmake etc).
- protoc now depends on absl and utf8_range (previously protobuf had
absl dependency, but not for the codegen part), so python's
make_grpcio_tools.py required partial rewrite to be able to handle those
dependencies in the grpcio_tools build.
- many updates and fixes required for C++ distribtests (currently they
all pass, but we'll probably need to follow up, make protobuf's and
grpc's handling of dependencies more aligned and revisit the
distribtests)
- bunch of other changes mostly due to overhaul of protobuf's and upb's
internal build layout.

TODOs:
- [DONE] make sure IWYU and clang_tidy_code pass
- create a list of followups (e.g. work to reenable the few tests I had
to disable and to remove workaround I had to use)
- [DONE in cl/523706129] figure out problem(s) with internal import

---------

Co-authored-by: Craig Tiller <ctiller@google.com>
2023-04-12 18:43:58 +02:00
Jan Tattermusch 6f81b87122
[protobuf] Add third_party/utf8_range as a subtree (#32794)
This is a prerequisite for upgrading to protobuf 22.x
(upb and protobuf now depend on utf8_range)

Currently utf8_range isn't referenced by anything, but it's better to
bring the subtree in advance to make the protobuf upgrade PR smaller.
2023-04-04 19:58:04 +02:00
Jan Tattermusch a27b86fb95
Switch linux RBE to ubuntu18.04, get rid of rbe_autoconfig (#32559)
First step in the modernization of our RBE stack (see
go/rbe-tech-debt-notes).

- Get rid of the deprecated rbe_autoconfig and start using
[rbe_configs_gen](https://github.com/bazelbuild/bazel-toolchains#rbe_configs_gen---cli-tool-to-generate-configs)
+ check in the generated toolchain configs.
- Switch from marketplace.gcr.io/google/rbe-ubuntu16-04 to
marketplace.gcr.io/google/rbe-ubuntu18-04 (this image is still not owned
by us, but at least it's newer and demonstrates how a switch to a newer
docker image is done).
- provide script for generating the linux RBE toolchain configs.
- cleanup RBE configuration in the bazelrc files used for remote build
2023-03-10 09:34:53 +01:00
Hannah Shi 96d27634a4
run ios CronetTest from bazel (#30439) 2022-09-27 14:49:38 -07:00
Richard Belleville b8ee9ac7e5
Make Compatible with Bazel 5.0 (#28683)
* See what happens when we remove NDK

* Try to debug Kokoro in a super hacky way

* And echo the external IP too

* Attempt to fix NDK installation

* And actually run the portion of the code I need to test out

* Clean up

* Actually test against bazel 5

* Put export in proper file

* Make android an optional dependency

* Escape paths for Windows

* Revert switch to Bazel 5.0
2022-02-11 15:18:18 -08:00
Chi Wang d326b95d79
Remove redundent toolchain registrations in WORKSPACE (#27674) 2021-10-13 17:24:09 +02:00
Richard Belleville 7aa43b7a55
Create Bazel gevent test harness (#27507)
* WIP

* Add gevent test suite run under Bazel.

* Fix things up

* Yapf

* Fix up Bazel files

* Make py_grpc_test fancier

* Attempt to fix Windows RBE

* Attempt to kick GitHub

* Fix Python 2 runs

* Yet more fixes

* And the patch file too

* I am an idiot

* Mark gevent tests flaky

* Try to make rules_python more tolerant

* Typo

* Exclude reconnect test from gevent

* Remove unnecessary parts of patch

* Buildifier

* You saw nothing

* isort

* Move py_grpc_test to an internal-only file

* Review comments

* More reviewer comments

* Review
2021-10-07 14:04:34 -07:00
Jan Tattermusch 0042c2b86f
Upgrade bazel to 4.2.1 (LTS), upgrade bazel toolchain to 4.1.0 (#27410)
* update bazel to 4.2.1

* add bazel 4.2.1 to update_mirror.sh

* regenerate dockerfiles

* upgrade bazel toolchains to 4.1.0

* use create_rbe_exec_properties_dict instead of the deprecated create_exec_properties_dict

* RBE ubsan doesnt require the crosstool_top hack anymore

* update rules_apple and build_bazel_apple_support
2021-09-23 16:20:25 +02:00
Ming-Chuan f0489c8f5f
Add Java helper code for establishing binder transport connection (#26862)
These Java code will be invoked by binder transport C++ implementation
through JNI to establish the connection between client and server.

The code is locally tested with other pending changes to make sure it
works correctly.

For now we only make sure it builds in CI. We will port proper tests
from internal repository later.

A new local repository is created for the Android-only Java code because
1. The analysis of its BUILD will fail without Android SDK configured
2. We want to prevent clang-tidy (and maybe other scripts)'s automatic
expansion of '...' to include it as they typically don't have Android
SDK installed
2021-08-13 09:12:31 +08:00
Ming-Chuan 746eaf6c48
Add BinderTransport example app (#26747)
This commit adds an app that will be served as BinderTransport example
later.

Currently the app simply calls C++ function when button is pressed. In
the future the C++ function will run BinderTransport gRPC example
instead.

Tests not included in this commit, later we will add a build test to
CI to make sure this apk is always build-able. (This app will also be
used to make sure our BinderTransport implementation is compile-able
with Android toolchain, on GitHub) For now we exclude this target in
bazel build test.

Changes are made to WORKSPACE file in order to support android builds.

Build instructions are documented at
examples/android/binder/java/io/grpc/binder/cpp/example/README.md
2021-07-27 11:18:59 +08:00
Jan Tattermusch e816aa34af buildifier format 2020-10-09 04:21:18 -04:00
Jan Tattermusch 7533b4bfb4 RBE: rely on labels to select the right worker pool 2020-10-08 11:06:48 -04:00
Jan Tattermusch cdb3d823fd migrate windows RBE to win2019 pool 2020-05-13 14:39:59 +02:00
Richard Belleville 3d876a656f Buildifier 2019-11-06 13:24:59 -08:00
Richard Belleville 959945705a Merge branch 'master' of https://github.com/grpc/grpc into blaze_modifications 2019-11-06 11:00:47 -08:00
Lidi Zheng c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Richard Belleville 4b49a95801 Fix internal lint warnings 2019-10-29 17:33:44 -07:00
Eytan Kidron c97ce9057b Simplify the platform and constraints settings for remote execution
* Remove the toolchains //third_party/toolchains:local and //third_party/toolchains:local_large.
* Remove the platforms :rbe_ubuntu1604, :rbe_ubuntu1604_large, :local and :local_large.
* No longer inherit from @rbe_default//config:platform but instead use it directly. It is now the only non-windows platform.
* When creating @rbe_default//config:platform directly with rbe_autoconfig, set dockerAddCapabilities and dockerPrivileged directly in the exec_properties field. No need to set dockerNetwork to "off" and dockerSiblingContainers to false since these are the defaults.
* Also set gceMachineType = "n1-highmem-2" on the default platform. This value can be overridden by specific targets that want to use LARGE_MACHINE.
* Use create_exec_properties_dict where appropriate.
* Use custom_exec_properties to define LARGE_MACHINE.

I wasn't able to test thoroughly that this PR does not break any existing targets. I was not able to run anything on windows/mac and I also don't have access to gRPC's RBE setup.
2019-10-29 15:40:28 -04:00
Jan Tattermusch e5e3f70a1a Revert "Revert "Upgrade to bazel 1.0.0"" 2019-10-29 06:31:38 -04:00
Danjie Wenren c22c215ea5 Move extra dependencies out of WORKSPACE to its own macro.
This could be useful for projects that use gRPC as an external
repository. This could not be done within the same grpc_deps.bzl due to
the problem discussed in
- https://github.com/bazelbuild/bazel/issues/1550
- https://github.com/bazelbuild/bazel/issues/1943
2019-10-12 22:10:57 -07:00
Rafi Kamal fac04ffe6e
Add protobuf_deps to WORKSPACE
See https://github.com/grpc/grpc/pull/20224#issuecomment-531355209
2019-09-13 12:32:54 -07:00
Richard Belleville 3638167e40 Call grpc_python_deps() from grpc_deps(). 2019-08-05 12:57:50 -07:00
Richard Belleville e1980a7a5a Merge remote-tracking branch 'origin/master' into py_proto_library 2019-08-02 15:02:31 -07:00
Richard Belleville 9ac75a6d16 Merge remote-tracking branch 'origin/master' into py_proto_library 2019-08-01 15:25:16 -07:00
Richard Belleville 7b2c8c27b0 Separate py_grpc_library and py_proto_library.
By popular demand, we'll now be offering separate py_grpc_library and
py_proto_library targets sharing the same interface as within google3.
This change necessitated some modifications to how we pull in our own
Python-level dependencies and how we make those available to those
pulling in our project via Bazel.

There is now a grpc_python_deps() Bazel workspace rule that pulls in the
appropriate dependencies, which should be called from the client
project's WORKSPACE file. A test has been added to the bazel/test/
directory to verify that this behavior works as intended.

It's worth noting that the protobuf repository's usage of Starlark
bind() caused a great deal of trouble in ensuring that we could also
pull in six.

This change also required a change in the way generated proto code is
imported in the channelz and health-check modules, as well as in their
associated tests. We were importing them two different ways, each
relative. This resulted in two different module objects being imported
into the process, which were incompatible. I am not sure exactly what
caused this behavior to begin, as this should have been possible before
this PR. As a workaround, I am simply trying two different absolute
imports and using the one that works. This should function both inside
and outside of Bazel environments.
2019-08-01 15:16:22 -07:00
Tony Lu 44868ae12a Starting a new branch with same changes from https://github.com/grpc/grpc/pull/19621 2019-07-30 16:30:51 -07:00
Nicolas "Pixel" Noble 5495a7f7b1 Merge branch 'master' of https://github.com/grpc/grpc into moiz-upb 2019-07-16 19:07:24 +02:00
Nicolas "Pixel" Noble 3de02bc8cd Merge branch 'master' of https://github.com/grpc/grpc into moiz-upb 2019-07-03 19:54:22 +02:00
Marcel Hlopko 49f0fb9035 Migrate from dep.proto to dep[ProtoInfo] 2019-06-20 18:55:56 +02:00
Nicolas "Pixel" Noble 8de64087a3 Clean bazel 0.26 upgrade. 2019-06-14 00:20:29 +02:00
Moiz Haidry 49e7f4b2e4 Added more rules to resolve deps 2019-05-24 16:04:43 -07:00
Moiz Haidry 4995670257 Add support to import envoy protos 2019-05-24 14:31:52 -07:00
Moiz Haidry 6c3e3aeb77 Removed git repo from WORKSPACE as that was the incorrect location. Added the code to grpc_deps.bzl instead 2019-05-22 16:35:29 -07:00
Moiz Haidry e8a18969bb Added upb repo to grpc workspace 2019-05-22 15:30:21 -07:00
Richard Belleville 930cec4e27 Revert "Merge pull request #18912 from grpc/revert-bazel-changes"
This reverts commit c9a259aa3a, reversing
changes made to 9c882bc725.
2019-04-30 11:17:11 -07:00
Richard Belleville 50b5240d0a Revert "Merge pull request #18859 from grpc/internal_py_proto_library"
This reverts commit 5b720f19c1, reversing
changes made to a64ae3c0d5.
2019-04-29 17:47:56 -07:00
Richard Belleville afdc59712d Merge branch 'master' into internal_py_proto_library 2019-04-25 10:01:41 -07:00
Richard Belleville 05f37c8143 Remove dependency on pubref/rules_proto.
This commit resolves #18331.
This commit resolves #18256.
This commit resolves... another TODO that apparently didn't have an
associated github issue.

We swap out pubref's implementation of py_proto_library with our own,
which more closely mirrors the interface of the internal
py_proto_library, taking the descriptor file output of a proto_library
rule as input.

One minor change in behavior was introduced for simplicity. When a
py_proto_library depends on a proto_library with a source proto file in
a subdirectory of the bazel package, the import module of the resultant
python library will reflect the package, *not* the full directory of the
proto file, including both the bazel package and the subdirectories, as
pubref did previously. This behavior also more closely mirrors google
internal behavior.

This commit also introduces a slightly more stringent bazel format
script. Buildifier on its own will not take care of long lines, but by
running yapf first, we end up with a more legible file. At the moment,
there is no sanity check associated with this formatter.
2019-04-24 17:36:08 -07:00
Nicolas Lopez a32b1eb765
Merge branch 'master' into master 2019-04-11 15:00:34 -04:00
Bill Feng 5158c3db27 naming update, documentation fix 2019-04-08 14:39:09 -07:00
Bill Feng df89d8e157 bazel RBE Windows build 2019-04-05 11:40:11 -07:00
Richard Belleville 615c95ed5c Mitigate #18256 2019-04-03 18:13:52 -07:00
Nicolas Lopez bdbe0483b0 update docs 2019-03-28 09:56:50 -04:00