Commit Graph

235 Commits

Author SHA1 Message Date
Florian Ferstl fa32eb36b3
[bazel] Auto-generate .pyi files in py_proto_library rule (#32872)
With some delay, this is a PR for
https://github.com/grpc/grpc/issues/32564 (and previously
https://github.com/grpc/grpc/pull/31791).

I looked into adding a regular `py_test` for this change [as
suggested](https://github.com/grpc/grpc/pull/31791#issuecomment-1423245116)
but I am not aware of any effect that the presence of a .pyi stub file
would have at runtime and where some sort of type-checking in a .py
script would be affected. Stub files are only for use by type checkers &
IDE's. I mean, something like this would work:

```
import helloworld_pb2
py_file = helloworld_pb2.__file__ 
pyi_file = py_file + 'i’
self.assertTrue(os.path.exists(pyi_file))
```

But that seems really hacky to me. Instead I created a simple rule test
for `py_proto_library` with Bazel Skylib which tests the declared
outputs for an example `py_proto_library` target. Indirectly, this also
tests that the declared output files are actually generated. Please let
me know if this is sufficient.
2023-06-12 14:36:24 -07:00
Sergii Tkachenko de6ed9ba9f
[Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Yijie Ma 10001d16a9
[Release] Upmerge v1.55.x branch into master (#33277)
Change was created by the release automation script. See go/grpc-release

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: Yash Tibrewal <yashkt@google.com>
Co-authored-by: Esun Kim <veblush@google.com>
Co-authored-by: Mark D. Roth <roth@google.com>
Co-authored-by: Yousuk Seung <ysseung@google.com>
Co-authored-by: Craig Tiller <ctiller@google.com>
Co-authored-by: Richard Belleville <rbellevi@google.com>
Co-authored-by: gnossen <gnossen@users.noreply.github.com>
2023-05-30 14:45:06 -07:00
Esun Kim 303e568f27
[Build] Removed gRPC_PROTOBUF_PACKAGE_TYPE, supporting config only (#32988)
`FindProtobuf` isn't working as Protobuf began to use Abseil so gRPC is
now using `CONFIG` mode for protobuf module
(Context: https://gitlab.kitware.com/cmake/cmake/-/issues/24321)
2023-05-04 13:55:42 -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 43c3d1f932
Switch all VS2017 builds to VS2019 (#32662)
(part of removing support for VS2017)

Also see https://github.com/grpc/grpc/pull/32649
Also see https://github.com/grpc/grpc/pull/32615

The switch to grpc-win2019 windows workers has already happened:
(cl/517400022).

Once this PR lands, I'll backport to 1.53.x branch as well (since that
release removes the VS2017 support).
2023-03-23 16:44:39 +01:00
Jan Tattermusch 3fde13929b
Switch to protobuf's /CMakeLists.txt instead of /cmake/CMakeLists.txt (#32678)
Try to react to https://github.com/protocolbuffers/protobuf/issues/12263
and https://github.com/protocolbuffers/protobuf/pull/12295

Protobuf's /cmake/CMakeLists.txt is now deprecated if favor of
/CMakeLists.txt


58ecf38aa5/cmake/CMakeLists.txt (L3)

In this PR:
- Adjust `cmake/protobuf.cmake` to use the right CMakeLists.txt
- adjust the C++ distribtests accordingly
2023-03-22 09:14:04 -07:00
Craig Tiller 2bcca66712
[fuzzing] Roll forward dep on fuzztest (#32667)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-21 13:37:32 -07:00
Craig Tiller 522bed8cc6
Revert "[fuzzing] Add dep on google fuzz test" (#32666)
Reverts grpc/grpc#32578
2023-03-20 20:31:06 -07:00
Craig Tiller dbb131b193
[fuzzing] Add dep on google fuzz test (#32578)
Initial PR to establish a bazel dependency on
https://github.com/google/fuzztest, with which I'm planning on basing a
hardening program.

Casting a relatively wide net with reviewers: I'm genuinely interested
in feedback building up the docs, and general ergonomics of this change.

I've located relevant files in the `fuzztest/...` directory. The tests
only build with the `--config fuzztest` bazel argument for now (because
of needing C++17), so locating them separately keeps `bazel test
test/...` working as it does today. In a few years time, when we adopt
C++17, we'll be able to rationalize the test directories a little bit.

We'll need to add some kokoro jobs (maybe with this PR?) to execute the
relevant tests.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-20 17:45:52 -07:00
Jan Tattermusch 5873ba96dc
Ensure compatibility with the new custom kokoro win2019 image (#32649)
Fix incompatibilities identified when running adhoc runs on the new
custom win2019 image.
After merging this, it should be possible to switch to the new image
without breaking any tests.

- for most fixes I added a comment that explains why they're necessary.
- the new image won't have VS2015 installed, so I'm switching the protoc
artifact build to VS2017

This PR will need to be backported to older release branches to ensure
the windows tests continue working on those branches as well (IMHO I
haven't made any changes that would be difficult to backport and I tried
to keeps the diff as small as possible to avoid issues when
backporting).

After we switch to the new image (and all the windows tests are green),
we can incrementally move the builds that are still using VS2017 to
VS2019.
2023-03-20 16:03:50 +01: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
Esun Kim 905df9dee6
Update Abseil to 20230125 (#32139)
* Update abseil to 1.20230125.0

* Fix IWYU
2023-01-30 16:20:24 -08:00
Esun Kim 564a46291b
Update all Debian:9 to Debian:10 (#31917) 2023-01-23 10:50:41 -08:00
Hannah Shi d8a52a5043
build multi arc ios unit test for m1 (#31930) 2023-01-05 16:27:21 -08:00
Jan Tattermusch a017e9b7f2
fix bazel distribtest (#31999) 2023-01-04 09:23:44 +01:00
Richard Belleville a1491cd738
Ensure Full Build is Run for each Bazel Version in Bazel Distribtest (#31366)
* Ensure results of Bazel distribtests are not cached across versions.

* Please the shellcheck overlords

* Try to use action env to invalidate cache

* Change placement of Bazel version check

* Review comments

* Add version test to build step as well
2022-12-22 14:03:23 -08:00
Esun Kim 5fb4c2364d
Clean-up pkgconfig (#31660)
* Clean-up pkgconfig

* Removed run_distrib_test_cmake_module_install_pkgconfig.sh

* Proper re2

* Clean up pkgconfig.sh test script
2022-11-22 10:51:17 -08:00
Jan Tattermusch 6cab039cf5
fix PHP distribtest on monterey (#31567) 2022-11-07 20:01:58 +01:00
Jan Tattermusch 3cf3ed7d59
Revert "Revert "Add back C# distribtests for Grpc.Tools"" (#31436)
* Revert "Revert "Add back C# distribtests for Grpc.Tools (#31399)" (#31412)"

This reverts commit dbc45208e2.

* avoid clash with internal protos
2022-10-27 09:59:06 +02:00
Alisha Nanda dbc45208e2
Revert "Add back C# distribtests for Grpc.Tools (#31399)" (#31412)
This reverts commit 50bad293c9.
2022-10-20 12:08:29 -07:00
Jan Tattermusch 50bad293c9
Add back C# distribtests for Grpc.Tools (#31399)
* remove remains of grpc_csharp_ext artifact build completely

* add back part of C# distribtests

* redirect C# linux distribtests

* comment out some distribtests

* switch updateversion to Grpc.tools

* fix .proto

* fix distribtest complile

* temporarily comment out service in .proto

* cleanup

* improvements

* reenable mac distribtests

* fixes
2022-10-20 16:42:29 +02:00
Richard Belleville c9506a4447
Update Bazel latest version heuristic. (#30958)
GitHub has changed their releases pages to not use full server-side
rendering. Instead, individual artifacts are now fetched as a separate
HTML chunk via javascript. This defeats the previous method.

Instead, we now rely on the URI of the 301 redirect to indicate the
identity of the latest release.
2022-09-13 12:11:14 -07:00
Esun Kim 8787af7ea1
Added .bazelrc for distrib tests (#30161) 2022-07-01 13:57:14 -07:00
Jan Tattermusch 99a7f2995e
Update win RBE docker image to VS2019 (#30072)
* update win RBE docker image and toolchain

and switch win RBE builds to using it.

* delete legacy RBE windows toolchain config

* switching to VS2019 makes #28544 obsolete
2022-06-28 10:23:12 +02:00
Jan Tattermusch e8404698d5
Remove C# implementation (individual packages will continue to be maintained through v2.46.x patches or moved to grpc-dotnet) (#29225)
* remove examples/csharp

* remove reference to examples/csharp

* remove C# references from doc/

* remove src/csharp

* update test_creds locations

* remove C# distribtests

* remove buildgen templates for files under src/csharp

* remove grpc_csharp_ext C build target

* regenerate projects

* update tools/run_tests/README.md

* change many C# test/build scripts to noop

* unbreak run_tests.py -l csharp

* unbreak C# build_package targets

* unbreak C# distribtests

* remove C# pre-build steps from prepare_build_windows.bat

* remove src/csharp from clang_format

* remove csharp and csharpcoreclr from run_interop_tests.py

* remove C# interop test docker images

* Revert "remove src/csharp"

This reverts commit 97f2b6d707.

* remove src/csharp, but keep Grpc.Tools

* add back templates/src/csharp/build/dependencies.props.template

* remove everything but Grpc.Tools and Grpc.Tools.Tests from sln

* Revert "unbreak run_tests.py -l csharp"

This reverts commit 529b5e2ec1.

* revive Grpc.Tools.Tests through run_tests.py

* Revert "unbreak C# build_package targets"

This reverts commit 79d8d83c8b.

* experiment with build_nuget.sh fixes

* simplify create_fake_native_artifacts.sh

* building of Grpc.Tools in package_targets.py

* move shared files from Grpc.Core to Grpc.Tools

* yapf format: distribtest_targets.py

* Revert "remove C# pre-build steps from prepare_build_windows.bat"

This reverts commit bd38956a2b.

* update C# README.md

* disable C# in gke OSS benchmarks
2022-04-28 12:00:34 +02:00
Lidi Zheng 99752b173c
[xDS Proto] Enhence gRPC buildgen for 3rd party proto compilation (#29254)
* [xDS Proto] Enhence gRPC buildgen for 3rd party proto compilation

* Rebase from master to update envoy-api version

* Address reviewer's comments

* Address reviewer's comment

* Regenerate project

* Rename external_library

* Address reviewer's comments

* Add comments for the internals of generate C++ proto code

* Add proto file as a dependency to the custom command
2022-04-13 14:26:08 -07:00
Richard Belleville e53ea89bca
Add Python GCF Distribtest (#29303)
* Initial GCF distribtest

* Tenatively hook up to CI

* Try again

* Allow dev0 artifacts

* Fix invocation path

* Update gcloud

* Add a 3.8 artifact for presubmits

* And 3.9 too

* Put test files back to normal

* Formatting/linting

* Copyright

* That copyright script doesn't work with shebangs

* Review comments

* Try to create latest-manylinux label

* Accidentally a letter

* Add Python 3.7 manylinux 2014 to presubmit

* Revert CI config file used for test

* Review comments

* Yapf

* Re-add presubmit wheel

* Review comments
2022-04-07 11:51:07 -07:00
Richard Belleville f688f5fcf2
Rehome python bazel distribtest (#29275)
* WIP

* Test multiple languages

* Yapf

* isort

* Shellcheck

* comment not provided

* Fix import ordering issue.

* Turn up Bazel logging
2022-04-01 15:04:50 -07:00
Richard Belleville 7942f30f63
Add bazel cpp distribtest for grpc_cc_library (#29175)
* Add bazel cpp distribtest for grpc_cc_library

* Add new directory to bazelignore

* Try changing to workspace differently

* Debug cd

* Fix bazel wrapper

* Yet more debug

* Try again

* Clean up

* Sanity fixes

* Run per-language distribtests even if overall build fails
2022-03-25 12:01:23 -07:00
Richard Belleville e79b2a9b32
Add Documentation for Supported Bazel Versions (#29191)
* Create Bazel support range docs

* Review comments

* Move supported versions file
2022-03-25 10:45:06 -07:00
Jan Tattermusch 6b8a17d1ea
add bazel 5.0 to bazel distribtest (#28894) 2022-02-23 11:13:34 +01:00
Lidi Zheng cd4261b946
Support musllinux binary wheels on x64 and x86 (#28092)
* Support musllinux binary wheels

* Skip aarach64 for now
* Consolidate the difference of mktemp
* Extend linux artifact building time && install bash for distribtest
* Stop using grpc.tools, use grpc_tools
* Update the README to use grpc_tools
* Force static link libc++ for alpine binaries
* Rebase recent build script changes

* Install ccache for musllinux distribtest images

* Revert timeout change to grpc_build_artifacts
2022-02-10 14:14:56 -08:00
Jan Tattermusch 7924a5fde7
add task_runner.py --inner_jobs support for C++ distribtests (#28594)
* add support for task_runner.py --inner_jobs for C++ distribtests

* fine tune linux c++ distribtests parallelism

* yapf code
2022-01-18 18:45:13 +01:00
Esun Kim 192928c997
Use gRPC_BUILD_MSVC_MP_COUNT for windows cmake distrib tests (#28202) 2021-11-29 11:22:07 -08:00
Jan Tattermusch 9d9fa4c139
Bazel distribtest fixes (#27515)
* fix path to grpc_bazel_distribtest_latest.sh

* run bazel distribtests under docker

* fix downloads under bazel docker image
2021-10-08 03:57:38 -07:00
Jan Tattermusch fa8a122862
Add bazel distribtests (minimalist version that only tests with bazel 3.x and 4.x) (#27486)
* Make repo globally buildable

* Add initial distrib test script

* Add test script

* Support multiple versions

* Split out a separate latest version test

* Integrate with kokoro

* make tools/bazel version overridable

* added simplified test_single_bazel_version.sh

* cleanup .bazelignore

* only test 3.x and 4.x

* always test all the bazel versions

* revert unnecessary changes

* revert unnecessary changes

* fix shellcheck error

Co-authored-by: Richard Belleville <rbellevi@google.com>
2021-09-28 02:50:17 -07:00
Esun Kim 84b9bda290
Install absel along with gRPC (#26802) 2021-08-05 11:31:16 -07:00
Nicolas Noble a325d7f77a
Pointing the protobuf submodule to the new URL (#26811)
* Pointing the protobuf submodule to the new URL

* Also changing WORKSPACE dependencies

* More references to the old URL...
2021-07-29 10:19:16 -07:00
Lidi Zheng 5820e152cd
Remove Python 2.7 binary wheel generations (#26691)
* Remove Python 2.7 binary wheels

* Make sure pip won't pick-up newer versions

* Attempt to fix the distribtest

* Fallback to virtualenv==16.7.9 for 34 and 35

* Remove 34 from binary wheel distribtests
2021-07-23 08:20:39 -07:00
Jan Tattermusch d61db49b48
Add python3.8 aarch64 wheel distribtest (#26136)
* add python3.8 aarch64 distribtest

* register qemu emulator for linux distribtests
2021-05-03 08:16:11 +02:00
Stanley Cheung 732f3a02b7
Add parallel compilation to php distribtest (#25828)
* Add -j4 to php distribtest

* Pass -j instead
2021-03-29 12:51:25 -07:00
Esun Kim f862a2259f
Add abseil thread annotations to grpcpp/sync (#25560)
* Add abseil annotation to grpcpp/sync
* Bump alpine linux to 3.11 from 3.9
2021-03-03 08:39:20 -08:00
Esun Kim 160cb1b215
Changed RPI build test to general ARM build test (#25580)
* Change rpi build test to arm test
* Having a separate docker and targetting aarch64
2021-03-02 08:46:03 -08:00
Yash Tibrewal f4e55b85bc Replace disrespectful term 2021-02-08 15:29:53 -08:00
Jan Tattermusch 53390d9c42 add C# distribtest coverage for .NET5 single file publish 2020-11-30 10:12:48 +01:00
capstan 1f670397ce Remove gflags.
With the move to abseil's flags, this removed the now-unnecessary submodule and installation commands.
2020-11-14 03:03:55 +01:00
Jan Tattermusch 6c43b2c98a add netcoreapp3.1 C# distribtest 2020-10-27 16:30:01 +01:00
Jan Tattermusch e274e7b93a add C# distribtest for .NET 5 2020-10-27 16:30:00 +01:00
Esun Kim 5984f129f8 Use system nuget 2020-09-18 13:07:12 -07:00