Compare commits

...

No commits in common. "master" and "gh-pages" have entirely different histories.

15905 changed files with 695799 additions and 2227932 deletions

View File

@ -1,23 +0,0 @@
# Configuration file for Bazel CI [1].
#
# Also testing on Bazel CI in addition of our normal CI workflow
# ensures that gRPC is tested against Bazel@HEAD and stays compatible
# with the latest release.
#
# See [2,3] in case you have questions.
#
# [1] https://github.com/bazelbuild/continuous-integration
# [2] https://github.com/grpc/grpc/issues/19171
# [3] https://github.com/grpc/grpc/pull/20784
---
# TODO(yannic): Ideally, we should also enable buildifier and all platforms should test `//...`.
tasks:
ubuntu2004:
build_targets:
- //:all
- //src/proto/...
- //src/python/...
test_targets:
- //:all
- //src/proto/...
- //src/python/...

View File

@ -1,31 +0,0 @@
bazel-bin
bazel-grpc
bazel-out
bazel-testlogs
bins
libs
objs
third_party/abseil-cpp
third_party/benchmark
third_party/boringssl
third_party/bloaty
third_party/boringssl-with-bazel
third_party/envoy-api
third_party/googleapis
third_party/googletest
third_party/opencensus-proto
third_party/opentelemetry-cpp
third_party/protobuf
third_party/protoc-gen-validate
third_party/re2
third_party/upb
third_party/utf8_range
third_party/xds
test/distrib/bazel/cpp
test/distrib/bazel/python
test/distrib/bazel/python_second_test_repo
# Directories generated by setuptools build containing BUILD files.
src/python/grpcio_tests/src/
tools/distrib/python/grpcio_tools/grpc_root/

View File

@ -1,3 +0,0 @@
# load bazelrc from the legacy location
# as recommended in https://github.com/bazelbuild/bazel/issues/6319
import %workspace%/tools/bazel.rc

View File

@ -1 +0,0 @@
7.1.0

View File

@ -1,50 +0,0 @@
---
Language: Cpp
BasedOnStyle: Google
DerivePointerAlignment: false
PointerAlignment: Left
IncludeBlocks: Regroup
IncludeCategories:
# ruby.h is even more first if it's included
- Regex: '^<ruby/ruby.h>'
Priority: -200
# Some platforms (namely msys) need wchar to be included BEFORE
# anything else, especially strsafe.h.
- Regex: '^<wchar.h>'
Priority: 5
# use priority 100+ for grpc headers so they sort last
# 'system' headers - include things that have " in the names to make them
# stand out and get fixed
- Regex: '^(<|")grpc'
Priority: 100
# similary using include/ to get system headers should stand out and get
# fixed
- Regex: '^"include/'
Priority: 100
# source headers go last
- Regex: '^"(src|test)/'
Priority: 101
# not-grpc headers follow
# first, non system headers that are included like <> - these are all
# local carveouts, and get sorted below c++ but before non grpc "" files
- Regex: '^<(openssl/|uv\.h|ares\.h|address_sorting/|gmock/|gtest/|zlib|zconf|benchmark/|google/)'
Priority: 30
# first C system headers - they have a . in the filename
- Regex: '^<.*\.'
Priority: 10
# then C++ system headers - no ., the only thing that will match now
- Regex: '^<'
Priority: 20
# finally other "" includes go between system headers and our headers
- Regex: '^"'
Priority: 40
---
Language: ObjC
BasedOnStyle: Google
ColumnLimit: 100
ObjCBlockIndentWidth: 2
---
Language: Proto
BasedOnStyle: Google
ColumnLimit: 100
...

View File

@ -1,161 +0,0 @@
---
# Note on checks are disabled on purpose
#
# - abseil-cleanup-ctad
# Requires C++17 and higher.
#
# - abseil-no-namespace
# https://bugs.llvm.org/show_bug.cgi?id=47947
#
# - bugprone-exception-escape
# https://github.com/llvm/llvm-project/issues/54668 (seems to be fixed in LLVM17)
#
# - bugprone-reserved-identifier
# Some macros need to be defined for portability purpose; e.g. _BSD_SOURCE.
#
# - modernize-redundant-void-arg
# Some source should be strictly C99 and func(void) should be used.
#
# - google-readability-casting
# https://github.com/llvm/llvm-project/issues/57959
#
# Note on checks which will be enabled in future. These are good to have but
# it's not activated yet due to the existing issues with the checks.
# Once those issues are clear, these checks can be enabled later.
#
# - bugprone-assignment-in-if-condition
# - bugprone-branch-clone
# - bugprone-easily-swappable-parameters
# - bugprone-implicit-widening-of-multiplication-result
# - bugprone-infinite-loop
# - bugprone-narrowing-conversions
# - bugprone-not-null-terminated-result
# - bugprone-signed-char-misuse
# - bugprone-sizeof-expression
# - bugprone-switch-missing-default-case
# - bugprone-too-small-loop-variable
# - bugprone-unchecked-optional-access
# - clang-diagnostic-deprecated-declarations
# - clang-diagnostic-unused-function
# - google-runtime-int
# - google-runtime-references
# - modernize-avoid-bind
# - modernize-deprecated-headers
# - modernize-loop-convert
# - modernize-pass-by-value
# - modernize-raw-string-literal
# - modernize-return-braced-init-list
# - modernize-use-auto
# - modernize-use-default-member-init
# - modernize-use-emplace
# - modernize-use-equals-default
# - modernize-use-equals-delete
# - modernize-use-using
# - performance-avoid-endl
# - performance-no-automatic-move
# - performance-no-int-to-ptr
# - performance-noexcept-swap
# - performance-unnecessary-copy-initialization
# - performance-unnecessary-value-param
# - readability-else-after-return
# - readability-implicit-bool-conversion
# - readability-redundant-declaration
# - readability-redundant-string-cstr
#
Checks: '-*,
abseil-*,
-abseil-cleanup-ctad,
-abseil-no-namespace,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-infinite-loop,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse,
-bugprone-sizeof-expression,
-bugprone-switch-missing-default-case,
-bugprone-too-small-loop-variable,
-bugprone-unchecked-optional-access,
google-*,
-google-readability-casting,
-google-runtime-int,
-google-runtime-references,
performance-*,
-performance-avoid-endl,
-performance-no-automatic-move,
-performance-no-int-to-ptr,
-performance-noexcept-swap,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
clang-diagnostic-deprecated-declarations,
clang-diagnostic-deprecated-register,
clang-diagnostic-expansion-to-defined,
clang-diagnostic-ignored-attributes,
clang-diagnostic-non-pod-varargs,
clang-diagnostic-shadow-field,
clang-diagnostic-shift-sign-overflow,
clang-diagnostic-tautological-undefined-compare,
clang-diagnostic-thread-safety*,
clang-diagnostic-undefined-bool-conversion,
clang-diagnostic-unreachable-code,
clang-diagnostic-unreachable-code-loop-increment,
clang-diagnostic-unused-const-variable,
clang-diagnostic-unused-lambda-capture,
clang-diagnostic-unused-local-typedef,
clang-diagnostic-unused-private-field,
clang-diagnostic-user-defined-warnings,
misc-definitions-in-headers,
misc-static-assert,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
misc-unused-alias-decls,
misc-unused-using-decls,
modernize-make-shared,
modernize-make-unique,
modernize-replace-auto-ptr,
modernize-replace-random-shuffle,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-bool-literals,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
readability-braces-around-statements,
readability-const-return-type,
readability-container-size-empty,
readability-delete-null-pointer,
readability-deleted-default,
readability-duplicate-include,
readability-function-size,
readability-inconsistent-declaration-parameter-name,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-redundant-access-specifiers,
readability-redundant-control-flow,
readability-redundant-function-ptr-dereference,
readability-redundant-smartptr-get,
-readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-boolean-expr,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release'
WarningsAsErrors: '*'
CheckOptions:
- key: readability-function-size.StatementThreshold
value: '450'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'absl::make_unique'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: 'absl/memory/memory.h'
- key: readability-braces-around-statements.ShortStatementLines
value: 1
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: false

View File

@ -1,6 +0,0 @@
bazel-bin
bazel-grpc
bazel-out
build
.cache
.git

View File

@ -1,7 +0,0 @@
root = true
[**]
end_of_line = LF
indent_style = space
indent_size = 2
insert_final_newline = true
tab_width = 8

View File

@ -1,3 +0,0 @@
# .git-blame-ignore-revs
# Migrated python code style from yapf to black
de6ed9ba9fd59f753bbfd4c9a88ff15e03a89de7

View File

@ -1,2 +0,0 @@
# Security tests will contain fake secrets
test/core/security/**

41
.gitattributes vendored
View File

@ -1,41 +0,0 @@
src/core/ext/upb-gen/** linguist-generated=true
src/core/ext/upbdefs-gen/** linguist-generated=true
Makefile linguist-generated=true
BUILD.gn linguist-generated=true
CMakeLists.txt linguist-generated=true
build_autogenerated.yaml linguist-generated=true
config.m4 linguist-generated=true
config.w32 linguist-generated=true
gRPC-C++.podspec linguist-generated=true
gRPC-Core.podspec linguist-generated=true
gRPC-ProtoRPC.podspec linguist-generated=true
gRPC-RxLibrary.podspec linguist-generated=true
gRPC.podspec linguist-generated=true
grpc.gemspec linguist-generated=true
grpc.def linguist-generated=true
package.xml linguist-generated=true
Package.swift linguist-generated=true
src/python/grpcio/grpc_core_dependencies.py linguist-generated=true
src/ruby/ext/grpc/rb_grpc_imports.generated.h linguist-generated=true
src/ruby/ext/grpc/rb_grpc_imports.generated.c linguist-generated=true
include/grpc/module.modulemap linguist-generated=true
test/core/security/grpc_tls_credentials_options_comparator_test.cc linguist-generated=true
tools/doxygen/Doxyfile.c++ linguist-generated=true
tools/doxygen/Doxyfile.c++.internal linguist-generated=true
tools/doxygen/Doxyfile.core linguist-generated=true
tools/doxygen/Doxyfile.core.internal linguist-generated=true
tools/run_tests/sources_and_headers.json linguist-generated=true
tools/run_tests/tests.json linguist-generated=true
tools/run_tests/generated/tests.json linguist-generated=true
tools/run_tests/generated/sources_and_headers.json linguist-generated=true
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h linguist-generated=true
src/core/telemetry/stats_data.h linguist-generated=true
src/core/telemetry/stats_data.cc linguist-generated=true
src/core/lib/experiments/experiments.h linguist-generated=true
src/core/lib/experiments/experiments.cc linguist-generated=true
bazel/experiments.bzl linguist-generated=true
test/cpp/microbenchmarks/huffman_geometries/** linguist-generated=true
doc/trace_flags.md linguist-generated=true
src/core/lib/debug/trace_flags.h linguist-generated=true
src/core/lib/debug/trace_flags.cc linguist-generated=true
src/python/grpcio_observability/observability_lib_deps.py linguist-generated=true

12
.github/CODEOWNERS vendored
View File

@ -1,12 +0,0 @@
/bazel/** @veblush @gnossen
/bazel/experiments.yaml
/cmake/** @veblush @apolcyn
/src/core/client_channel/** @markdroth
/src/core/ext/transport/chttp2/transport/** @ctiller
/src/core/load_balancing/** @markdroth
/src/core/resolver/** @markdroth
/src/core/server/xds* @markdroth
/src/core/service_config/** @markdroth
/src/core/xds/** @markdroth
/tools/dockerfile/** @drfloob @apolcyn @gnossen
/tools/run_tests/xds_k8s_test_driver/** @sergiitk @XuanWang-Amos @gnossen

View File

@ -1,40 +0,0 @@
---
name: Report a gRPC Core bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/core, untriaged
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,40 +0,0 @@
---
name: Report a gRPC C++ bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/c++, untriaged
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,41 +0,0 @@
---
name: Report a gRPC C# bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/C#
assignees: apolcyn
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,41 +0,0 @@
---
name: Report a gRPC ObjC bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/ObjC
assignees: dennycd
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,41 +0,0 @@
---
name: Report a gRPC PHP bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/php
assignees: stanley-cheung
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,43 +0,0 @@
---
name: Report a gRPC Python bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/Python
assignees:
- gnossen
- XuanWang-Amos
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,41 +0,0 @@
---
name: Report a gRPC Ruby bug
about: Create a report to help us improve
labels: kind/bug, priority/P2, lang/ruby
assignees: apolcyn
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### What version of gRPC and what language are you using?
### What operating system (Linux, Windows,...) and version?
### What runtime / compiler are you using (e.g. python version or version of gcc)
### What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If theres not enough information to debug the problem, gRPC team may close the issue at their discretion. Youre welcome to re-open the issue once you have a reproduction.
### What did you expect to see?
### What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
### Anything else we should know about your project / environment?

View File

@ -1,18 +0,0 @@
---
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup, priority/P2, untriaged
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->

View File

@ -1,29 +0,0 @@
---
name: Request a gRPC Core feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/core, untriaged
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,29 +0,0 @@
---
name: Request a gRPC C++ feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/c++, untriaged
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,30 +0,0 @@
---
name: Request a gRPC C# feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/C#
assignees: apolcyn
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,30 +0,0 @@
---
name: Request a gRPC ObjC feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/ObjC
assignees: dennycd
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,30 +0,0 @@
---
name: Request a gRPC PHP feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/php
assignees: stanley-cheung
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,32 +0,0 @@
---
name: Request a gRPC Python feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/Python
assignees:
- gnossen
- XuanWang-Amos
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,30 +0,0 @@
---
name: Request a gRPC Ruby feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/ruby
assignees: apolcyn
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context about the feature request here.

View File

@ -1,16 +0,0 @@
---
name: Ask a question
about: Ask a question
labels: kind/question, priority/P3, untriaged
---
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
This issue will be closed down once seen by the repo managers.

View File

@ -1,15 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"

65
.github/labeler.yml vendored
View File

@ -1,65 +0,0 @@
lang/core:
- changed-files:
- any-glob-to-any-file:
- src/abseil-cpp/**
- src/boringssl/**
- src/c-ares/**
- src/core/**
- src/proto/**
- src/re2/**
- src/upb/**
- src/zlib/**
- include/grpc/**
- test/core/**
- tools/codegen/core/**
lang/c++:
- changed-files:
- any-glob-to-any-file:
- examples/cpp/**
- src/cpp/**
- include/grpc++/**
- include/grpcpp/**
- test/cpp/**
area/infra:
- changed-files:
- any-glob-to-any-file:
- .github/**
lang/node:
- changed-files:
- any-glob-to-any-file:
- examples/node/**
- src/compiler/node*
lang/ObjC:
- changed-files:
- any-glob-to-any-file:
- examples/objective-c/**
- src/compiler/objective_c*
- src/objective-c/**
lang/php:
- changed-files:
- any-glob-to-any-file:
- examples/php/**
- src/compiler/php*
- src/php/**
lang/python:
- changed-files:
- any-glob-to-any-file:
- bazel/python_rules.bzl
- examples/python/**
- requirements.bazel.txt
- src/compiler/python*
- all-globs-to-any-file:
- src/python/**
- '!src/python/grpcio/grpc_core_dependencies.py'
- '!src/python/grpcio_observability/observability_lib_deps.py'
lang/ruby:
- changed-files:
- any-glob-to-any-file:
- examples/ruby/**
- src/compiler/ruby*
- src/ruby/**
'lang/C#':
- changed-files:
- any-glob-to-any-file:
- src/compiler/csharp*
- src/csharp/**

2
.github/lock.yml vendored
View File

@ -1,2 +0,0 @@
daysUntilLock: 90
lockComment: false

21
.github/mergeable.yml vendored
View File

@ -1,21 +0,0 @@
mergeable:
pull_requests:
label:
and:
- must_exclude:
regex: '^disposition/DO NOT MERGE'
message: 'Pull request marked not mergeable'
- must_exclude:
regex: '^disposition/Needs Internal Changes'
message: 'Pull request must be cherrypicked. Remove this label when ready to merge.'
- or:
- and:
- must_include:
regex: '^release notes: yes'
message: 'Please add the label (release notes: yes)'
- must_include:
regex: '^lang\/'
message: 'Please add a language label (lang/...)'
- must_include:
regex: '^release notes: no'
message: 'Please add the label (release notes: no)'

View File

@ -1,16 +0,0 @@
{
"LABEL": {
"name": "PR title format",
"color": "EEEEEE"
},
"CHECKS": {
"regexp": "^((\\[[^\\]]+\\])+|Revert|Automated fix for) ",
"regexpFlags": "i",
"ignoreLabels": []
},
"MESSAGES": {
"success": "All OK",
"failure": "PR title should be like this: '[component] Brief summary'",
"notice": ""
}
}

View File

@ -1,13 +0,0 @@
<!--
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.
-->

60
.github/stale.yml vendored
View File

@ -1,60 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- "disposition/never stale"
- "kind/bug"
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: "disposition/stale"
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue/PR has been automatically marked as stale because it has not had any update (including
commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no
further update occurs in 7 day. Thank you for your contributions!
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
# closeComment: >
# Your comment here.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed

View File

@ -1,104 +0,0 @@
name: PR AutoFix
on: [push]
permissions: {}
jobs:
PRAutoFix:
permissions:
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
contents: write # to create branch (peter-evans/create-pull-request)
pull-requests: write # to create a PR (peter-evans/create-pull-request)
runs-on: ubuntu-latest
steps:
# Cache bazel build
- name: Get current time
uses: srfrnk/current-time@5a4163ad035ccd9a407ec9e519c3b6ba1b633d1e # v1.1.0
id: current-time
with:
format: YYYYWW
- name: Get current time
uses: srfrnk/current-time@5a4163ad035ccd9a407ec9e519c3b6ba1b633d1e # v1.1.0
id: current-time-with-day
with:
format: YYYYWWd
- name: Cache bazel
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
env:
cache-name: bazel-cache
with:
path: ~/.cache/bazel
# formattedTime here is like 2021323 - the year concatenated with the week then
# the day of that week.
# As this changes every day, we cycle to a new cache once per day, with lookup
# across the week (and then the year).
key: ${{ runner.os }}-${{ steps.current-time-with-day.outputs.formattedTime }}
restore-keys: |
${{ runner.os }}-${{ steps.current-time.outputs.formattedTime }}
${{ runner.os }}-
# Cancel current runs if they're still running
# (saves processing on fast pushes)
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}
# Allow opt-out for some users
- name: Should I Stay Or Should I Go
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: check
with:
script: |
// If you'd like not to run this code on your commits, add your github user id here:
const NO_AUTOFIX_USERS = ["copybara-service[bot]"];
const { owner, repo } = context.repo;
console.log("Actor: " + context.actor);
if (NO_AUTOFIX_USERS.includes(context.actor)) {
console.log('Cancelling');
const run_id = "${{ github.run_id }}";
await github.rest.actions.cancelWorkflowRun({ owner, repo, run_id });
return 'go';
} else {
return 'stay';
}
- name: Wait for cancellation
run: sleep 60
if: steps.check.outputs.result == 'go'
- name: Should build?
run: test "${{ steps.check.outputs.result }}" = "stay"
# Setup to run sanity suite
- name: Install Python Interpreter
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.8
- name: Install Python Packages
run: |
pip install pyyaml mako virtualenv
sudo apt-get update
sudo apt-get install python3-dev
- name: Check out repository code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: True
- name: Get the upstream code
run: |
cd ${{ github.workspace }}
git remote add upstream https://github.com/grpc/grpc
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 upstream master
# Run the things!
- name: clang-tidy fixes
run: ANDROID_NDK_HOME= ${{ github.workspace }}/tools/distrib/clang_tidy_code.sh --fix --only-changed || true
- name: Run sanitize
run: ANDROID_NDK_HOME= ${{ github.workspace }}/tools/distrib/sanitize.sh
# Report back with a PR if things are broken
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
delete-branch: true
branch-suffix: short-commit-hash
commit-message: "Automated change: Fix sanity tests"
title: Automated fix for ${{ github.ref }}
body: |
PanCakes to the rescue!
We noticed that our 'sanity' test was going to fail, but we think we can fix that automatically, so we put together this PR to do just that!
If you'd like to opt-out of these PR's, add yourself to NO_AUTOFIX_USERS in .github/workflows/pr-auto-fix.yaml

View File

@ -1,19 +0,0 @@
name: PR Auto Tag
on:
pull_request_target:
types: [opened, reopened, synchronize, edited]
permissions:
contents: read # to determine modified files (actions/labeler)
jobs:
triage:
permissions:
contents: read # to determine modified files (actions/labeler)
pull-requests: write # to add labels to PRs (actions/labeler)
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: false

186
.gitignore vendored
View File

@ -1,186 +0,0 @@
# C/C++ build outputs
.build/
build/
bins
gens
libs
objs
# Python items
.coverage*
.eggs
.pytype
*.egg
*.egg-info
a.out
cython_debug/
dist/
htmlcov/
py3*/
pyb/
python_pylint_venv/
src/python/grpcio_*/=*
src/python/grpcio_*/build/
src/python/grpcio_*/LICENSE
src/python/grpcio_status/grpc_status/google/rpc/status.proto
black_virtual_environment/
isort_virtual_environment/
# Node installation output
node_modules
src/node/extension_binary/
# gcov coverage data
reports
coverage
*.gcno
# profiler output
*.prof
# python compiled objects
*.pyc
# eclipse project files
.cproject
.project
.settings
# cache for run_tests.py
.run_tests_cache
.preprocessed_build
# emacs temp files
*~
# vim temp files
.*.swp
.*.swo
# Makefile's cache
cache.mk
# Ruby's local gem information
Gemfile.lock
# Temporary test reports
report.xml
*/sponge_log.xml
*/success_log_to_rename.xml
latency_trace.txt
latency_trace.*.txt
# port server log
portlog.txt
# gyp generated make files
*-gyp.mk
out
# YCM config files
.ycm_extra_conf.py
# XCode
^build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
*.DS_Store
# Swift Package Manager files
Package.resolved
# Objective-C generated files
*.pbobjc.*
*.pbrpc.*
src/objective-c/**/Build
# Cocoapods artifacts
Pods/
Podfile.lock
*.xcworkspace
# Artifacts directory
/artifacts/
# Git generated files for conflicting
*.orig
# IDE specific folder for JetBrains IDEs
.idea/
# Bazel files
bazel-*
bazel_format_virtual_environment/
tools/bazel-*
# Bazel wrapper
bazel_wrapper
bazel_wrapper.bat
bazel_wrapper.bazelrc
# Debug output
gdb.txt
# ctags file
tags
# perf data
memory_usage.csv
perf.data
perf.data.old
# bm_diff
bm_diff_new/
bm_diff_old/
bm_*.json
bloat_diff_new/
bloat_diff_old/
bloaty-build/
# cmake build files
**/cmake/build/
# Visual Studio Code artifacts
.cache/*
.vscode/*
.history/
# Clion artifacts
cmake-build-debug/
# Benchmark outputs
BenchmarkDotNet.Artifacts/
# pyenv config
.python-version
# clang JSON compilation database file
compile_commands.json
# IWYU byproducts
compile_commands_for_iwyu.json
iwyu.out
iwyu_files.txt
iwyu_files0.txt
iwyu/
iwyu_build/
# fuzzer logs
fuzz-*.log
# bazel module files (MODULE.bazel will need to be removed here)
MODULE.bazel
MODULE.bazel.lock

52
.gitmodules vendored
View File

@ -1,52 +0,0 @@
[submodule "third_party/abseil-cpp"]
path = third_party/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
[submodule "third_party/benchmark"]
path = third_party/benchmark
url = https://github.com/google/benchmark
[submodule "third_party/bloaty"]
path = third_party/bloaty
url = https://github.com/google/bloaty.git
[submodule "third_party/boringssl-with-bazel"]
path = third_party/boringssl-with-bazel
url = https://github.com/google/boringssl.git
[submodule "third_party/cares/cares"]
path = third_party/cares/cares
url = https://github.com/c-ares/c-ares.git
[submodule "third_party/envoy-api"]
path = third_party/envoy-api
url = https://github.com/envoyproxy/data-plane-api.git
[submodule "third_party/googleapis"]
path = third_party/googleapis
url = https://github.com/googleapis/googleapis.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/opencensus-proto"]
path = third_party/opencensus-proto
url = https://github.com/census-instrumentation/opencensus-proto.git
[submodule "third_party/opentelemetry"]
path = third_party/opentelemetry
url = https://github.com/open-telemetry/opentelemetry-proto.git
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf.git
[submodule "third_party/protoc-gen-validate"]
path = third_party/protoc-gen-validate
url = https://github.com/envoyproxy/protoc-gen-validate.git
[submodule "third_party/re2"]
path = third_party/re2
url = https://github.com/google/re2.git
[submodule "third_party/xds"]
path = third_party/xds
url = https://github.com/cncf/xds.git
[submodule "third_party/zlib"]
path = third_party/zlib
url = https://github.com/madler/zlib
# When using CMake to build, the zlib submodule ends up with a
# generated file that makes Git consider the submodule dirty. This
# state can be ignored for day-to-day development on gRPC.
ignore = dirty
[submodule "third_party/opentelemetry-cpp"]
path = third_party/opentelemetry-cpp
url = https://github.com/open-telemetry/opentelemetry-cpp

View File

@ -1,6 +0,0 @@
reporting:
watermarks:
statements: [80, 95]
lines: [80, 95]
functions: [80, 95]
branches: [80, 95]

103
.pylintrc
View File

@ -1,103 +0,0 @@
[MASTER]
ignore=
src/python/grpcio/grpc/beta,
src/python/grpcio/grpc/framework,
src/python/grpcio/grpc/framework/common,
src/python/grpcio/grpc/framework/foundation,
src/python/grpcio/grpc/framework/interfaces,
extension-pkg-whitelist=grpc._cython.cygrpc
[VARIABLES]
# TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection
# not include "unused_" and "ignored_" by default?
dummy-variables-rgx=^ignored_|^unused_|_
[DESIGN]
# NOTE(nathaniel): Not particularly attached to this value; it just seems to
# be what works for us at the moment (excepting the dead-code-walking Beta
# API).
max-args=14
max-parents=8
[MISCELLANEOUS]
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
# "NOTE(<username or issue link>): ". We do not allow "TODO:",
# "TODO(<username>):", "FIXME:", or anything else.
notes=FIXME,XXX
[MESSAGES CONTROL]
disable=
# TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
# Enable cyclic-import after a 1.7-or-later pylint release that
# recognizes our disable=cyclic-import suppressions.
cyclic-import,
# TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the
# Beta API is removed.
duplicate-code,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to
# understand enum and concurrent.futures; look into this later with the
# latest pylint version.
import-error,
# TODO(https://github.com/grpc/grpc/issues/261): Enable this one.
# Should take a little configuration but not much.
invalid-name,
# TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to
# work for now? Try with a later pylint?
locally-disabled,
# NOTE(nathaniel): What even is this? *Enabling* an inspection results
# in a warning? How does that encourage more analysis and coverage?
locally-enabled,
# NOTE(nathaniel): We don't write doc strings for most private code
# elements.
missing-docstring,
# NOTE(nathaniel): In numeric comparisons it is better to have the
# lesser (or lesser-or-equal-to) quantity on the left when the
# expression is true than it is to worry about which is an identifier
# and which a literal value.
misplaced-comparison-constant,
# NOTE(nathaniel): Our completely abstract interface classes don't have
# constructors.
no-init,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play
# nicely with some of our code being implemented in Cython. Maybe in a
# later version?
no-name-in-module,
# TODO(https://github.com/grpc/grpc/issues/261): Suppress these where
# the odd shape of the authentication portion of the API forces them on
# us and enable everywhere else.
protected-access,
# NOTE(nathaniel): Pylint and I will probably never agree on this.
too-few-public-methods,
# NOTE(nathaniel): Pylint and I wil probably never agree on this for
# private classes. For public classes maybe?
too-many-instance-attributes,
# NOTE(nathaniel): Some of our modules have a lot of lines... of
# specification and documentation. Maybe if this were
# lines-of-code-based we would use it.
too-many-lines,
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
# TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
# super-init requirement for abstract class implementations for now.
super-init-not-called,
# NOTE(nathaniel): A single statement that always returns program
# control is better than two statements the first of which sometimes
# returns program control and the second of which always returns
# program control. Probably generally, but definitely in the cases of
# if:/else: and for:/else:.
useless-else-on-loop,
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(lidiz): the import order will be enforced by isort instead
wrong-import-order,
# TODO(https://github.com/PyCQA/pylint/issues/3882): Upgrade Pylint
unsubscriptable-object,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

View File

@ -1,108 +0,0 @@
[MASTER]
ignore=
src/python/grpcio/grpc/beta,
src/python/grpcio/grpc/framework,
src/python/grpcio/grpc/framework/common,
src/python/grpcio/grpc/framework/foundation,
src/python/grpcio/grpc/framework/interfaces,
[VARIABLES]
# TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection
# not include "unused_" and "ignored_" by default?
dummy-variables-rgx=^ignored_|^unused_
[DESIGN]
# NOTE(nathaniel): Not particularly attached to this value; it just seems to
# be what works for us at the moment (excepting the dead-code-walking Beta
# API).
max-args=6
[MISCELLANEOUS]
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
# "NOTE(<username or issue link>): ". We do not allow "TODO:",
# "TODO(<username>):", "FIXME:", or anything else.
notes=FIXME,XXX
[MESSAGES CONTROL]
disable=
# -- START OF EXAMPLE-SPECIFIC SUPPRESSIONS --
no-self-use,
unused-argument,
unused-variable,
# -- END OF EXAMPLE-SPECIFIC SUPPRESSIONS --
# TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
# Enable cyclic-import after a 1.7-or-later pylint release that
# recognizes our disable=cyclic-import suppressions.
cyclic-import,
# TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the
# Beta API is removed.
duplicate-code,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to
# understand enum and concurrent.futures; look into this later with the
# latest pylint version.
import-error,
# TODO(https://github.com/grpc/grpc/issues/261): Enable this one.
# Should take a little configuration but not much.
invalid-name,
# TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to
# work for now? Try with a later pylint?
locally-disabled,
# NOTE(nathaniel): What even is this? *Enabling* an inspection results
# in a warning? How does that encourage more analysis and coverage?
locally-enabled,
# NOTE(nathaniel): We don't write doc strings for most private code
# elements.
missing-docstring,
# NOTE(nathaniel): In numeric comparisons it is better to have the
# lesser (or lesser-or-equal-to) quantity on the left when the
# expression is true than it is to worry about which is an identifier
# and which a literal value.
misplaced-comparison-constant,
# NOTE(nathaniel): Our completely abstract interface classes don't have
# constructors.
no-init,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play
# nicely with some of our code being implemented in Cython. Maybe in a
# later version?
no-name-in-module,
# TODO(https://github.com/grpc/grpc/issues/261): Suppress these where
# the odd shape of the authentication portion of the API forces them on
# us and enable everywhere else.
protected-access,
# NOTE(nathaniel): Pylint and I will probably never agree on this.
too-few-public-methods,
# NOTE(nathaniel): Pylint and I wil probably never agree on this for
# private classes. For public classes maybe?
too-many-instance-attributes,
# NOTE(nathaniel): Some of our modules have a lot of lines... of
# specification and documentation. Maybe if this were
# lines-of-code-based we would use it.
too-many-lines,
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
# TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
# super-init requirement for abstract class implementations for now.
super-init-not-called,
# NOTE(nathaniel): A single statement that always returns program
# control is better than two statements the first of which sometimes
# returns program control and the second of which always returns
# program control. Probably generally, but definitely in the cases of
# if:/else: and for:/else:.
useless-else-on-loop,
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(lidiz): the import order will be enforced by isort instead
wrong-import-order,
# TODO(https://github.com/PyCQA/pylint/issues/3882): Upgrade Pylint
unsubscriptable-object,
# NOTE(rbellevi): Pylint doesn't understand .pyi files.
no-member,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

View File

@ -1,132 +0,0 @@
[MASTER]
ignore=
src/python/grpcio_tests/tests/unit/beta,
src/python/grpcio_tests/tests/unit/framework,
src/python/grpcio_tests/tests/unit/framework/common,
src/python/grpcio_tests/tests/unit/framework/foundation,
[VARIABLES]
# TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection
# not include "unused_" and "ignored_" by default?
dummy-variables-rgx=^ignored_|^unused_
[DESIGN]
# NOTE(nathaniel): Not particularly attached to this value; it just seems to
# be what works for us at the moment (excepting the dead-code-walking Beta
# API).
max-args=6
[MISCELLANEOUS]
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
# "NOTE(<username or issue link>): ". We do not allow "TODO:",
# "TODO(<username>):", "FIXME:", or anything else.
notes=FIXME,XXX
[MESSAGES CONTROL]
extension-pkg-whitelist=grpc._cython.cygrpc
disable=
# These suppressions are specific to tests:
#
# TODO(https://github.com/grpc/grpc/issues/261): investigate
# each of the following one by one and consider eliminating
# the suppression category.
# Eventually, the hope is to eliminate the .pylintrc-tests
# altogether and rely on .pylintrc for everything.
pointless-statement,
no-member,
no-self-use,
attribute-defined-outside-init,
unused-argument,
unused-variable,
unused-import,
redefined-builtin,
too-many-public-methods,
too-many-locals,
redefined-variable-type,
redefined-outer-name,
ungrouped-imports,
too-many-branches,
too-many-arguments,
too-many-format-args,
too-many-return-statements,
too-many-statements,
line-too-long,
wrong-import-position,
wrong-import-order,
# -- END OF TEST-SPECIFIC SUPPRESSIONS --
# TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
# Enable cyclic-import after a 1.7-or-later pylint release that
# recognizes our disable=cyclic-import suppressions.
cyclic-import,
# TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the
# Beta API is removed.
duplicate-code,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to
# understand enum and concurrent.futures; look into this later with the
# latest pylint version.
import-error,
# TODO(https://github.com/grpc/grpc/issues/261): Enable this one.
# Should take a little configuration but not much.
invalid-name,
# TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to
# work for now? Try with a later pylint?
locally-disabled,
# NOTE(nathaniel): What even is this? *Enabling* an inspection results
# in a warning? How does that encourage more analysis and coverage?
locally-enabled,
# NOTE(nathaniel): We don't write doc strings for most private code
# elements.
missing-docstring,
# NOTE(nathaniel): In numeric comparisons it is better to have the
# lesser (or lesser-or-equal-to) quantity on the left when the
# expression is true than it is to worry about which is an identifier
# and which a literal value.
misplaced-comparison-constant,
# NOTE(nathaniel): Our completely abstract interface classes don't have
# constructors.
no-init,
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play
# nicely with some of our code being implemented in Cython. Maybe in a
# later version?
no-name-in-module,
# TODO(https://github.com/grpc/grpc/issues/261): Suppress these where
# the odd shape of the authentication portion of the API forces them on
# us and enable everywhere else.
protected-access,
# NOTE(nathaniel): Pylint and I will probably never agree on this.
too-few-public-methods,
# NOTE(nathaniel): Pylint and I wil probably never agree on this for
# private classes. For public classes maybe?
too-many-instance-attributes,
# NOTE(nathaniel): Some of our modules have a lot of lines... of
# specification and documentation. Maybe if this were
# lines-of-code-based we would use it.
too-many-lines,
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
# TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
# super-init requirement for abstract class implementations for now.
super-init-not-called,
# NOTE(nathaniel): A single statement that always returns program
# control is better than two statements the first of which sometimes
# returns program control and the second of which always returns
# program control. Probably generally, but definitely in the cases of
# if:/else: and for:/else:.
useless-else-on-loop,
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(lidiz): the import order will be enforced by isort instead
wrong-import-order,
# TODO(https://github.com/PyCQA/pylint/issues/3882): Upgrade Pylint
unsubscriptable-object,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

6
.rspec
View File

@ -1,6 +0,0 @@
-Isrc/ruby
-Isrc/ruby/pb
--backtrace
--require spec/spec_helper
--format documentation
--color

View File

@ -1,35 +0,0 @@
# this file is auto-generated
*protoc_lib_deps.py
# no need to format protoc generated files
*_pb2*.py
# no need to format build-yaml generated files
*.gen.py
# generated files from a template
*test/cpp/naming/resolver_component_tests_runner.py
# No BUILD, .bzl files
*BUILD
*.bzl
*.bazelrc
# No other languages
*.bat
*.c
*.c++
*.cc
*.css
*.go
*.h
*.html
*.json
*.md
*.objc
*.php
*.proto
*.rb
*.sh
*.xml
*.yaml

View File

@ -1 +0,0 @@
src/ruby/**/*.rb

View File

@ -1,4 +0,0 @@
Dropbox, Inc.
Google Inc.
Skyscanner Ltd.
WeWork Companies Inc.

5194
BUILD

File diff suppressed because it is too large Load Diff

View File

@ -1,281 +0,0 @@
gRPC C++ - Building from source
===========================
This document has detailed instructions on how to build gRPC C++ from source. Note that it only covers the build of gRPC itself and is meant for gRPC C++ contributors and/or power users.
Other should follow the user instructions. See the [How to use](https://github.com/grpc/grpc/tree/master/src/cpp#to-start-using-grpc-c) instructions for guidance on how to add gRPC as a dependency to a C++ application (there are several ways and system-wide installation is often not the best choice).
# Pre-requisites
## Linux
```sh
$ [sudo] apt-get install build-essential autoconf libtool pkg-config
```
If you plan to build using CMake
```sh
$ [sudo] apt-get install cmake
```
If you are a contributor and plan to build and run tests, install the following as well:
```sh
$ # clang and LLVM C++ lib is only required for sanitizer builds
$ [sudo] apt-get install clang libc++-dev
```
## MacOS
On a Mac, you will first need to
install Xcode or
[Command Line Tools for Xcode](https://developer.apple.com/download/more/)
and then run the following command from a terminal:
```sh
$ [sudo] xcode-select --install
```
To build gRPC from source, you may need to install the following
packages from [Homebrew](https://brew.sh):
```sh
$ brew install autoconf automake libtool shtool
```
If you plan to build using CMake, follow the instructions from https://cmake.org/download/
*Tip*: when building,
you *may* want to explicitly set the `LIBTOOL` and `LIBTOOLIZE`
environment variables when running `make` to ensure the version
installed by `brew` is being used:
```sh
$ LIBTOOL=glibtool LIBTOOLIZE=glibtoolize make
```
## Windows
To prepare for cmake + Microsoft Visual C++ compiler build
- Install Visual Studio 2019 or later (Visual C++ compiler will be used).
- Install [Git](https://git-scm.com/).
- Install [CMake](https://cmake.org/download/).
- Install [nasm](https://www.nasm.us/) and add it to `PATH` (`choco install nasm`) - *required by boringssl*
- (Optional) Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
# Clone the repository (including submodules)
Before building, you need to clone the gRPC github repository and download submodules containing source code
for gRPC's dependencies (that's done by the `submodule` command or `--recursive` flag). Use following commands
to clone the gRPC repository at the [latest stable release tag](https://github.com/grpc/grpc/releases)
## Unix
```sh
$ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
$ cd grpc
$ git submodule update --init
```
## Windows
```
> git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
> cd grpc
> git submodule update --init
```
NOTE: The `bazel` build tool uses a different model for dependencies. You only need to worry about downloading submodules if you're building
with something else than `bazel` (e.g. `cmake`).
# Build from source
In the C++ world, there's no "standard" build system that would work for all supported use cases and on all supported platforms.
Therefore, gRPC supports several major build systems, which should satisfy most users. Depending on your needs
we recommend building using `bazel` or `cmake`.
## Building with bazel (recommended)
Bazel is the primary build system for gRPC C++. If you're comfortable using bazel, we can certainly recommend it.
Using bazel will give you the best developer experience in addition to faster and cleaner builds.
You'll need `bazel` version `1.0.0` or higher to build gRPC.
See [Installing Bazel](https://docs.bazel.build/versions/master/install.html) for instructions how to install bazel on your system.
We support building with `bazel` on Linux, MacOS and Windows.
From the grpc repository root
```
# Build gRPC C++
$ bazel build :all
```
```
# Run all the C/C++ tests
$ bazel test --config=dbg //test/...
```
NOTE: If you're using Bazel 7 or newer and working with gRPC, you'll need to turn off bzlmod.
This is because gRPC isn't fully compatible with bzlmod yet. To do this, add --enable_bzlmod=false to your Bazel commands.
NOTE: If you are a gRPC maintainer and you have access to our test cluster, you should use our [gRPC's Remote Execution environment](tools/remote_build/README.md)
to get significant improvement to the build and test speed (and a bunch of other very useful features).
## Building with CMake
### Linux/Unix, Using Make
Run from the grpc directory after cloning the repo with --recursive or updating submodules.
```
$ mkdir -p cmake/build
$ cd cmake/build
$ cmake ../..
$ make
```
If you want to build shared libraries (`.so` files), run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Windows, Using Visual Studio 2019 or later
When using the "Visual Studio" generator,
cmake will generate a solution (`grpc.sln`) that contains a VS project for
every target defined in `CMakeLists.txt` (+ a few extra convenience projects
added automatically by cmake). After opening the solution with Visual Studio
you will be able to browse and build the code.
```
> @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
> md .build
> cd .build
> cmake .. -G "Visual Studio 16 2019"
> cmake --build . --config Release
```
Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Windows, Using Ninja (faster build).
Please note that when using Ninja, you will still need Visual C++ (part of Visual Studio)
installed to be able to compile the C/C++ sources.
```
> @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
> cd cmake
> md build
> cd build
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64
> cmake ..\.. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake --build .
```
Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Windows: A note on building shared libs (DLLs)
Windows DLL build is supported at a "best effort" basis and we don't recommend using gRPC C++ as a DLL as there are some known drawbacks around how C++ DLLs work on Windows. For example, there is no stable C++ ABI and you can't safely allocate memory in one DLL, and free it in another etc.
That said, we don't actively prohibit building DLLs on windows (it can be enabled in cmake with `-DBUILD_SHARED_LIBS=ON`), and are free to use the DLL builds
at your own risk.
- you've been warned that there are some important drawbacks and some things might not work at all or will be broken in interesting ways.
- we don't have extensive testing for DLL builds in place (to avoid maintenance costs, increased test duration etc.) so regressions / build breakages might occur
### Dependency management
gRPC's CMake build system has two options for handling dependencies.
CMake can build the dependencies for you, or it can search for libraries
that are already installed on your system and use them to build gRPC.
This behavior is controlled by the `gRPC_<depname>_PROVIDER` CMake variables,
e.g. `gRPC_CARES_PROVIDER`. The options that these variables take are as follows:
* module - build dependencies alongside gRPC. The source code is obtained from
gRPC's git submodules.
* package - use external copies of dependencies that are already available
on your system. These could come from your system package manager, or perhaps
you pre-installed them using CMake with the `CMAKE_INSTALL_PREFIX` option.
For example, if you set `gRPC_CARES_PROVIDER=module`, then CMake will build
c-ares before building gRPC. On the other hand, if you set
`gRPC_CARES_PROVIDER=package`, then CMake will search for a copy of c-ares
that's already installed on your system and use it to build gRPC.
### Install after build
Perform the following steps to install gRPC using CMake.
* Set `-DgRPC_INSTALL=ON`
* Build the `install` target
The install destination is controlled by the
[`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) variable.
If you are running CMake v3.13 or newer you can build gRPC's dependencies
in "module" mode and install them alongside gRPC in a single step.
[Example](test/distrib/cpp/run_distrib_test_cmake_module_install.sh)
If you are building gRPC < 1.27 or if you are using CMake < 3.13 you will need
to select "package" mode (rather than "module" mode) for the dependencies.
This means you will need to have external copies of these libraries available
on your system. This [example](test/distrib/cpp/run_distrib_test_cmake.sh) shows
how to install dependencies with cmake before proceeding to installing gRPC itself.
```
# NOTE: all of gRPC's dependencies need to be already installed
$ cmake ../.. -DgRPC_INSTALL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
$ make
$ make install
```
### Cross-compiling
You can use CMake to cross-compile gRPC for another architecture. In order to
do so, you will first need to build `protoc` and `grpc_cpp_plugin`
for the host architecture. These tools are used during the build of gRPC, so
we need copies of executables that can be run natively.
You will likely need to install the toolchain for the platform you are
targeting for your cross-compile. Once you have done so, you can write a
toolchain file to tell CMake where to find the compilers and system tools
that will be used for this build.
This toolchain file is specified to CMake by setting the `CMAKE_TOOLCHAIN_FILE`
variable.
```
$ cmake ../.. -DCMAKE_TOOLCHAIN_FILE=path/to/file
$ make
```
[Cross-compile example](test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh)
### A note on SONAME and its ABI compatibility implications in the cmake build
Best efforts are made to bump the SONAME revision during ABI breaches. While a
change in the SONAME clearly indicates an ABI incompatibility, no hard guarantees
can be made about any sort of ABI stability across the same SONAME version.
## Building with make on UNIX systems (deprecated)
NOTE: `make` used to be gRPC's default build system, but we're no longer recommending it. You should use `bazel` or `cmake` instead. The `Makefile` is only intended for internal usage and is not meant for public consumption.
From the grpc repository root
```sh
$ make
```
NOTE: if you get an error on linux such as 'aclocal-1.15: command not found', which can happen if you ran 'make' before installing the pre-reqs, try the following:
```sh
$ git clean -f -d -x && git submodule foreach --recursive git clean -f -d -x
$ [sudo] apt-get install build-essential autoconf libtool pkg-config
$ make
```
### A note on `protoc`
By default gRPC uses [protocol buffers](https://github.com/protocolbuffers/protobuf),
you will need the `protoc` compiler to generate stub server and client code.
If you compile gRPC from source, as described above, the Makefile will
automatically try compiling the `protoc` in third_party if you cloned the
repository recursively and it detects that you do not already have 'protoc' compiler
installed.

View File

@ -1,323 +0,0 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import Foundation
let basePath = "third_party/boringssl-with-bazel"
let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy"
let testPath = "test/boringssl_spm_build"
let package = Package(
name: "BoringSSL-GRPC",
products: [
.library(
name: "openssl_grpc",
targets: ["openssl_grpc"]
)
],
targets: [
.target(
name: "openssl_grpc",
path: basePath,
exclude: [
],
sources: [
"src/crypto/asn1/a_bitstr.c",
"src/crypto/asn1/a_bool.c",
"src/crypto/asn1/a_d2i_fp.c",
"src/crypto/asn1/a_dup.c",
"src/crypto/asn1/a_gentm.c",
"src/crypto/asn1/a_i2d_fp.c",
"src/crypto/asn1/a_int.c",
"src/crypto/asn1/a_mbstr.c",
"src/crypto/asn1/a_object.c",
"src/crypto/asn1/a_octet.c",
"src/crypto/asn1/a_strex.c",
"src/crypto/asn1/a_strnid.c",
"src/crypto/asn1/a_time.c",
"src/crypto/asn1/a_type.c",
"src/crypto/asn1/a_utctm.c",
"src/crypto/asn1/asn1_lib.c",
"src/crypto/asn1/asn1_par.c",
"src/crypto/asn1/asn_pack.c",
"src/crypto/asn1/f_int.c",
"src/crypto/asn1/f_string.c",
"src/crypto/asn1/posix_time.c",
"src/crypto/asn1/tasn_dec.c",
"src/crypto/asn1/tasn_enc.c",
"src/crypto/asn1/tasn_fre.c",
"src/crypto/asn1/tasn_new.c",
"src/crypto/asn1/tasn_typ.c",
"src/crypto/asn1/tasn_utl.c",
"src/crypto/base64/base64.c",
"src/crypto/bio/bio.c",
"src/crypto/bio/bio_mem.c",
"src/crypto/bio/connect.c",
"src/crypto/bio/errno.c",
"src/crypto/bio/fd.c",
"src/crypto/bio/file.c",
"src/crypto/bio/hexdump.c",
"src/crypto/bio/pair.c",
"src/crypto/bio/printf.c",
"src/crypto/bio/socket.c",
"src/crypto/bio/socket_helper.c",
"src/crypto/blake2/blake2.c",
"src/crypto/bn_extra/bn_asn1.c",
"src/crypto/bn_extra/convert.c",
"src/crypto/buf/buf.c",
"src/crypto/bytestring/asn1_compat.c",
"src/crypto/bytestring/ber.c",
"src/crypto/bytestring/cbb.c",
"src/crypto/bytestring/cbs.c",
"src/crypto/bytestring/unicode.c",
"src/crypto/chacha/chacha.c",
"src/crypto/cipher_extra/cipher_extra.c",
"src/crypto/cipher_extra/derive_key.c",
"src/crypto/cipher_extra/e_aesctrhmac.c",
"src/crypto/cipher_extra/e_aesgcmsiv.c",
"src/crypto/cipher_extra/e_chacha20poly1305.c",
"src/crypto/cipher_extra/e_des.c",
"src/crypto/cipher_extra/e_null.c",
"src/crypto/cipher_extra/e_rc2.c",
"src/crypto/cipher_extra/e_rc4.c",
"src/crypto/cipher_extra/e_tls.c",
"src/crypto/cipher_extra/tls_cbc.c",
"src/crypto/conf/conf.c",
"src/crypto/cpu_aarch64_apple.c",
"src/crypto/cpu_aarch64_fuchsia.c",
"src/crypto/cpu_aarch64_linux.c",
"src/crypto/cpu_aarch64_openbsd.c",
"src/crypto/cpu_aarch64_sysreg.c",
"src/crypto/cpu_aarch64_win.c",
"src/crypto/cpu_arm_freebsd.c",
"src/crypto/cpu_arm_linux.c",
"src/crypto/cpu_intel.c",
"src/crypto/crypto.c",
"src/crypto/curve25519/curve25519.c",
"src/crypto/curve25519/curve25519_64_adx.c",
"src/crypto/curve25519/spake25519.c",
"src/crypto/des/des.c",
"src/crypto/dh_extra/dh_asn1.c",
"src/crypto/dh_extra/params.c",
"src/crypto/digest_extra/digest_extra.c",
"src/crypto/dilithium/dilithium.c",
"src/crypto/dsa/dsa.c",
"src/crypto/dsa/dsa_asn1.c",
"src/crypto/ec_extra/ec_asn1.c",
"src/crypto/ec_extra/ec_derive.c",
"src/crypto/ec_extra/hash_to_curve.c",
"src/crypto/ecdh_extra/ecdh_extra.c",
"src/crypto/ecdsa_extra/ecdsa_asn1.c",
"src/crypto/engine/engine.c",
"src/crypto/err/err.c",
"src/crypto/evp/evp.c",
"src/crypto/evp/evp_asn1.c",
"src/crypto/evp/evp_ctx.c",
"src/crypto/evp/p_dh.c",
"src/crypto/evp/p_dh_asn1.c",
"src/crypto/evp/p_dsa_asn1.c",
"src/crypto/evp/p_ec.c",
"src/crypto/evp/p_ec_asn1.c",
"src/crypto/evp/p_ed25519.c",
"src/crypto/evp/p_ed25519_asn1.c",
"src/crypto/evp/p_hkdf.c",
"src/crypto/evp/p_rsa.c",
"src/crypto/evp/p_rsa_asn1.c",
"src/crypto/evp/p_x25519.c",
"src/crypto/evp/p_x25519_asn1.c",
"src/crypto/evp/pbkdf.c",
"src/crypto/evp/print.c",
"src/crypto/evp/scrypt.c",
"src/crypto/evp/sign.c",
"src/crypto/ex_data.c",
"src/crypto/fipsmodule/bcm.c",
"src/crypto/fipsmodule/fips_shared_support.c",
"src/crypto/hpke/hpke.c",
"src/crypto/hrss/hrss.c",
"src/crypto/keccak/keccak.c",
"src/crypto/kyber/kyber.c",
"src/crypto/lhash/lhash.c",
"src/crypto/mem.c",
"src/crypto/obj/obj.c",
"src/crypto/obj/obj_xref.c",
"src/crypto/pem/pem_all.c",
"src/crypto/pem/pem_info.c",
"src/crypto/pem/pem_lib.c",
"src/crypto/pem/pem_oth.c",
"src/crypto/pem/pem_pk8.c",
"src/crypto/pem/pem_pkey.c",
"src/crypto/pem/pem_x509.c",
"src/crypto/pem/pem_xaux.c",
"src/crypto/pkcs7/pkcs7.c",
"src/crypto/pkcs7/pkcs7_x509.c",
"src/crypto/pkcs8/p5_pbev2.c",
"src/crypto/pkcs8/pkcs8.c",
"src/crypto/pkcs8/pkcs8_x509.c",
"src/crypto/poly1305/poly1305.c",
"src/crypto/poly1305/poly1305_arm.c",
"src/crypto/poly1305/poly1305_vec.c",
"src/crypto/pool/pool.c",
"src/crypto/rand_extra/deterministic.c",
"src/crypto/rand_extra/forkunsafe.c",
"src/crypto/rand_extra/getentropy.c",
"src/crypto/rand_extra/ios.c",
"src/crypto/rand_extra/passive.c",
"src/crypto/rand_extra/rand_extra.c",
"src/crypto/rand_extra/trusty.c",
"src/crypto/rand_extra/windows.c",
"src/crypto/rc4/rc4.c",
"src/crypto/refcount.c",
"src/crypto/rsa_extra/rsa_asn1.c",
"src/crypto/rsa_extra/rsa_crypt.c",
"src/crypto/rsa_extra/rsa_print.c",
"src/crypto/siphash/siphash.c",
"src/crypto/spx/address.c",
"src/crypto/spx/fors.c",
"src/crypto/spx/merkle.c",
"src/crypto/spx/spx.c",
"src/crypto/spx/spx_util.c",
"src/crypto/spx/thash.c",
"src/crypto/spx/wots.c",
"src/crypto/stack/stack.c",
"src/crypto/thread.c",
"src/crypto/thread_none.c",
"src/crypto/thread_pthread.c",
"src/crypto/thread_win.c",
"src/crypto/trust_token/pmbtoken.c",
"src/crypto/trust_token/trust_token.c",
"src/crypto/trust_token/voprf.c",
"src/crypto/x509/a_digest.c",
"src/crypto/x509/a_sign.c",
"src/crypto/x509/a_verify.c",
"src/crypto/x509/algorithm.c",
"src/crypto/x509/asn1_gen.c",
"src/crypto/x509/by_dir.c",
"src/crypto/x509/by_file.c",
"src/crypto/x509/i2d_pr.c",
"src/crypto/x509/name_print.c",
"src/crypto/x509/policy.c",
"src/crypto/x509/rsa_pss.c",
"src/crypto/x509/t_crl.c",
"src/crypto/x509/t_req.c",
"src/crypto/x509/t_x509.c",
"src/crypto/x509/t_x509a.c",
"src/crypto/x509/v3_akey.c",
"src/crypto/x509/v3_akeya.c",
"src/crypto/x509/v3_alt.c",
"src/crypto/x509/v3_bcons.c",
"src/crypto/x509/v3_bitst.c",
"src/crypto/x509/v3_conf.c",
"src/crypto/x509/v3_cpols.c",
"src/crypto/x509/v3_crld.c",
"src/crypto/x509/v3_enum.c",
"src/crypto/x509/v3_extku.c",
"src/crypto/x509/v3_genn.c",
"src/crypto/x509/v3_ia5.c",
"src/crypto/x509/v3_info.c",
"src/crypto/x509/v3_int.c",
"src/crypto/x509/v3_lib.c",
"src/crypto/x509/v3_ncons.c",
"src/crypto/x509/v3_ocsp.c",
"src/crypto/x509/v3_pcons.c",
"src/crypto/x509/v3_pmaps.c",
"src/crypto/x509/v3_prn.c",
"src/crypto/x509/v3_purp.c",
"src/crypto/x509/v3_skey.c",
"src/crypto/x509/v3_utl.c",
"src/crypto/x509/x509.c",
"src/crypto/x509/x509_att.c",
"src/crypto/x509/x509_cmp.c",
"src/crypto/x509/x509_d2.c",
"src/crypto/x509/x509_def.c",
"src/crypto/x509/x509_ext.c",
"src/crypto/x509/x509_lu.c",
"src/crypto/x509/x509_obj.c",
"src/crypto/x509/x509_req.c",
"src/crypto/x509/x509_set.c",
"src/crypto/x509/x509_trs.c",
"src/crypto/x509/x509_txt.c",
"src/crypto/x509/x509_v3.c",
"src/crypto/x509/x509_vfy.c",
"src/crypto/x509/x509_vpm.c",
"src/crypto/x509/x509cset.c",
"src/crypto/x509/x509name.c",
"src/crypto/x509/x509rset.c",
"src/crypto/x509/x509spki.c",
"src/crypto/x509/x_algor.c",
"src/crypto/x509/x_all.c",
"src/crypto/x509/x_attrib.c",
"src/crypto/x509/x_crl.c",
"src/crypto/x509/x_exten.c",
"src/crypto/x509/x_name.c",
"src/crypto/x509/x_pubkey.c",
"src/crypto/x509/x_req.c",
"src/crypto/x509/x_sig.c",
"src/crypto/x509/x_spki.c",
"src/crypto/x509/x_val.c",
"src/crypto/x509/x_x509.c",
"src/crypto/x509/x_x509a.c",
"src/gen/crypto/err_data.c",
"src/ssl/bio_ssl.cc",
"src/ssl/d1_both.cc",
"src/ssl/d1_lib.cc",
"src/ssl/d1_pkt.cc",
"src/ssl/d1_srtp.cc",
"src/ssl/dtls_method.cc",
"src/ssl/dtls_record.cc",
"src/ssl/encrypted_client_hello.cc",
"src/ssl/extensions.cc",
"src/ssl/handoff.cc",
"src/ssl/handshake.cc",
"src/ssl/handshake_client.cc",
"src/ssl/handshake_server.cc",
"src/ssl/s3_both.cc",
"src/ssl/s3_lib.cc",
"src/ssl/s3_pkt.cc",
"src/ssl/ssl_aead_ctx.cc",
"src/ssl/ssl_asn1.cc",
"src/ssl/ssl_buffer.cc",
"src/ssl/ssl_cert.cc",
"src/ssl/ssl_cipher.cc",
"src/ssl/ssl_credential.cc",
"src/ssl/ssl_file.cc",
"src/ssl/ssl_key_share.cc",
"src/ssl/ssl_lib.cc",
"src/ssl/ssl_privkey.cc",
"src/ssl/ssl_session.cc",
"src/ssl/ssl_stat.cc",
"src/ssl/ssl_transcript.cc",
"src/ssl/ssl_versions.cc",
"src/ssl/ssl_x509.cc",
"src/ssl/t1_enc.cc",
"src/ssl/tls13_both.cc",
"src/ssl/tls13_client.cc",
"src/ssl/tls13_enc.cc",
"src/ssl/tls13_server.cc",
"src/ssl/tls_method.cc",
"src/ssl/tls_record.cc",
],
resources: [
.copy(privacyInfoPath),
],
publicHeadersPath: "src/include",
cSettings: [
.define("OPENSSL_NO_ASM", to: "1"),
.headerSearchPath("./"),
.headerSearchPath("include/"),
]
),
.testTarget(
name: "build-test",
dependencies: [
"openssl_grpc",
],
path: testPath
),
],
cxxLanguageStandard: .cxx14
)

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
## Community Code of Conduct
gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@ -1,64 +0,0 @@
# gRPC Concepts Overview
Remote Procedure Calls (RPCs) provide a useful abstraction for building
distributed applications and services. The libraries in this repository
provide a concrete implementation of the gRPC protocol, layered over HTTP/2.
These libraries enable communication between clients and servers using any
combination of the supported languages.
## Interface
Developers using gRPC start with a language agnostic description of an RPC service (a collection
of methods). From this description, gRPC will generate client and server side interfaces
in any of the supported languages. The server implements
the service interface, which can be remotely invoked by the client interface.
By default, gRPC uses [Protocol Buffers](https://github.com/protocolbuffers/protobuf) as the
Interface Definition Language (IDL) for describing both the service interface
and the structure of the payload messages. It is possible to use other
alternatives if desired.
### Invoking & handling remote calls
Starting from an interface definition in a .proto file, gRPC provides
Protocol Compiler plugins that generate Client- and Server-side APIs.
gRPC users call into these APIs on the Client side and implement
the corresponding API on the server side.
#### Synchronous vs. asynchronous
Synchronous RPC calls, that block until a response arrives from the server, are
the closest approximation to the abstraction of a procedure call that RPC
aspires to.
On the other hand, networks are inherently asynchronous and in many scenarios,
it is desirable to have the ability to start RPCs without blocking the current
thread.
The gRPC programming surface in most languages comes in both synchronous and
asynchronous flavors.
## Streaming
gRPC supports streaming semantics, where either the client or the server (or both)
send a stream of messages on a single RPC call. The most general case is
Bidirectional Streaming where a single gRPC call establishes a stream in which both
the client and the server can send a stream of messages to each other. The streamed
messages are delivered in the order they were sent.
# Protocol
The [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between
clients and servers. A concrete embedding over HTTP/2 completes the picture by
fleshing out the details of each of the required operations.
## Abstract gRPC protocol
A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. A client signals end of its message stream by means of an underlying lower level protocol. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
## Implementation over HTTP/2
The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers). A client signals end of its message stream by setting `END_STREAM` flag on the last DATA frame.
For a detailed description see [doc/PROTOCOL-HTTP2.md](doc/PROTOCOL-HTTP2.md).
## Flow Control
gRPC uses the flow control mechanism in HTTP/2. This enables fine-grained control of memory used for buffering in-flight messages.

View File

@ -1,134 +0,0 @@
# How to contribute
We definitely welcome your patches and contributions to gRPC! Please read the gRPC
organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md)
and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding.
If you are new to github, please start by reading [Pull Request
howto](https://help.github.com/articles/about-pull-requests/)
If you are looking for features to work on, please filter the issues list with the label ["disposition/help wanted"](https://github.com/grpc/grpc/issues?q=label%3A%22disposition%2Fhelp+wanted%22).
Please note that some of these feature requests might have been closed in the past as a result of them being marked as stale due to there being no activity, but these are still valid feature requests.
## Legal requirements
In order to protect both you and ourselves, you will need to sign the
[Contributor License
Agreement](https://identity.linuxfoundation.org/projects/cncf).
## Cloning the repository
Before starting any development work you will need a local copy of the gRPC repository.
Please follow the instructions in [Building gRPC C++: Clone the repository](BUILDING.md#clone-the-repository-including-submodules).
## Building & Running tests
Different languages use different build systems. To hide the complexity
of needing to build with many different build systems, a portable python
script that unifies the experience of building and testing gRPC in different
languages and on different platforms is provided.
To build gRPC in the language of choice (e.g. `c++`, `csharp`, `php`, `python`, `ruby`, ...)
- Prepare your development environment based on language-specific instructions in `src/YOUR-LANGUAGE` directory.
- The language-specific instructions might involve installing C/C++ prerequisites listed in
[Building gRPC C++: Prerequisites](BUILDING.md#pre-requisites). This is because gRPC implementations
in this repository are using the native gRPC "core" library internally.
- Run
```
python tools/run_tests/run_tests.py -l YOUR_LANGUAGE --build_only
```
- To also run all the unit tests after building
```
python tools/run_tests/run_tests.py -l YOUR_LANGUAGE
```
You can also run `python tools/run_tests/run_tests.py --help` to discover useful command line flags supported. For more details,
see [tools/run_tests](tools/run_tests) where you will also find guidance on how to run various other test suites (e.g. interop tests, benchmarks).
## Generated project files
To ease maintenance of language- and platform- specific build systems, many
projects files are generated using templates and should not be edited by hand.
Run `tools/buildgen/generate_projects.sh` to regenerate. See
[templates](templates) for details.
As a rule of thumb, if you see the "sanity tests" failing you've most likely
edited generated files or you didn't regenerate the projects properly (or your
code formatting doesn't match our code style).
## Guidelines for Pull Requests
How to get your contributions merged smoothly and quickly.
- Create **small PRs** that are narrowly focused on **addressing a single
concern**. We often times receive PRs that are trying to fix several things
at a time, but only one fix is considered acceptable, nothing gets merged and
both author's & review's time is wasted. Create more PRs to address different
concerns and everyone will be happy.
- For speculative changes, consider opening an issue and discussing it first.
If you are suggesting a behavioral or API change, consider starting with a
[gRFC proposal](https://github.com/grpc/proposal).
- Provide a good **PR description** as a record of **what** change is being made
and **why** it was made. Link to a GitHub issue if it exists.
- Don't fix code style and formatting unless you are already changing that line
to address an issue. PRs with irrelevant changes won't be merged. If you do
want to fix formatting or style, do that in a separate PR.
- If you are adding a new file, make sure it has the copyright message template
at the top as a comment. You can copy over the message from an existing file
and update the year.
- Unless your PR is trivial, you should expect there will be reviewer comments
that you'll need to address before merging. We expect you to be reasonably
responsive to those comments, otherwise the PR will be closed after 2-3 weeks
of inactivity.
- If you have non-trivial contributions, please consider adding an entry to [the
AUTHORS file](https://github.com/grpc/grpc/blob/master/AUTHORS) listing the
copyright holder for the contribution (yourself, if you are signing the
individual CLA, or your company, for corporate CLAs) in the same PR as your
contribution. This needs to be done only once, for each company, or
individual. Please keep this file in alphabetical order.
- Maintain **clean commit history** and use **meaningful commit messages**.
PRs with messy commit history are difficult to review and won't be merged.
Use `rebase -i upstream/master` to curate your commit history and/or to
bring in latest changes from master (but avoid rebasing in the middle of
a code review).
- Keep your PR up to date with upstream/master (if there are merge conflicts,
we can't really merge your change).
- If you are regenerating the projects using
`tools/buildgen/generate_projects.sh`, make changes to generated files a
separate commit with commit message `regenerate projects`. Mixing changes
to generated and hand-written files make your PR difficult to review.
Note that running this script requires the installation of Python packages
`pyyaml` and `mako` (typically installed using `pip`) as well as a recent
version of [`go`](https://golang.org/doc/install#install).
- **All tests need to be passing** before your change can be merged.
We recommend you **run tests locally** before creating your PR to catch
breakages early on (see [tools/run_tests](tools/run_tests). Ultimately, the
green signal will be provided by our testing infrastructure. The reviewer
will help you if there are test failures that seem not related to the change
you are making.
- Exceptions to the rules can be made if there's a compelling reason for doing
so.
## Obtaining Commit Access
We grant Commit Access to contributors based on the following criteria:
* Sustained contribution to the gRPC project.
* Deep understanding of the areas contributed to, and good consideration of various reliability, usability and performance tradeoffs.
* Contributions demonstrate that obtaining Commit Access will significantly reduce friction for the contributors or others.
In addition to submitting PRs, a Contributor with Commit Access can:
* Review PRs and merge once other checks and criteria pass.
* Triage bugs and PRs and assign appropriate labels and reviewers.
### Obtaining Commit Access without Code Contributions
The [gRPC organization](https://github.com/grpc) is comprised of multiple repositories and commit access is usually restricted to one or more of these repositories. Some repositories such as the [grpc.github.io](https://github.com/grpc/grpc.github.io/) do not have code, but the same principle of sustained, high quality contributions, with a good understanding of the fundamentals, apply.

View File

@ -1,137 +0,0 @@
# Contributing to gRPC: A Step-By-Step Guide
Note: This document is not meant for Google employees.
## Prerequisites
To contribute to the gRPC codebase, you need the following:
1. An
[active GitHub account](https://docs.github.com/en/get-started/quickstart/creating-an-account-on-github)
1. [An understanding of Git and GitHub](https://docs.github.com/en/get-started/using-git/about-git)
1. [Knowledge of how to fork a repository, clone a repository, merge, rebase,
resolve, push, pull, fetch
etc.](https://docs.github.com/en/get-started/using-git/about-git)
1. [git installed and working on your machine](https://github.com/git-guides/install-git)
1. Knowledge of the language being used, which can be C++, Python, Ruby,
Objective-C, PHP, or C#.
## Steps to Contribute gRPC C++ Code
The GitHub repository for the C-based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
is at https://github.com/grpc/grpc.
### Fork and Clone the Repository
If you want to contribute to the gRPC code base, you need to make a fork of the
repository.
1. Create your
[own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
from https://github.com/grpc/grpc.
![Screenshot of creating fork using a non-google account.](doc/images/img/grpc-create-fork.png)
1. [Clone your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#cloning-your-forked-repository)
on your local machine.
### Prepare and Push Your Commit
1. In your cloned repository, create a new branch from `master`.
1. Then prepare a commit for the files that you want to contribute.
1. Commit to this branch.
1. Push the commit to your fork on GitHub.
Take care that your commits are aligned with these
[guidelines](https://github.com/grpc/grpc/blob/master/CONTRIBUTING.md#guidelines-for-pull-requests).
### Prepare a Pull Request
After pushing your commit, visit https://github.com/grpc/grpc . If the
forking, branch creation, commit and push have been successful, you will see
the following message:
![Screenshot of Github UI to help to create a pull request.](doc/images/img/grpc-compare-and-pull-request.png)
Take care to allow edits by maintainers. If there is a specific issue
with your pull request, the maintainer can help if needed. This access to help will reduce
the turnaround time for your submission.
![Screenshot of Github UI to help to create a Pull Request.](doc/images/img/grpc-pull-request-details.png)
Create a pull request.
### Pull Request Status - Safe Review
Once the pull request is ready, you must wait for a reviewer to be
assigned to your pull request.
If you see *Not Covered* in the EasyCLA screen, as shown in the following image,
click on the mentioned link to start the authorization process.
![Screenshot of waiting for safe review](doc/images/img/grpc-tests.png)
You will see a series of screens:
1. Select *Authorize LF-Engineering:
![Screenshot of EasyCLA Step 1](doc/images/img/grpc-easycla-authorize.png)
1. Select your contributor type:
![Screenshot of EasyCLA Step 2](doc/images/img/grpc-contributor-type.png)
1. Select *SIGN CLA*:
![Screenshot of EasyCLA Step 3](doc/images/img/grpc-sign-cla.png)
Some time after you've digitally signed the document, the EasyCLA will appear as
*Covered*.
![Screenshot of EasyCLA Step 5](doc/images/img/grpc-easycla-covered.png)
After a few hours, you will notice a new "assignee" assigned to the pull request.
![Screenshot after an assignee is added](doc/images/img/grpc-assignee.png)
After a reviewer is assigned to you, they will help with the next
steps, which are as follows:
1. You complete the code review and address the comments.
1. Your reviewer may add a few labels as needed.
### Pull Request Status - Green
Once you have approval from the reviewer, check if the tests are running. After
the tests are complete, look at the status of all the tests. If
everything is green, everything is good. But usually some failures exist. If
there are failures, select each failure. The selection will take you to a page
that has error details. Try to fix the issue.
### Pull Request Approval
For pull requests that are non-trivial, there is a thorough code review process.
You can read more about the process and requirements
[here](https://github.com/grpc/grpc/blob/master/CONTRIBUTING.md#guidelines-for-pull-requests).
After you fix the code review, you will finally get an approval. After getting
approval, you can submit the pull request.
![Pull request approved and labelled](doc/images/img/grpc-review-complete.png)
### Submission
You **cannot** do submission or merge of a pull request through Github.
![Pull request approved and labelled](doc/images/img/grpc-wait-for-merge.png)
After you have approval from a reviewer, a Google employee will trigger
the submission process. When the submission happens:
1. A commit with your changes, along with a few additional formatting changes, will
be committed to the `grpc/master` branch.
![Copybara commit](doc/images/img/grpc-copybara-commit.png)
1. The pull request you originally created will be closed.
![Pull request closed by copybara](doc/images/img/grpc-pr-closed-by-copybara.png)

View File

@ -1 +0,0 @@
This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md).

View File

@ -1,4 +0,0 @@
source 'https://rubygems.org'
# Specify your gem's dependencies in grpc.gemspec
gemspec

610
LICENSE
View File

@ -1,610 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------
BSD 3-Clause License
Copyright 2016, Google Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@ -1,96 +0,0 @@
This page lists all active maintainers of this repository. If you were a
maintainer and would like to add your name to the Emeritus list, please send us a
PR.
See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md)
for governance guidelines and how to become a maintainer.
See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md)
for general contribution guidelines.
## Maintainers (in alphabetical order)
<!-- go/keep-sorted start case=no -->
- [a11r](https://github.com/a11r), Google LLC
- [apolcyn](https://github.com/apolcyn), Google LLC
- [arjunroy](https://github.com/arjunroy), Google LLC
- [ctiller](https://github.com/ctiller), Google LLC
- [daniel-j-born](https://github.com/daniel-j-born), Google LLC
- [dfawley](https://github.com/dfawley), Google LLC
- [dklempner](https://github.com/dklempner), Google LLC
- [drfloob](https://github.com/drfloob), Google LLC
- [ejona86](https://github.com/ejona86), Google LLC
- [gnossen](https://github.com/gnossen), Google LLC
- [guantaol](https://github.com/guantaol), Google LLC
- [hcaseyal](https://github.com/hcaseyal), Google LLC
- [jtattermusch](https://github.com/jtattermusch), Google LLC
- [kevinnilson](https://github.com/kevinnilson), Google LLC
- [LittleCVR](https://github.com/littlecvr), Google LLC
- [markdroth](https://github.com/markdroth), Google LLC
- [matthewstevenson88](https://github.com/matthewstevenson88), Google LLC
- [murgatroid99](https://github.com/murgatroid99), Google LLC
- [nanahpang](https://github.com/nanahpang), Google LLC
- [pfreixes](https://github.com/pfreixes), Skyscanner Ltd
- [ran-su](https://github.com/ran-su), Google LLC
- [sanjaypujare](https://github.com/sanjaypujare), Google LLC
- [sastryvp](https://github.com/sastryvp), Google LLC
- [sergiitk](https://github.com/sergiitk), Google LLC
- [soheilhy](https://github.com/soheilhy), Google LLC
- [stanley-cheung](https://github.com/stanley-cheung), Google LLC
- [thisisnotapril](https://github.com/thisisnotapril), Google LLC
- [tjagtap](https://github.com/tjagtap), Google LLC
- [veblush](https://github.com/veblush), Google LLC
- [vishalpowar](https://github.com/vishalpowar), Google LLC
- [wenbozhu](https://github.com/wenbozhu), Google LLC
- [yashykt](https://github.com/yashykt), Google LLC
- [yijiem](https://github.com/yijiem), Google LLC
- [ZhouyihaiDing](https://github.com/ZhouyihaiDing), Google LLC
<!-- go/keep-sorted end -->
## Emeritus Maintainers (in alphabetical order)
<!-- go/keep-sorted start case=no -->
- [adelez](https://github.com/adelez), Google LLC
- [AspirinSJL](https://github.com/AspirinSJL), Google LLC
- [billfeng327](https://github.com/billfeng327), Google LLC
- [bogdandrutu](https://github.com/bogdandrutu), Google LLC
- [dapengzhang0](https://github.com/dapengzhang0), Google LLC
- [dgquintas](https://github.com/dgquintas), Google LLC
- [ericgribkoff](https://github.com/ericgribkoff), Google LLC
- [fengli79](https://github.com/fengli79), Google LLC
- [jboeuf](https://github.com/jboeuf), Google LLC
- [jcanizales](https://github.com/jcanizales), Google LLC
- [jiangtaoli2016](https://github.com/jiangtaoli2016), Google LLC
- [jkolhe](https://github.com/jkolhe), Google LLC
- [jpalmerLinuxFoundation](https://github.com/jpalmerLinuxFoundation), Linux Foundation
- [justinburke](https://github.com/justinburke), Google LLC
- [karthikravis](https://github.com/karthikravis), Google LLC
- [kpayson64](https://github.com/kpayson64), Google LLC
- [kumaralokgithub](https://github.com/kumaralokgithub), Google LLC
- [lidizheng](https://github.com/lidizheng), Google LLC
- [lyuxuan](https://github.com/lyuxuan), Google LLC
- [matt-kwong](https://github.com/matt-kwong), Google LLC
- [medinandres](https://github.com/medinandres), Google LLC
- [mehrdada](https://github.com/mehrdada), Dropbox, Inc.
- [mhaidrygoog](https://github.com/mhaidrygoog), Google LLC
- [mit-mit](https://github.com/mit-mit), Google LLC
- [mpwarres](https://github.com/mpwarres), Google LLC
- [muxi](https://github.com/muxi), Google LLC
- [nathanielmanistaatgoogle](https://github.com/nathanielmanistaatgoogle), Google LLC
- [ncteisen](https://github.com/ncteisen), Google LLC
- [nicolasnoble](https://github.com/nicolasnoble), Google LLC
- [pmarks-net](https://github.com/pmarks-net), Google LLC
- [qixuanl1](https://github.com/qixuanl1), Google LLC
- [rmstar](https://github.com/rmstar), Google LLC
- [sheenaqotj](https://github.com/sheenaqotj), Google LLC
- [slash-lib](https://github.com/slash-lib), Google LLC
- [soltanmm](https://github.com/soltanmm), Google LLC
- [sreecha](https://github.com/sreecha), LinkedIn
- [srini100](https://github.com/srini100), Google LLC
- [summerxyt](https://github.com/summerxyt), Google LLC
- [vjpai](https://github.com/vjpai), Google LLC
- [Vizerai](https://github.com/Vizerai), Google LLC
- [wcevans](https://github.com/wcevans), Google LLC
- [y-zeng](https://github.com/y-zeng), Google LLC
- [yang-g](https://github.com/yang-g), Google LLC
- [yihuazhang](https://github.com/yihuazhang), Google LLC
- [zpencer](https://github.com/zpencer), Google LLC
- [ZhenLian](https://github.com/ZhenLian), Google LLC
<!-- go/keep-sorted end -->

View File

@ -1,23 +0,0 @@
# Top-level Items by language
## Bazel
* [grpc.bzl](grpc.bzl)
## Objective-C
* [gRPC.podspec](gRPC.podspec)
## PHP
* [composer.json](composer.json)
* [config.m4](config.m4)
* [package.xml](package.xml)
## Python
* [requirements.txt](requirements.txt)
* [setup.cfg](setup.cfg)
* [setup.py](setup.py)
* [PYTHON-MANIFEST.in](PYTHON-MANIFEST.in)
## Ruby
* [Gemfile](Gemfile)
* [grpc.gemspec](grpc.gemspec)
* [Rakefile](Rakefile)

2291
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
Copyright 2014 gRPC authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,28 +0,0 @@
recursive-include src/python/grpcio/grpc *.c *.h *.inc *.py *.pyx *.pxd *.pxi *.python *.pem
recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd
graft src/python/grpcio/grpcio.egg-info
graft src/core
graft src/boringssl
graft include/grpc
graft third_party/abseil-cpp/absl
graft third_party/address_sorting
graft third_party/boringssl-with-bazel
graft third_party/cares
graft third_party/re2
graft third_party/upb
graft third_party/utf8_range
graft third_party/xxhash
graft third_party/zlib
include src/python/grpcio/_parallel_compile_patch.py
include src/python/grpcio/_spawn_patch.py
include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py
include src/python/grpcio/grpc_core_dependencies.py
include src/python/grpcio/precompiled.py
include src/python/grpcio/support.py
include src/python/grpcio/README.rst
include requirements.txt
include etc/roots.pem
include Makefile
include LICENSE
include _metadata.py

File diff suppressed because it is too large Load Diff

104
README.md
View File

@ -1,104 +0,0 @@
# gRPC An RPC library and framework
gRPC is a modern, open source, high-performance remote procedure call (RPC)
framework that can run anywhere. gRPC enables client and server applications to
communicate transparently, and simplifies the building of connected systems.
<table>
<tr>
<td><b>Homepage:</b></td>
<td><a href="https://grpc.io/">grpc.io</a></td>
</tr>
<tr>
<td><b>Mailing List:</b></td>
<td><a href="https://groups.google.com/forum/#!forum/grpc-io">grpc-io@googlegroups.com</a></td>
</tr>
</table>
[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## To start using gRPC
To maximize usability, gRPC supports the standard method for adding dependencies
to a user's chosen language (if there is one). In most languages, the gRPC
runtime comes as a package available in a user's language package manager.
For instructions on how to use the language-specific gRPC runtime for a project,
please refer to these documents
- [C++](src/cpp): follow the instructions under the `src/cpp` directory
- [C#/.NET](https://github.com/grpc/grpc-dotnet): NuGet packages
`Grpc.Net.Client`, `Grpc.AspNetCore.Server`
- [Dart](https://github.com/grpc/grpc-dart): pub package `grpc`
- [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
- [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central
Repository
- [Kotlin](https://github.com/grpc/grpc-kotlin): Use JARs from Maven Central
Repository
- [Node](https://github.com/grpc/grpc-node): `npm install @grpc/grpc-js`
- [Objective-C](src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec
- [PHP](src/php): `pecl install grpc`
- [Python](src/python/grpcio): `pip install grpcio`
- [Ruby](src/ruby): `gem install grpc`
- [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions
Per-language quickstart guides and tutorials can be found in the
[documentation section on the grpc.io website](https://grpc.io/docs/). Code
examples are available in the [examples](examples) directory.
Precompiled bleeding-edge package builds of gRPC `master` branch's `HEAD` are
uploaded daily to [packages.grpc.io](https://packages.grpc.io).
## To start developing gRPC
Contributions are welcome!
Please read [How to contribute](CONTRIBUTING.md) which will guide you through
the entire workflow of how to build the source code, how to run the tests, and
how to contribute changes to the gRPC codebase. The "How to contribute" document
also contains info on how the contribution process works and contains best
practices for creating contributions.
## Troubleshooting
Sometimes things go wrong. Please check out the
[Troubleshooting guide](TROUBLESHOOTING.md) if you are experiencing issues with
gRPC.
## Performance
See the [Performance dashboard](https://grafana-dot-grpc-testing.appspot.com/)
for performance numbers of master branch daily builds.
## Concepts
See [gRPC Concepts](CONCEPTS.md)
## About This Repository
This repository contains source code for gRPC libraries implemented in multiple
languages written on top of a shared C++ core library [src/core](src/core).
Libraries in different languages may be in various states of development. We are
seeking contributions for all of these libraries:
Language | Source
------------------------- | ----------------------------------
Shared C++ [core library] | [src/core](src/core)
C++ | [src/cpp](src/cpp)
Ruby | [src/ruby](src/ruby)
Python | [src/python](src/python)
PHP | [src/php](src/php)
C# (core library based) | [src/csharp](src/csharp)
Objective-C | [src/objective-c](src/objective-c)
Language | Source repo
-------------------- | --------------------------------------------------
Java | [grpc-java](https://github.com/grpc/grpc-java)
Kotlin | [grpc-kotlin](https://github.com/grpc/grpc-kotlin)
Go | [grpc-go](https://github.com/grpc/grpc-go)
NodeJS | [grpc-node](https://github.com/grpc/grpc-node)
WebJS | [grpc-web](https://github.com/grpc/grpc-web)
Dart | [grpc-dart](https://github.com/grpc/grpc-dart)
.NET (pure C# impl.) | [grpc-dotnet](https://github.com/grpc/grpc-dotnet)
Swift | [grpc-swift](https://github.com/grpc/grpc-swift)

247
Rakefile
View File

@ -1,247 +0,0 @@
# -*- ruby -*-
require 'rake/extensiontask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/gem_tasks'
require 'fileutils'
require 'tmpdir'
require_relative 'build_config.rb'
load 'tools/distrib/rake_compiler_docker_image.rb'
# Add rubocop style checking tasks
RuboCop::RakeTask.new(:rubocop) do |task|
task.options = ['-c', 'src/ruby/.rubocop.yml']
# add end2end tests to formatter but don't add generated proto _pb.rb's
task.patterns = ['src/ruby/{lib,spec}/**/*.rb', 'src/ruby/end2end/*.rb']
end
spec = Gem::Specification.load('grpc.gemspec')
Gem::PackageTask.new(spec) do |pkg|
end
# Add the extension compiler task
Rake::ExtensionTask.new('grpc_c', spec) do |ext|
ext.source_pattern = '**/*.{c,h}'
ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc')
ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc')
ext.cross_compile = true
ext.cross_platform = [
'x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt',
'x86_64-linux', 'x86-linux', 'aarch64-linux',
'x86_64-darwin', 'arm64-darwin',
]
ext.cross_compiling do |spec|
spec.files = spec.files.select {
|file| file.start_with?(
"src/ruby/bin/", "src/ruby/ext/", "src/ruby/lib/", "src/ruby/pb/")
}
spec.files += %w( etc/roots.pem grpc_c.32-msvcrt.ruby grpc_c.64-msvcrt.ruby grpc_c.64-ucrt.ruby )
end
end
CLEAN.add "src/ruby/lib/grpc/[0-9].[0-9]", "src/ruby/lib/grpc/grpc_c.{bundle,so}"
# Define the test suites
SPEC_SUITES = [
{ id: :wrapper, title: 'wrapper layer', files: %w(src/ruby/spec/*.rb) },
{ id: :idiomatic, title: 'idiomatic layer', dir: %w(src/ruby/spec/generic),
tags: ['~bidi', '~server'] },
{ id: :bidi, title: 'bidi tests', dir: %w(src/ruby/spec/generic),
tag: 'bidi' },
{ id: :server, title: 'rpc server thread tests', dir: %w(src/ruby/spec/generic),
tag: 'server' },
{ id: :pb, title: 'protobuf service tests', dir: %w(src/ruby/spec/pb) }
]
namespace :suite do
SPEC_SUITES.each do |suite|
desc "Run all specs in the #{suite[:title]} spec suite"
RSpec::Core::RakeTask.new(suite[:id]) do |t|
ENV['COVERAGE_NAME'] = suite[:id].to_s
spec_files = []
suite[:files].each { |f| spec_files += Dir[f] } if suite[:files]
if suite[:dir]
suite[:dir].each { |f| spec_files += Dir["#{f}/**/*_spec.rb"] }
end
helper = 'src/ruby/spec/spec_helper.rb'
spec_files << helper unless spec_files.include?(helper)
t.pattern = spec_files
t.rspec_opts = "--tag #{suite[:tag]}" if suite[:tag]
if suite[:tags]
t.rspec_opts = suite[:tags].map { |x| "--tag #{x}" }.join(' ')
end
end
end
end
desc 'Build the Windows gRPC DLLs for Ruby. The argument contains the list of platforms for which to build dll. Empty placeholder files will be created for platforms that were not selected.'
task 'dlls', [:plat] do |t, args|
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
verbose = ENV['V'] || '0'
# use env variable to set artifact build paralellism
nproc_override = ENV['GRPC_RUBY_BUILD_PROCS'] || `nproc`.strip
plat_list = args[:plat]
build_configs = [
{ cross: 'x86_64-w64-mingw32', out: 'grpc_c.64-ucrt.ruby', platform: 'x64-mingw-ucrt' },
{ cross: 'x86_64-w64-mingw32', out: 'grpc_c.64-msvcrt.ruby', platform: 'x64-mingw32' },
{ cross: 'i686-w64-mingw32', out: 'grpc_c.32-msvcrt.ruby', platform: 'x86-mingw32' }
]
selected_build_configs = []
build_configs.each do |config|
if plat_list.include?(config[:platform])
# build the DLL (as grpc_c.*.ruby)
selected_build_configs.append(config)
else
# create an empty grpc_c.*.ruby file as a placeholder
FileUtils.touch config[:out]
end
end
env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DNTDDI_VERSION=0x06000000 -DUNICODE -D_UNICODE -Wno-unused-variable -Wno-unused-result -DCARES_STATICLIB -Wno-error=conversion -Wno-sign-compare -Wno-parentheses -Wno-format -DWIN32_LEAN_AND_MEAN" '
env += 'CFLAGS="-Wno-incompatible-pointer-types" '
env += 'CXXFLAGS="-std=c++14 -fno-exceptions" '
env += 'LDFLAGS=-static '
env += 'SYSTEM=MINGW32 '
env += 'EMBED_ZLIB=true '
env += 'EMBED_OPENSSL=true '
env += 'BUILDDIR=/tmp '
env += "V=#{verbose} "
env += "GRPC_RUBY_BUILD_PROCS=#{nproc_override} "
out = GrpcBuildConfig::CORE_WINDOWS_DLL
# propagate env variables with ccache configuration to the rake-compiler-dock docker container
# and setup ccache symlinks as needed.
# TODO(jtattermusch): deduplicate creation of prepare_ccache_cmd
prepare_ccache_cmd = "export GRPC_BUILD_ENABLE_CCACHE=\"#{ENV.fetch('GRPC_BUILD_ENABLE_CCACHE', '')}\" && "
prepare_ccache_cmd += "export CCACHE_SECONDARY_STORAGE=\"#{ENV.fetch('CCACHE_SECONDARY_STORAGE', '')}\" && "
prepare_ccache_cmd += "export PATH=\"$PATH:/usr/local/bin\" && "
prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
selected_build_configs.each do |opt|
env_comp = "CC=#{opt[:cross]}-gcc "
env_comp += "CXX=#{opt[:cross]}-g++ "
env_comp += "LD=#{opt[:cross]}-gcc "
env_comp += "LDXX=#{opt[:cross]}-g++ "
run_rake_compiler(opt[:platform], <<~EOT)
#{prepare_ccache_cmd} && \
gem update --system --no-document && \
#{env} #{env_comp} make -j#{nproc_override} #{out} && \
#{opt[:cross]}-strip -x -S #{out} && \
cp #{out} #{opt[:out]}
EOT
end
end
desc 'Build the native gem file under rake_compiler_dock. Optionally one can pass argument to build only native gem for a chosen platform.'
task 'gem:native', [:plat] do |t, args|
verbose = ENV['V'] || '0'
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
ruby_cc_versions = ['3.3.0', '3.2.0', '3.1.0', '3.0.0', '2.7.0'].join(':')
selected_plat = "#{args[:plat]}"
# use env variable to set artifact build paralellism
nproc_override = ENV['GRPC_RUBY_BUILD_PROCS'] || `nproc`.strip
# propagate env variables with ccache configuration to the rake-compiler-dock docker container
# and setup ccache symlinks as needed.
prepare_ccache_cmd = "export GRPC_BUILD_ENABLE_CCACHE=\"#{ENV.fetch('GRPC_BUILD_ENABLE_CCACHE', '')}\" && "
prepare_ccache_cmd += "export CCACHE_SECONDARY_STORAGE=\"#{ENV.fetch('CCACHE_SECONDARY_STORAGE', '')}\" && "
prepare_ccache_cmd += "export PATH=\"$PATH:/usr/local/bin\" && "
prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
supported_windows_platforms = ['x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt']
supported_unix_platforms = ['x86_64-linux', 'x86-linux', 'aarch64-linux', 'x86_64-darwin', 'arm64-darwin']
supported_platforms = supported_windows_platforms + supported_unix_platforms
if selected_plat.empty?
# build everything
windows_platforms = supported_windows_platforms
unix_platforms = supported_unix_platforms
else
# build only selected platform
if supported_windows_platforms.include?(selected_plat)
windows_platforms = [selected_plat]
unix_platforms = []
elsif supported_unix_platforms.include?(selected_plat)
windows_platforms = []
unix_platforms = [selected_plat]
else
fail "Unsupported platform '#{selected_plat}' passed as an argument."
end
end
# Create the windows dlls or create the empty placeholders
Rake::Task['dlls'].execute(plat: windows_platforms)
windows_platforms.each do |plat|
run_rake_compiler(plat, <<~EOT)
#{prepare_ccache_cmd} && \
gem update --system --no-document && \
bundle && \
bundle exec rake clean && \
bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
RUBY_CC_VERSION=#{ruby_cc_versions} \
V=#{verbose} \
GRPC_CONFIG=#{grpc_config} \
GRPC_RUBY_BUILD_PROCS=#{nproc_override}
EOT
end
# Truncate grpc_c.*.ruby files because they're for Windows only and we don't want
# them to take up space in the gems that don't target windows.
File.truncate('grpc_c.32-msvcrt.ruby', 0)
File.truncate('grpc_c.64-msvcrt.ruby', 0)
File.truncate('grpc_c.64-ucrt.ruby', 0)
`mkdir -p src/ruby/nativedebug/symbols`
# TODO(apolcyn): make debug symbols work on apple platforms.
# Currently we hit "objcopy: grpc_c.bundle: file format not recognized"
# TODO(apolcyn): make debug symbols work on aarch64 linux.
# Currently we hit "objcopy: Unable to recognise the format of the input file `grpc_c.so'"
unix_platforms_without_debug_symbols = ['x86_64-darwin', 'arm64-darwin', 'aarch64-linux']
unix_platforms.each do |plat|
if unix_platforms_without_debug_symbols.include?(plat)
debug_symbols_dir = ''
else
debug_symbols_dir = File.join(Dir.pwd, 'src/ruby/nativedebug/symbols')
end
run_rake_compiler(plat, <<~EOT)
#{prepare_ccache_cmd} && \
gem update --system --no-document && \
bundle && \
bundle exec rake clean && \
export GRPC_RUBY_DEBUG_SYMBOLS_OUTPUT_DIR=#{debug_symbols_dir} && \
bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
RUBY_CC_VERSION=#{ruby_cc_versions} \
V=#{verbose} \
GRPC_CONFIG=#{grpc_config} \
GRPC_RUBY_BUILD_PROCS=#{nproc_override}
EOT
end
# Generate debug symbol packages to complement the native libraries we just built
unix_platforms.each do |plat|
unless unix_platforms_without_debug_symbols.include?(plat)
`bash src/ruby/nativedebug/build_package.sh #{plat}`
`cp src/ruby/nativedebug/pkg/*.gem pkg/`
end
end
end
# Define dependencies between the suites.
task 'suite:wrapper' => [:compile, :rubocop]
task 'suite:idiomatic' => 'suite:wrapper'
task 'suite:bidi' => 'suite:wrapper'
task 'suite:server' => 'suite:wrapper'
task 'suite:pb' => 'suite:server'
desc 'Compiles the gRPC extension then runs all the tests'
task all: ['suite:idiomatic', 'suite:bidi', 'suite:pb', 'suite:server']
task default: :all

View File

@ -1,3 +0,0 @@
# Security Policy
For information on gRPC Security Policy and reporting potentional security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md).

View File

@ -1,54 +0,0 @@
# Troubleshooting gRPC
This guide is for troubleshooting gRPC implementations based on C core library (sources for most of them are living in the `grpc/grpc` repository).
## Enabling extra logging and tracing
Extra logging can be very useful for diagnosing problems. It can be used to increase the amount of information
that gets printed to stderr.
## GRPC_VERBOSITY
<!-- BEGIN_GOOGLE_INTERNAL_DOCUMENTATION
GRPC_VERBOSITY has been disabled for internal usage and will not work anymore.
If anyone wants to debug, we need to set verbose logs using absl.
END_GOOGLE_INTERNAL_DOCUMENTATION -->
<!-- BEGIN_OPEN_SOURCE_DOCUMENTATION -->
`GRPC_VERBOSITY` is used to set the minimum level of log messages printed by gRPC (supported values are `DEBUG`, `INFO` and `ERROR`). If this environment variable is unset, only `ERROR` logs will be printed. `ERROR` is recomeded for production systems.
<!-- END_OPEN_SOURCE_DOCUMENTATION -->
## GRPC_TRACE
<!-- BEGIN_GOOGLE_INTERNAL_DOCUMENTATION
GRPC_VERBOSITY has been disabled for internal usage and will not work anymore.
If anyone wants to debug, we need to set verbose logs using absl.
END_GOOGLE_INTERNAL_DOCUMENTATION -->
`GRPC_TRACE` can be used to enable extra logging for some internal gRPC components. Enabling the right traces can be invaluable
for diagnosing for what is going wrong when things aren't working as intended. Possible values for `GRPC_TRACE` are listed in [Environment Variables Overview](doc/environment_variables.md).
Multiple traces can be enabled at once (use comma as separator).
```
# Enable debug logs for an application
GRPC_VERBOSITY=debug ./helloworld_application_using_grpc
```
```
# Print information about invocations of low-level C core API.
# Note that trace logs of log level DEBUG won't be displayed.
# Also note that most tracers user log level INFO, so without setting
# GPRC_VERBOSITY accordingly, no traces will be printed.
GRPC_VERBOSITY=info GRPC_TRACE=api ./helloworld_application_using_grpc
```
```
# Print info from 3 different tracers, including tracing logs with log level DEBUG
GRPC_VERBOSITY=debug GRPC_TRACE=tcp,http,api ./helloworld_application_using_grpc
```
Known limitations: `GPRC_TRACE=tcp` is currently not implemented for Windows (you won't see any tcp traces).
Please note that the `GRPC_TRACE` environment variable has nothing to do with gRPC's "tracing" feature (= tracing RPCs in
microservice environment to gain insight about how requests are processed by deployment), it is merely used to enable printing
of extra logs.

168
WORKSPACE
View File

@ -1,168 +0,0 @@
workspace(name = "com_github_grpc_grpc")
load("//bazel:grpc_deps.bzl", "grpc_deps", "grpc_test_only_deps")
grpc_deps()
grpc_test_only_deps()
load("//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict", "custom_exec_properties")
custom_exec_properties(
name = "grpc_custom_exec_properties",
constants = {
"LARGE_MACHINE": create_rbe_exec_properties_dict(
labels = {
"os": "ubuntu",
"machine_size": "large",
},
),
},
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "platforms",
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"],
)
RULES_ANDROID_NDK_COMMIT = "010f4f17dd13a8baaaacc28ba6c8c2c75f54c68b"
RULES_ANDROID_NDK_SHA = "2ab6a97748772f289331d75caaaee0593825935d1d9d982231a437fb8ab5a14d"
http_archive(
name = "rules_android_ndk",
sha256 = RULES_ANDROID_NDK_SHA,
strip_prefix = "rules_android_ndk-%s" % RULES_ANDROID_NDK_COMMIT,
url = "https://github.com/bazelbuild/rules_android_ndk/archive/%s.zip" % RULES_ANDROID_NDK_COMMIT,
)
android_sdk_repository(
name = "androidsdk",
build_tools_version = "34.0.0",
)
load("@rules_android_ndk//:rules.bzl", "android_ndk_repository")
android_ndk_repository(name = "androidndk")
# Note that we intentionally avoid calling `register_toolchains("@androidndk//:all")`
# here, because the toolchain rule fails when $ANDROID_NDK_HOME is not set.
# Use `--extra_toolchains=@androidndk//:all` to manually register it when building for Android.
# Prevents bazel's '...' expansion from including the following folder.
# This is required because the BUILD file in the following folder
# will trigger bazel failure when Android SDK is not configured.
# The targets in the following folder need to be included in APK and will
# be invoked by binder transport implementation through JNI.
local_repository(
name = "binder_transport_android_helper",
path = "src/core/ext/transport/binder/java",
)
# Prevents bazel's '...' expansion from including the following folder.
# This is required to avoid triggering "Unable to find package for @rules_fuzzing//fuzzing:cc_defs.bzl"
# error.
local_repository(
name = "ignore_third_party_utf8_range_subtree",
path = "third_party/utf8_range",
)
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "grpc_python_dependencies",
requirements_lock = "@com_github_grpc_grpc//:requirements.bazel.txt",
)
load("@grpc_python_dependencies//:requirements.bzl", "install_deps")
install_deps()
load("@com_google_protobuf//bazel:system_python.bzl", "system_python")
system_python(
name = "system_python",
minimum_python_version = "3.7",
)
load("@system_python//:pip.bzl", system_pip_parse = "pip_parse")
system_pip_parse(
name = "pip_deps",
requirements = "@com_google_protobuf//python:requirements.txt",
requirements_overrides = {
"3.11": "@com_google_protobuf//python:requirements_311.txt",
},
)
http_archive(
name = "build_bazel_rules_swift",
sha256 = "bf2861de6bf75115288468f340b0c4609cc99cc1ccc7668f0f71adfd853eedb3",
url = "https://github.com/bazelbuild/rules_swift/releases/download/1.7.1/rules_swift.1.7.1.tar.gz",
)
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
# This loads the libpfm transitive dependency.
# See https://github.com/google/benchmark/pull/1520
load("@com_github_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps")
benchmark_deps()
# This is a transitive dependency from google_cloud_cpp
bind(
name = "cares",
actual = "@com_github_cares_cares//:ares",
)
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
opentelemetry_cpp_deps()
load("@io_opentelemetry_cpp//bazel:extra_deps.bzl", "opentelemetry_extra_deps")
opentelemetry_extra_deps()
# Transitive dependency of opentelemetry_extra_deps()
bind(
name = "madler_zlib",
actual = "@zlib//:zlib",
)
# TODO: Enable below once https://github.com/bazel-xcode/PodToBUILD/issues/232 is resolved
#
#http_archive(
# name = "rules_pods",
# urls = ["https://github.com/pinterest/PodToBUILD/releases/download/4.1.0-412495/PodToBUILD.zip"],
#)
#
#load(
# "@rules_pods//BazelExtensions:workspace.bzl",
# "new_pod_repository",
#)
#
#new_pod_repository(
# name = "CronetFramework",
# is_dynamic_framework = True,
# podspec_url = "https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/2/e/1/CronetFramework/0.0.5/CronetFramework.podspec.json",
# url = "https://storage.googleapis.com/grpc-precompiled-binaries/cronet/Cronet.framework-v0.0.5.zip",
#)

View File

@ -1,17 +0,0 @@
# Copyright 2021 The gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!!
__version__ = """1.65.0.dev0"""

View File

@ -1,26 +0,0 @@
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Contains build targets used by Starlark files in the bazel/ directory.
"""
licenses(["notice"])
package(default_visibility = ["//:__subpackages__"])
filegroup(
name = "_gevent_test_main",
srcs = ["_gevent_test_main.py"],
)

View File

@ -1,102 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import gevent
from gevent import monkey
monkey.patch_all()
threadpool = gevent.hub.get_hub().threadpool
# Currently, each channel corresponds to a single native thread in the
# gevent threadpool. Thus, when the unit test suite spins up hundreds of
# channels concurrently, some will be starved out, causing the test to
# increase in duration. We increase the max size here so this does not
# happen.
threadpool.maxsize = 1024
threadpool.size = 32
import traceback, signal
from typing import Sequence
import grpc.experimental.gevent
grpc.experimental.gevent.init_gevent()
import gevent
import greenlet
import datetime
import grpc
import unittest
import sys
import os
import pkgutil
import importlib
def trace_callback(event, args):
if event in ("switch", "throw"):
origin, target = args
sys.stderr.write("{} Transfer from {} to {} with {}\n".format(datetime.datetime.now(), origin, target, event))
else:
sys.stderr.write("Unknown event {}.\n".format(event))
sys.stderr.flush()
if os.getenv("GREENLET_TRACE") is not None:
greenlet.settrace(trace_callback)
def debug(sig, frame):
d={'_frame':frame}
d.update(frame.f_globals)
d.update(frame.f_locals)
sys.stderr.write("Traceback:\n{}".format("\n".join(traceback.format_stack(frame))))
import gevent.util; gevent.util.print_run_info()
sys.stderr.flush()
signal.signal(signal.SIGTERM, debug)
class SingleLoader(object):
def __init__(self, pattern: str):
loader = unittest.TestLoader()
self.suite = unittest.TestSuite()
tests = []
for importer, module_name, is_package in pkgutil.walk_packages([os.path.dirname(os.path.relpath(__file__))]):
if pattern in module_name:
spec = importer.find_spec(module_name)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
tests.append(loader.loadTestsFromModule(module))
if len(tests) != 1:
raise AssertionError("Expected only 1 test module. Found {}".format(tests))
self.suite.addTest(tests[0])
def loadTestsFromNames(self, names: Sequence[str], module: str = None) -> unittest.TestSuite:
return self.suite
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr)
target_module = sys.argv[1]
loader = SingleLoader(target_module)
runner = unittest.TextTestRunner()
result = gevent.spawn(runner.run, loader.suite)
result.join()
if not result.value.wasSuccessful():
sys.exit("Test failure.")

View File

@ -1,119 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Generates and compiles C++ grpc stubs from proto_library rules."""
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:generate_cc.bzl", "generate_cc")
load("//bazel:protobuf.bzl", "well_known_proto_libs")
def cc_grpc_library(
name,
srcs,
deps,
proto_only = False,
well_known_protos = False,
generate_mocks = False,
use_external = False,
grpc_only = False,
**kwargs):
"""Generates C++ grpc classes for services defined in a proto file.
If grpc_only is True, this rule is compatible with proto_library and
cc_proto_library native rules such that it expects proto_library target
as srcs argument and generates only grpc library classes, expecting
protobuf messages classes library (cc_proto_library target) to be passed in
deps argument. By default grpc_only is False which makes this rule to behave
in a backwards-compatible mode (trying to generate both proto and grpc
classes).
Assumes the generated classes will be used in cc_api_version = 2.
Args:
name (str): Name of rule.
srcs (list): A single .proto file which contains services definitions,
or if grpc_only parameter is True, a single proto_library which
contains services descriptors.
deps (list): A list of C++ proto_library (or cc_proto_library) which
provides the compiled code of any message that the services depend on.
proto_only (bool): If True, create only C++ proto classes library,
avoid creating C++ grpc classes library (expect it in deps).
Deprecated, use native cc_proto_library instead. False by default.
well_known_protos (bool): Should this library additionally depend on
well known protos. Deprecated, the well known protos should be
specified as explicit dependencies of the proto_library target
(passed in srcs parameter) instead. False by default.
generate_mocks (bool): when True, Google Mock code for client stub is
generated. False by default.
use_external (bool): Not used.
grpc_only (bool): if True, generate only grpc library, expecting
protobuf messages library (cc_proto_library target) to be passed as
deps. False by default (will become True by default eventually).
**kwargs: rest of arguments, e.g., compatible_with and visibility
"""
if len(srcs) > 1:
fail("Only one srcs value supported", "srcs")
if grpc_only and proto_only:
fail("A mutualy exclusive configuration is specified: grpc_only = True and proto_only = True")
extra_deps = []
proto_targets = []
if not grpc_only:
proto_target = "_" + name + "_only"
cc_proto_target = name if proto_only else "_" + name + "_cc_proto"
proto_deps = ["_" + dep + "_only" for dep in deps if dep.find(":") == -1]
proto_deps += [dep.split(":")[0] + ":" + "_" + dep.split(":")[1] + "_only" for dep in deps if dep.find(":") != -1 and dep.find("com_google_googleapis") == -1]
proto_deps += [dep for dep in deps if dep.find("com_google_googleapis") != -1]
if well_known_protos:
proto_deps += well_known_proto_libs()
proto_library(
name = proto_target,
srcs = srcs,
deps = proto_deps,
**kwargs
)
native.cc_proto_library(
name = cc_proto_target,
deps = [":" + proto_target],
**kwargs
)
extra_deps.append(":" + cc_proto_target)
proto_targets.append(proto_target)
else:
if not srcs:
fail("srcs cannot be empty", "srcs")
proto_targets += srcs
if not proto_only:
codegen_grpc_target = "_" + name + "_grpc_codegen"
generate_cc(
name = codegen_grpc_target,
srcs = proto_targets,
plugin = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin",
well_known_protos = well_known_protos,
generate_mocks = generate_mocks,
**kwargs
)
native.cc_library(
name = name,
srcs = [":" + codegen_grpc_target],
hdrs = [":" + codegen_grpc_target],
deps = deps +
extra_deps +
["@com_github_grpc_grpc//:grpc++_codegen_proto"],
**kwargs
)

View File

@ -1,163 +0,0 @@
# Copyright 2021 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Includes default copts.
"""
# This is a list of llvm flags to be used when being built with use_strict_warning=1
GRPC_LLVM_WARNING_FLAGS = [
# Enable all & extra warnings
"-Wall",
"-Wextra",
# Avoid some known traps
"-Wimplicit-fallthrough",
# Consider warnings as errors
"-Werror",
# Ignore unknown warning flags
"-Wno-unknown-warning-option",
# A list of enabled flags coming from internal build system
"-Wc++20-extensions",
"-Wctad-maybe-unsupported",
"-Wdeprecated-increment-bool",
"-Wfloat-overflow-conversion",
"-Wfloat-zero-conversion",
"-Wfor-loop-analysis",
"-Wformat-security",
"-Wgnu-redeclared-enum",
"-Winfinite-recursion",
"-Wliteral-conversion",
"-Wnon-virtual-dtor",
"-Woverloaded-virtual",
"-Wself-assign",
"-Wstring-conversion",
"-Wtautological-overlap-compare",
"-Wthread-safety-analysis",
"-Wthread-safety-beta",
"-Wunused-but-set-variable",
"-Wunused-comparison",
"-Wvla",
# -Wextra compatibility between gcc and clang
"-Wtype-limits",
# A list of disabled flags coming from internal build system
"-Wno-string-concatenation",
# Exceptions but will be removed
"-Wno-deprecated-declarations",
"-Wno-unused-function",
]
GRPC_LLVM_WINDOWS_WARNING_FLAGS = GRPC_LLVM_WARNING_FLAGS + [
### Some checks that are missing with clang-cl
"-Wthread-safety",
"-Wreorder-ctor",
### Avoid some checks that are default on clang-cl
"-Wno-c++98-compat-pedantic",
"-Wno-missing-prototypes",
"-Wno-thread-safety-precise", # too many aliases
# abseil offenses
"-Wno-comma",
"-Wno-deprecated-redundant-constexpr-static-def",
"-Wno-deprecated", # remove when the above works in all clang versions we test with
"-Wno-float-equal",
"-Wno-gcc-compat",
"-Wno-reserved-identifier",
"-Wno-thread-safety-negative",
"-Wno-sign-compare",
# re2 offenses
"-Wno-zero-as-null-pointer-constant",
# ares offenses
"-Wno-macro-redefined",
# protobuf offenses
"-Wno-cast-align",
"-Wno-inconsistent-missing-destructor-override",
# xxhash offenses
"-Wno-disabled-macro-expansion",
# benchmark offenses
"-Wno-shift-sign-overflow",
# Evidently nodiscard is inappropriately pinned as a C++17 feature
"-Wno-c++17-attribute-extensions",
# declarations are not used in many places
"-Wno-missing-variable-declarations",
# TODO: delete iomgr
"-Wno-old-style-cast",
"-Wno-cast-qual",
"-Wno-unused-member-function",
"-Wno-unused-template",
# TODO(hork): see if the TraceFlag offense can be removed
"-Wno-global-constructors",
# TODO(hork): clean up EE offenses
"-Wno-missing-field-initializers",
"-Wno-non-virtual-dtor",
"-Wno-thread-safety-reference-return",
# TODO(ctiller): offense: dump_args. signed to unsigned
"-Wno-sign-conversion",
"-Wno-shorten-64-to-32",
# TODO: general cleanup required. Maybe new developer or rainy day projects.
"-Wno-unreachable-code-break",
"-Wno-unreachable-code-return",
"-Wno-unreachable-code",
"-Wno-used-but-marked-unused",
"-Wno-newline-eof",
"-Wno-unused-const-variable",
"-Wno-extra-semi",
"-Wno-extra-semi-stmt",
"-Wno-suggest-destructor-override",
"-Wno-shadow",
"-Wno-missing-noreturn",
"-Wno-nested-anon-types",
"-Wno-gnu-anonymous-struct",
"-Wno-nonportable-system-include-path",
"-Wno-microsoft-cast",
"-Wno-exit-time-destructors",
"-Wno-undef", # #if <MACRO_NAME> to #ifdef <MACRO_NAME>
"-Wno-unused-macros",
"-Wno-redundant-parens",
"-Wno-undefined-func-template",
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wno-double-promotion",
"-Wno-implicit-float-conversion",
"-Wno-implicit-int-conversion",
"-Wno-float-conversion",
"-Wno-unused-parameter",
"-Wno-suggest-override",
"-Wno-documentation",
"-Wno-documentation-unknown-command",
"-Wno-unsafe-buffer-usage",
### possibly bad warnings for this codebase
"-Wno-covered-switch-default",
"-Wno-switch-default",
"-Wno-switch-enum",
"-Wno-c99-extensions",
"-Wno-unused-private-field", # GRPC_UNUSED does not appear to work for private fields
]
GRPC_DEFAULT_COPTS = select({
"//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"],
"//:use_strict_warning_windows": GRPC_LLVM_WINDOWS_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"],
"//conditions:default": [],
})

View File

@ -1,21 +0,0 @@
# Copyright 2019 The gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Reimports constants from the grpc_custom_exec_properties repo.
"""
load("@grpc_custom_exec_properties//:constants.bzl", _LARGE_MACHINE = "LARGE_MACHINE")
LARGE_MACHINE = _LARGE_MACHINE

View File

@ -1,92 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Custom rules for gRPC Python"""
# Adapted with modifications from
# tensorflow/tensorflow/core/platform/default/build_config.bzl
# Native Bazel rules don't exist yet to compile Cython code, but rules have
# been written at cython/cython and tensorflow/tensorflow. We branch from
# Tensorflow's version as it is more actively maintained and works for gRPC
# Python's needs.
def pyx_library(name, deps = [], py_deps = [], srcs = [], **kwargs):
"""Compiles a group of .pyx / .pxd / .py files.
First runs Cython to create .cpp files for each input .pyx or .py + .pxd
pair. Then builds a shared object for each, passing "deps" to each cc_binary
rule (includes Python headers by default). Finally, creates a py_library rule
with the shared objects and any pure Python "srcs", with py_deps as its
dependencies; the shared objects can be imported like normal Python files.
Args:
name: Name for the rule.
deps: C/C++ dependencies of the Cython (e.g. Numpy headers).
py_deps: Pure Python dependencies of the final library.
srcs: .py, .pyx, or .pxd files to either compile or pass through.
**kwargs: Extra keyword arguments passed to the py_library.
"""
# First filter out files that should be run compiled vs. passed through.
py_srcs = []
pyx_srcs = []
pxd_srcs = []
for src in srcs:
if src.endswith(".pyx") or (src.endswith(".py") and
src[:-3] + ".pxd" in srcs):
pyx_srcs.append(src)
elif src.endswith(".py"):
py_srcs.append(src)
else:
pxd_srcs.append(src)
if src.endswith("__init__.py"):
pxd_srcs.append(src)
# Invoke cython to produce the shared object libraries.
for filename in pyx_srcs:
native.genrule(
name = filename + "_cython_translation",
srcs = [filename],
outs = [filename.split(".")[0] + ".cpp"],
# Optionally use PYTHON_BIN_PATH on Linux platforms so that python 3
# works. Windows has issues with cython_binary so skip PYTHON_BIN_PATH.
cmd =
"PYTHONHASHSEED=0 $(location @cython//:cython_binary) --cplus $(SRCS) --output-file $(OUTS)",
tools = ["@cython//:cython_binary"] + pxd_srcs,
)
shared_objects = []
defines = kwargs.pop("defines", [])
for src in pyx_srcs:
stem = src.split(".")[0]
shared_object_name = stem + ".so"
native.cc_binary(
name = shared_object_name,
srcs = [stem + ".cpp"],
deps = deps + ["@local_config_python//:python_headers"],
defines = defines,
linkshared = 1,
)
shared_objects.append(shared_object_name)
data = shared_objects[:]
data += kwargs.pop("data", [])
# Now create a py_library with these shared objects as data.
native.py_library(
name = name,
srcs = py_srcs,
deps = py_deps,
srcs_version = "PY2AND3",
data = data,
**kwargs
)

View File

@ -1,190 +0,0 @@
# Copyright 2023 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto generated by tools/codegen/core/gen_experiments.py
"""Dictionary of tags to experiments so we know when to test different experiments."""
EXPERIMENT_ENABLES = {
"call_status_override_on_cancellation": "call_status_override_on_cancellation",
"canary_client_privacy": "canary_client_privacy",
"client_privacy": "client_privacy",
"event_engine_client": "event_engine_client",
"event_engine_dns": "event_engine_dns",
"event_engine_listener": "event_engine_listener",
"free_large_allocator": "free_large_allocator",
"http2_stats_fix": "http2_stats_fix",
"keepalive_fix": "keepalive_fix",
"keepalive_server_fix": "keepalive_server_fix",
"max_pings_wo_data_throttle": "max_pings_wo_data_throttle",
"monitoring_experiment": "monitoring_experiment",
"multiping": "multiping",
"peer_state_based_framing": "peer_state_based_framing",
"pick_first_new": "pick_first_new",
"promise_based_inproc_transport": "promise_based_inproc_transport",
"rstpit": "rstpit",
"schedule_cancellation_over_write": "schedule_cancellation_over_write",
"server_privacy": "server_privacy",
"tcp_frame_size_tuning": "tcp_frame_size_tuning",
"tcp_rcv_lowat": "tcp_rcv_lowat",
"trace_record_callops": "trace_record_callops",
"unconstrained_max_quota_buffer_size": "unconstrained_max_quota_buffer_size",
"work_serializer_clears_time_cache": "work_serializer_clears_time_cache",
"work_serializer_dispatch": "work_serializer_dispatch",
}
EXPERIMENT_POLLERS = [
"event_engine_client",
"event_engine_dns",
"event_engine_listener",
]
EXPERIMENTS = {
"windows": {
"dbg": {
},
"off": {
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"flow_control_test": [
"multiping",
"peer_state_based_framing",
"rstpit",
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",
],
},
"on": {
"cancel_ares_query_test": [
"event_engine_dns",
],
"core_end2end_test": [
"event_engine_client",
"event_engine_listener",
],
"cpp_lb_end2end_test": [
"pick_first_new",
],
"event_engine_client_test": [
"event_engine_client",
],
"event_engine_listener_test": [
"event_engine_listener",
],
"lb_unit_test": [
"pick_first_new",
],
"resolver_component_tests_runner_invoker": [
"event_engine_dns",
],
"xds_end2end_test": [
"pick_first_new",
],
},
},
"ios": {
"dbg": {
},
"off": {
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"flow_control_test": [
"multiping",
"peer_state_based_framing",
"rstpit",
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",
],
},
"on": {
"cpp_lb_end2end_test": [
"pick_first_new",
],
"lb_unit_test": [
"pick_first_new",
],
"xds_end2end_test": [
"pick_first_new",
],
},
},
"posix": {
"dbg": {
},
"off": {
"core_end2end_test": [
"event_engine_client",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"event_engine_client_test": [
"event_engine_client",
],
"flow_control_test": [
"multiping",
"peer_state_based_framing",
"rstpit",
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",
],
},
"on": {
"cancel_ares_query_test": [
"event_engine_dns",
],
"core_end2end_test": [
"event_engine_listener",
"work_serializer_dispatch",
],
"cpp_end2end_test": [
"work_serializer_dispatch",
],
"cpp_lb_end2end_test": [
"pick_first_new",
],
"event_engine_listener_test": [
"event_engine_listener",
],
"lb_unit_test": [
"pick_first_new",
"work_serializer_dispatch",
],
"resolver_component_tests_runner_invoker": [
"event_engine_dns",
],
"xds_end2end_test": [
"pick_first_new",
"work_serializer_dispatch",
],
},
},
}

View File

@ -1,207 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Generates C++ grpc stubs from proto_library rules.
This is an internal rule used by cc_grpc_library, and shouldn't be used
directly.
"""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"get_include_directory",
"get_plugin_args",
"get_proto_root",
"proto_path_to_generated_filename",
)
_GRPC_PROTO_HEADER_FMT = "{}.grpc.pb.h"
_GRPC_PROTO_SRC_FMT = "{}.grpc.pb.cc"
_GRPC_PROTO_MOCK_HEADER_FMT = "{}_mock.grpc.pb.h"
_PROTO_HEADER_FMT = "{}.pb.h"
_PROTO_SRC_FMT = "{}.pb.cc"
def _strip_package_from_path(label_package, file):
prefix_len = 0
if not file.is_source and file.path.startswith(file.root.path):
prefix_len = len(file.root.path) + 1
path = file.path
if len(label_package) == 0:
return path
if not path.startswith(label_package + "/", prefix_len):
fail("'{}' does not lie within '{}'.".format(path, label_package))
return path[prefix_len + len(label_package + "/"):]
def _get_srcs_file_path(file):
if not file.is_source and file.path.startswith(file.root.path):
return file.path[len(file.root.path) + 1:]
return file.path
def _join_directories(directories):
massaged_directories = [directory for directory in directories if len(directory) != 0]
return "/".join(massaged_directories)
def generate_cc_impl(ctx):
"""Implementation of the generate_cc rule.
Args:
ctx: The context object.
Returns:
The provider for the generated files.
"""
protos = [f for src in ctx.attr.srcs for f in src[ProtoInfo].check_deps_sources.to_list()]
includes = [
f
for src in ctx.attr.srcs
for f in src[ProtoInfo].transitive_imports.to_list()
]
outs = []
proto_root = get_proto_root(
ctx.label.workspace_root,
)
label_package = _join_directories([ctx.label.workspace_root, ctx.label.package])
if ctx.executable.plugin:
outs += [
proto_path_to_generated_filename(
_strip_package_from_path(label_package, proto),
_GRPC_PROTO_HEADER_FMT,
)
for proto in protos
]
outs += [
proto_path_to_generated_filename(
_strip_package_from_path(label_package, proto),
_GRPC_PROTO_SRC_FMT,
)
for proto in protos
]
if ctx.attr.generate_mocks:
outs += [
proto_path_to_generated_filename(
_strip_package_from_path(label_package, proto),
_GRPC_PROTO_MOCK_HEADER_FMT,
)
for proto in protos
]
else:
outs += [
proto_path_to_generated_filename(
_strip_package_from_path(label_package, proto),
_PROTO_HEADER_FMT,
)
for proto in protos
]
outs += [
proto_path_to_generated_filename(
_strip_package_from_path(label_package, proto),
_PROTO_SRC_FMT,
)
for proto in protos
]
out_files = [ctx.actions.declare_file(out) for out in outs]
dir_out = str(ctx.genfiles_dir.path + proto_root)
arguments = []
if ctx.executable.plugin:
arguments += get_plugin_args(
ctx.executable.plugin,
ctx.attr.flags,
dir_out,
ctx.attr.generate_mocks,
)
tools = [ctx.executable.plugin]
else:
arguments.append("--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out)
tools = []
arguments += [
"--proto_path={}".format(get_include_directory(i))
for i in includes
]
# Include the output directory so that protoc puts the generated code in the
# right directory.
arguments.append("--proto_path={0}{1}".format(dir_out, proto_root))
arguments += [_get_srcs_file_path(proto) for proto in protos]
# create a list of well known proto files if the argument is non-None
well_known_proto_files = []
if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/com_google_protobuf/src/google/protobuf":
print(
"Error: Only @com_google_protobuf//:well_known_type_protos is supported",
) # buildifier: disable=print
else:
# f points to "external/com_google_protobuf/src/google/protobuf"
# add -I argument to protoc so it knows where to look for the proto files.
arguments.append("-I{0}".format(f + "/../.."))
well_known_proto_files = [
f
for f in ctx.attr.well_known_protos.files.to_list()
]
ctx.actions.run(
inputs = protos + includes + well_known_proto_files,
tools = tools,
outputs = out_files,
executable = ctx.executable._protoc,
arguments = arguments,
use_default_shell_env = True,
)
return DefaultInfo(files = depset(out_files))
_generate_cc = rule(
attrs = {
"srcs": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [ProtoInfo],
),
"plugin": attr.label(
executable = True,
providers = ["files_to_run"],
cfg = "exec",
),
"flags": attr.string_list(
mandatory = False,
allow_empty = True,
),
"well_known_protos": attr.label(mandatory = False),
"generate_mocks": attr.bool(
default = False,
mandatory = False,
),
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
executable = True,
cfg = "exec",
),
},
# We generate .h files, so we need to output to genfiles.
output_to_genfiles = True,
implementation = generate_cc_impl,
)
def generate_cc(well_known_protos, **kwargs):
if well_known_protos:
_generate_cc(
well_known_protos = "@com_google_protobuf//:well_known_type_protos",
**kwargs
)
else:
_generate_cc(**kwargs)

View File

@ -1,243 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module contains build rules relating to gRPC Objective-C.
"""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"get_include_directory",
"get_plugin_args",
"proto_path_to_generated_filename",
)
load(":grpc_util.bzl", "to_upper_camel_with_extension")
_GRPC_PROTO_HEADER_FMT = "{}.pbrpc.h"
_GRPC_PROTO_SRC_FMT = "{}.pbrpc.m"
_PROTO_HEADER_FMT = "{}.pbobjc.h"
_PROTO_SRC_FMT = "{}.pbobjc.m"
_GENERATED_PROTOS_DIR = "_generated_protos"
_GENERATE_HDRS = 1
_GENERATE_SRCS = 2
_GENERATE_NON_ARC_SRCS = 3
def _generate_objc_impl(ctx):
"""Implementation of the generate_objc rule."""
protos = [
f
for src in ctx.attr.deps
for f in src[ProtoInfo].transitive_imports.to_list()
]
target_package = _join_directories([ctx.label.workspace_root, ctx.label.package])
files_with_rpc = [_label_to_full_file_path(f, target_package) for f in ctx.attr.srcs]
outs = []
for proto in protos:
outs.append(_get_output_file_name_from_proto(proto, _PROTO_HEADER_FMT))
outs.append(_get_output_file_name_from_proto(proto, _PROTO_SRC_FMT))
file_path = _get_full_path_from_file(proto)
if file_path in files_with_rpc:
outs.append(_get_output_file_name_from_proto(proto, _GRPC_PROTO_HEADER_FMT))
outs.append(_get_output_file_name_from_proto(proto, _GRPC_PROTO_SRC_FMT))
out_files = [ctx.actions.declare_file(out) for out in outs]
dir_out = _join_directories([
str(ctx.genfiles_dir.path),
target_package,
_GENERATED_PROTOS_DIR,
])
arguments = []
tools = []
if ctx.executable.plugin:
arguments += get_plugin_args(
ctx.executable.plugin,
[],
dir_out,
False,
)
tools = [ctx.executable.plugin]
arguments.append("--objc_out=" + dir_out)
arguments.append("--proto_path=.")
arguments += [
"--proto_path={}".format(get_include_directory(i))
for i in protos
]
# Include the output directory so that protoc puts the generated code in the
# right directory.
arguments.append("--proto_path={}".format(dir_out))
arguments += ["--proto_path={}".format(_get_directory_from_proto(proto)) for proto in protos]
arguments += [_get_full_path_from_file(proto) for proto in protos]
# create a list of well known proto files if the argument is non-None
well_known_proto_files = []
if ctx.attr.use_well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
# go two levels up so that #import "google/protobuf/..." is correct
arguments.append("-I{0}".format(f + "/../.."))
well_known_proto_files = ctx.attr.well_known_protos.files.to_list()
ctx.actions.run(
inputs = protos + well_known_proto_files,
tools = tools,
outputs = out_files,
executable = ctx.executable._protoc,
arguments = arguments,
)
return struct(files = depset(out_files)) # buildifier: disable=rule-impl-return
def _label_to_full_file_path(src, package):
if not src.startswith("//"):
# Relative from current package
if not src.startswith(":"):
# "a.proto" -> ":a.proto"
src = ":" + src
src = "//" + package + src
# Converts //path/to/package:File.ext to path/to/package/File.ext.
src = src.replace("//", "")
src = src.replace(":", "/")
if src.startswith("/"):
# "//:a.proto" -> "/a.proto" so remove the initial slash
return src[1:]
else:
return src
def _get_output_file_name_from_proto(proto, fmt):
return proto_path_to_generated_filename(
_GENERATED_PROTOS_DIR + "/" +
_get_directory_from_proto(proto) + _get_slash_or_null_from_proto(proto) +
to_upper_camel_with_extension(_get_file_name_from_proto(proto), "proto"),
fmt,
)
def _get_file_name_from_proto(proto):
return proto.path.rpartition("/")[2]
def _get_slash_or_null_from_proto(proto):
"""Potentially returns empty (if the file is in the root directory)"""
return proto.path.rpartition("/")[1]
def _get_directory_from_proto(proto):
return proto.path.rpartition("/")[0]
def _get_full_path_from_file(file):
gen_dir_length = 0
# if file is generated, then prepare to remote its root
# (including CPU architecture...)
if not file.is_source:
gen_dir_length = len(file.root.path) + 1
return file.path[gen_dir_length:]
def _join_directories(directories):
massaged_directories = [directory for directory in directories if len(directory) != 0]
return "/".join(massaged_directories)
generate_objc = rule(
attrs = {
"deps": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [ProtoInfo],
),
"plugin": attr.label(
default = "@com_github_grpc_grpc//src/compiler:grpc_objective_c_plugin",
executable = True,
providers = ["files_to_run"],
cfg = "exec",
),
"srcs": attr.string_list(
mandatory = False,
allow_empty = True,
),
"use_well_known_protos": attr.bool(
mandatory = False,
default = False,
),
"well_known_protos": attr.label(
default = "@com_google_protobuf//:well_known_type_protos",
),
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
executable = True,
cfg = "exec",
),
},
output_to_genfiles = True,
implementation = _generate_objc_impl,
)
def _group_objc_files_impl(ctx):
suffix = ""
if ctx.attr.gen_mode == _GENERATE_HDRS:
suffix = "h"
elif ctx.attr.gen_mode == _GENERATE_SRCS:
suffix = "pbrpc.m"
elif ctx.attr.gen_mode == _GENERATE_NON_ARC_SRCS:
suffix = "pbobjc.m"
else:
fail("Undefined gen_mode")
out_files = [
file
for file in ctx.attr.src.files.to_list()
if file.basename.endswith(suffix)
]
return struct(files = depset(out_files)) # buildifier: disable=rule-impl-return
generate_objc_hdrs = rule(
attrs = {
"src": attr.label(
mandatory = True,
),
"gen_mode": attr.int(
default = _GENERATE_HDRS,
),
},
implementation = _group_objc_files_impl,
)
generate_objc_srcs = rule(
attrs = {
"src": attr.label(
mandatory = True,
),
"gen_mode": attr.int(
default = _GENERATE_SRCS,
),
},
implementation = _group_objc_files_impl,
)
generate_objc_non_arc_srcs = rule(
attrs = {
"src": attr.label(
mandatory = True,
),
"gen_mode": attr.int(
default = _GENERATE_NON_ARC_SRCS,
),
},
implementation = _group_objc_files_impl,
)

View File

@ -1,86 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Houses py_grpc_gevent_test.
"""
load("@grpc_python_dependencies//:requirements.bzl", "requirement")
_GRPC_LIB = "//src/python/grpcio/grpc:grpcio"
_COPIED_MAIN_SUFFIX = ".gevent.main"
def py_grpc_gevent_test(
name,
srcs,
main = None,
deps = None,
data = None,
**kwargs):
"""Runs a Python test with gevent monkeypatched in.
Args:
name: The name of the test.
srcs: The source files.
main: The main file of the test.
deps: The dependencies of the test.
data: The data dependencies of the test.
**kwargs: Any other test arguments.
"""
if main == None:
if len(srcs) != 1:
fail("When main is not provided, srcs must be of size 1.")
main = srcs[0]
deps = [] if deps == None else deps
data = [] if data == None else data
lib_name = name + ".gevent.lib"
supplied_python_version = kwargs.pop("python_version", "")
if supplied_python_version and supplied_python_version != "PY3":
fail("py_grpc_gevent_test only supports python_version=PY3")
native.py_library(
name = lib_name,
srcs = srcs,
)
augmented_deps = deps + [
":{}".format(lib_name),
requirement("gevent"),
]
if _GRPC_LIB not in augmented_deps:
augmented_deps.append(_GRPC_LIB)
# The main file needs to be in the same package as the test file.
copied_main_name = name + _COPIED_MAIN_SUFFIX
copied_main_filename = copied_main_name + ".py"
native.genrule(
name = copied_main_name,
srcs = ["//bazel:_gevent_test_main.py"],
outs = [copied_main_filename],
cmd = "cp $< $@",
)
# TODO(https://github.com/grpc/grpc/issues/27542): Remove once gevent is deemed non-flaky.
if "flaky" in kwargs:
kwargs.pop("flaky")
native.py_test(
name = name + ".gevent",
args = [name],
data = data,
deps = augmented_deps,
srcs = [copied_main_filename],
main = copied_main_filename,
python_version = "PY3",
flaky = False,
**kwargs
)

View File

@ -1,28 +0,0 @@
# Copyright 2023 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
licenses(["notice"])
package(
default_visibility = ["//visibility:public"],
)
# This is needed for the dependency on google_cloud_cpp to work.
# Taken from https://github.com/googleapis/google-cloud-cpp/blob/2839e9dba793ca023e11ea67f201f66f74fa7d3e/bazel/googleapis.BUILD
cc_library(
name = "googleapis_system_includes",
includes = [
".",
],
)

View File

@ -1,825 +0,0 @@
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This is for the gRPC build system. This isn't intended to be used outsite of
# the BUILD file for gRPC. It contains the mapping for the template system we
# use to generate other platform's build system files.
#
# Please consider that there should be a high bar for additions and changes to
# this file.
# Each rule listed must be re-written for Google's internal build system, and
# each change must be ported from one to the other.
#
"""
Contains macros used throughout the repo.
"""
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl", "ios_test_runner")
load("@com_google_protobuf//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library")
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("//bazel:copts.bzl", "GRPC_DEFAULT_COPTS")
load("//bazel:experiments.bzl", "EXPERIMENTS", "EXPERIMENT_ENABLES", "EXPERIMENT_POLLERS")
load("//bazel:test_experiments.bzl", "TEST_EXPERIMENTS", "TEST_EXPERIMENT_ENABLES", "TEST_EXPERIMENT_POLLERS")
# The set of pollers to test against if a test exercises polling
POLLERS = ["epoll1", "poll"]
# The set of known EventEngines to test
EVENT_ENGINES = {"default": {"tags": []}}
def if_not_windows(a):
return select({
"//:windows": [],
"//:windows_msvc": [],
"//:windows_clang": [],
"//conditions:default": a,
})
def if_windows(a):
return select({
"//:windows": a,
"//:windows_msvc": a,
"//:windows_clang": a,
"//conditions:default": [],
})
def _get_external_deps(external_deps):
ret = []
for dep in external_deps:
if dep.startswith("@"):
ret.append(dep)
elif dep == "address_sorting":
ret.append("//third_party/address_sorting")
elif dep == "xxhash":
ret.append("//third_party/xxhash")
elif dep == "cares":
ret += select({
"//:grpc_no_ares": [],
"//conditions:default": ["//third_party:cares"],
})
elif dep == "cronet_c_for_grpc":
ret.append("//third_party/objective_c/Cronet:cronet_c_for_grpc")
elif dep.startswith("absl/"):
ret.append("@com_google_absl//" + dep)
elif dep.startswith("google/"):
ret.append("@com_google_googleapis//" + dep)
elif dep.startswith("otel/"):
ret.append(dep.replace("otel/", "@io_opentelemetry_cpp//"))
elif dep.startswith("google_cloud_cpp"):
ret.append(dep.replace("google_cloud_cpp", "@google_cloud_cpp//"))
elif dep == "libprotobuf_mutator":
ret.append("@com_google_libprotobuf_mutator//:libprotobuf_mutator")
else:
ret.append("//third_party:" + dep)
return ret
def _update_visibility(visibility):
if visibility == None:
return None
# Visibility rules prefixed with '@grpc:' are used to flag different visibility rule
# classes upstream.
PUBLIC = ["//visibility:public"]
PRIVATE = ["//:__subpackages__"]
VISIBILITY_TARGETS = {
"alt_grpc++_base_legacy": PRIVATE,
"alt_grpc_base_legacy": PRIVATE,
"alt_grpc++_base_unsecure_legacy": PRIVATE,
"alts_frame_protector": PRIVATE,
"channelz": PRIVATE,
"chaotic_good": PRIVATE,
"client_channel": PRIVATE,
"cli": PRIVATE,
"core_credentials": PRIVATE,
"debug_location": PRIVATE,
"endpoint_tests": PRIVATE,
"exec_ctx": PRIVATE,
"gpr_public_hdrs": PRIVATE,
"grpclb": PRIVATE,
"grpc_experiments": PRIVATE,
"grpc_opencensus_plugin": PUBLIC,
"grpc_public_hdrs": PRIVATE,
"grpcpp_gcp_observability": PUBLIC,
"grpc_resolver_fake": PRIVATE,
"grpc++_public_hdrs": PUBLIC,
"grpc++_test": PRIVATE,
"http": PRIVATE,
"httpcli": PRIVATE,
"iomgr_internal_errqueue": PRIVATE,
"iomgr_buffer_list": PRIVATE,
"json_reader_legacy": PRIVATE,
"otel_plugin": PRIVATE,
"public": PUBLIC,
"ref_counted_ptr": PRIVATE,
"tcp_tracer": PRIVATE,
"trace": PRIVATE,
"tsi_interface": PRIVATE,
"tsi": PRIVATE,
"xds": PRIVATE,
"xds_client_core": PRIVATE,
"xds_end2end_test_utils": PRIVATE,
"grpc_python_observability": PRIVATE,
"event_engine_base_hdrs": PRIVATE,
"useful": PRIVATE,
}
final_visibility = []
for rule in visibility:
if rule.startswith("@grpc:"):
for replacement in VISIBILITY_TARGETS[rule[len("@grpc:"):]]:
final_visibility.append(replacement)
else:
final_visibility.append(rule)
return [x for x in final_visibility]
def grpc_cc_library(
name,
srcs = [],
public_hdrs = [],
hdrs = [],
external_deps = [],
defines = [],
deps = [],
select_deps = None,
standalone = False,
language = "C++",
testonly = False,
visibility = None,
alwayslink = 0,
data = [],
tags = [],
linkopts = [],
linkstatic = False):
"""An internal wrapper around cc_library.
Args:
name: The name of the library.
srcs: The source files.
public_hdrs: The public headers.
hdrs: The headers.
external_deps: External depdendencies to be resolved.
defines: Build defines to use.
deps: cc_library deps.
select_deps: deps included conditionally.
standalone: Unused.
language: The language of the library, e.g. C, C++.
testonly: Whether the target is for tests only.
visibility: The visibility of the target.
alwayslink: Whether to enable alwayslink on the cc_library.
data: Data dependencies.
tags: Tags to apply to the rule.
linkopts: Extra libraries to link.
linkstatic: Whether to enable linkstatic on the cc_library.
"""
visibility = _update_visibility(visibility)
copts = []
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c11"])
linkopts = linkopts + if_not_windows(["-pthread"]) + if_windows(["-defaultlib:ws2_32.lib"])
if select_deps:
for select_deps_entry in select_deps:
deps += select(select_deps_entry)
native.cc_library(
name = name,
srcs = srcs,
defines = defines +
select({
"//:grpc_no_ares": ["GRPC_ARES=0"],
"//conditions:default": [],
}) +
select({
"//:remote_execution": ["GRPC_PORT_ISOLATED_RUNTIME=1"],
"//conditions:default": [],
}) +
select({
"//:grpc_allow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=1"],
"//:grpc_disallow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=0"],
"//conditions:default": [],
}),
hdrs = hdrs + public_hdrs,
deps = deps + _get_external_deps(external_deps),
copts = GRPC_DEFAULT_COPTS + copts,
visibility = visibility,
testonly = testonly,
linkopts = linkopts,
includes = [
"include",
"src/core/ext/upb-gen", # Once upb code-gen issue is resolved, remove this.
"src/core/ext/upbdefs-gen", # Once upb code-gen issue is resolved, remove this.
],
alwayslink = alwayslink,
data = data,
tags = tags,
linkstatic = linkstatic,
)
def grpc_proto_plugin(name, srcs = [], deps = []):
native.cc_binary(
name = name,
srcs = srcs,
deps = deps,
)
def grpc_proto_library(
name,
srcs = [],
deps = [],
visibility = None,
well_known_protos = False,
has_services = True,
use_external = False,
generate_mocks = False):
cc_grpc_library(
name = name,
srcs = srcs,
deps = deps,
visibility = visibility,
well_known_protos = well_known_protos,
proto_only = not has_services,
use_external = use_external,
generate_mocks = generate_mocks,
)
def ios_cc_test(
name,
tags = [],
**kwargs):
"""An ios C++ test target.
Args:
name: The name of the test.
tags: The tags to apply to the test.
**kwargs: All other arguments to apply.
"""
test_lib_ios = name + "_test_lib_ios"
ios_tags = tags + ["manual", "ios_cc_test"]
test_runner = "ios_x86_64_sim_runner_" + name
ios_test_runner(
name = test_runner,
device_type = "iPhone X",
)
if not any([t for t in tags if t.startswith("no_test_ios")]):
native.objc_library(
name = test_lib_ios,
srcs = kwargs.get("srcs"),
deps = kwargs.get("deps"),
copts = kwargs.get("copts"),
data = kwargs.get("data"),
tags = ios_tags,
alwayslink = 1,
testonly = 1,
)
ios_test_deps = [":" + test_lib_ios]
ios_unit_test(
name = name + "_on_ios",
size = kwargs.get("size"),
data = kwargs.get("data"),
tags = ios_tags,
minimum_os_version = "9.0",
runner = test_runner,
deps = ios_test_deps,
)
def expand_poller_config(name, srcs, deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky):
"""Common logic used to parameterize tests for every poller and EventEngine.
Used by expand_tests (repeatedly) to form base lists of pollers for each experiment.
Args:
name: base name of the test
srcs: source files
deps: base deps
tags: base tags
args: base args
flaky: base flaky
exclude_pollers: list of poller names to exclude for this set of tests.
uses_polling: set to False if the test is not sensitive to polling methodology.
uses_event_engine: set to False if the test is not sensitive to
EventEngine implementation differences
Returns:
A list of dictionaries containing modified values of name, srcs, deps, tags, and args.
"""
poller_config = []
# See work_stealing_thread_pool.cc for details.
default_env = {"GRPC_THREAD_POOL_VERBOSE_FAILURES": "true"}
if not uses_polling:
tags = tags + ["no_uses_polling"]
poller_config.append({
"name": name,
"srcs": srcs,
"deps": deps,
"tags": tags,
"args": args,
"flaky": flaky,
"env": default_env,
})
else:
# On linux we run the same test with the default EventEngine, once for each
# poller
for poller in POLLERS:
if poller in exclude_pollers:
continue
poller_config.append({
"name": name + "@poller=" + poller,
"srcs": srcs,
"deps": deps,
"tags": (tags + EVENT_ENGINES["default"]["tags"] + [
"no_windows",
"no_mac",
"bazel_only",
]),
"args": args,
"env": {
"GRPC_POLL_STRATEGY": poller,
} | default_env,
"flaky": flaky,
})
# Now generate one test for each subsequent EventEngine, all using the
# default poller. These tests will have `@engine=<name>` appended to the
# test target name. If a test target name has no `@engine=<name>` component,
# that indicates that the default EventEngine is being used.
if not uses_event_engine:
# The poller tests exercise the default engine on Linux. This test
# handles other platforms.
poller_config.append({
"name": name,
"srcs": srcs,
"deps": deps,
"tags": tags + ["no_linux"],
"args": args,
"env": default_env,
"flaky": flaky,
})
else:
for engine_name, engine in EVENT_ENGINES.items():
test_name = name + "@engine=" + engine_name
test_tags = tags + engine["tags"] + ["bazel_only"]
test_args = args + ["--engine=" + engine_name]
if engine_name == "default":
# The poller tests exercise the default engine on Linux.
# This test handles other platforms.
test_name = name
test_tags = tags + engine["tags"] + ["no_linux"]
test_args = args
poller_config.append({
"name": test_name,
"srcs": srcs,
"deps": deps,
"tags": test_tags,
"args": test_args,
"env": default_env,
"flaky": flaky,
})
return poller_config
def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky):
"""Common logic used to parameterize tests for every poller and EventEngine and experiment.
Args:
name: base name of the test
srcs: source files
deps: base deps
tags: base tags
args: base args
flaky: base flaky
exclude_pollers: list of poller names to exclude for this set of tests.
uses_polling: set to False if the test is not sensitive to polling methodology.
uses_event_engine: set to False if the test is not sensitive to
EventEngine implementation differences
Returns:
A list of dictionaries containing modified values of name, srcs, deps, tags, and args.
"""
experiments = {}
# buildifier: disable=uninitialized
def _populate_experiments_platform_config(config, platform_experiments_map):
for platform, experiments_on_platform in platform_experiments_map.items():
for mode, tag_to_experiments in experiments_on_platform.items():
if mode not in config:
config[mode] = {}
for tag in tags:
if tag not in tag_to_experiments:
continue
for experiment in tag_to_experiments[tag]:
if experiment not in config[mode]:
config[mode][experiment] = []
config[mode][experiment].append(platform)
_populate_experiments_platform_config(experiments, EXPERIMENTS)
_populate_experiments_platform_config(experiments, TEST_EXPERIMENTS)
mode_config = {
# format: <mode>: (enabled_target_tags, disabled_target_tags)
"on": (None, []),
"off": ([], None),
}
must_have_tags = [
# We don't run experiments on cmake builds
"bazel_only",
# Nor on mac
"no_mac",
# Nor on arm64
"no_arm64",
]
def _update_experiments_platform_test_tags(tags, platforms):
if "posix" not in platforms:
if "no_linux" not in tags:
tags.append("no_linux")
if "no_mac" not in tags:
tags.append("no_mac")
if "windows" not in platforms:
if "no_windows" not in tags:
tags.append("no_windows")
if "ios" not in platforms:
if "no_test_ios" not in tags:
tags.append("no_test_ios")
return tags
base_params = {
"name": name,
"srcs": srcs,
"deps": deps,
"tags": tags,
"args": args,
"exclude_pollers": exclude_pollers,
"uses_polling": uses_polling,
"uses_event_engine": uses_event_engine,
"flaky": flaky,
}
experiment_config = expand_poller_config(**base_params)
experiment_enables = {k: v for k, v in EXPERIMENT_ENABLES.items() + TEST_EXPERIMENT_ENABLES.items()}
experiment_pollers = EXPERIMENT_POLLERS + TEST_EXPERIMENT_POLLERS
for mode, config in mode_config.items():
enabled_tags, disabled_tags = config
if enabled_tags != None:
for experiment in experiments[mode].keys():
experiment_params = dict(base_params)
experiment_params["uses_polling"] = uses_polling and (experiment in experiment_pollers)
for config in expand_poller_config(**experiment_params):
config = dict(config)
config["name"] = config["name"] + "@experiment=" + experiment
env = dict(config["env"])
env["GRPC_EXPERIMENTS"] = experiment_enables[experiment]
env["GRPC_CI_EXPERIMENTS"] = "1"
config["env"] = env
tags = config["tags"] + ["experiment_variation"]
for tag in must_have_tags + enabled_tags:
if tag not in tags:
tags = tags + [tag]
config["tags"] = _update_experiments_platform_test_tags(tags, experiments[mode][experiment])
config["flaky"] = True
experiment_config.append(config)
if disabled_tags != None:
for experiment in experiments[mode].keys():
experiment_params = dict(base_params)
experiment_params["uses_polling"] = uses_polling and (experiment in experiment_pollers)
for config in expand_poller_config(**experiment_params):
config = dict(config)
config["name"] = config["name"] + "@experiment=no_" + experiment
env = dict(config["env"])
env["GRPC_EXPERIMENTS"] = "-" + experiment
env["GRPC_CI_EXPERIMENTS"] = "1"
config["env"] = env
tags = config["tags"] + ["experiment_variation"]
for tag in must_have_tags + disabled_tags:
if tag not in tags:
tags = tags + [tag]
config["tags"] = _update_experiments_platform_test_tags(tags, experiments[mode][experiment])
experiment_config.append(config)
return experiment_config
def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, copts = [], linkstatic = None, exclude_pollers = [], uses_event_engine = True):
"""A cc_test target for use in the gRPC repo.
Args:
name: The name of the test.
srcs: The source files.
deps: The target deps.
external_deps: The external deps.
args: The args to supply to the test binary.
data: Data dependencies.
uses_polling: Whether the test uses polling.
language: The language of the test, e.g C, C++.
size: The size of the test.
timeout: The test timeout.
tags: The tags for the test.
exec_compatible_with: A list of constraint values that must be
satisifed for the platform.
exec_properties: A dictionary of strings that will be added to the
exec_properties of a platform selected for this target.
shard_count: The number of shards for this test.
flaky: Whether this test is flaky.
copts: Add these to the compiler invocation.
linkstatic: link the binary in static mode
exclude_pollers: list of poller names to exclude for this set of tests.
uses_event_engine: set to False if the test is not sensitive to
EventEngine implementation differences
"""
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c11"])
core_deps = deps + _get_external_deps(external_deps) + ["//test/core/test_util:grpc_suppressions"]
# Test args for all tests
test_args = {
"data": data,
"copts": GRPC_DEFAULT_COPTS + copts,
"linkopts": if_not_windows(["-pthread"]) + if_windows(["-defaultlib:ws2_32.lib"]),
"size": size,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
"shard_count": shard_count,
"linkstatic": linkstatic,
}
if "grpc-fuzzer" not in tags and "no_test_ios" not in tags:
ios_cc_test(
name = name,
srcs = srcs,
tags = tags,
deps = core_deps,
args = args,
flaky = True,
**test_args
)
native.cc_library(
name = "%s_TEST_LIBRARY" % name,
testonly = 1,
srcs = srcs,
deps = core_deps,
tags = tags,
)
for poller_config in expand_tests(name, srcs, core_deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky):
if poller_config["srcs"] != srcs:
fail("srcs changed")
if poller_config["deps"] != core_deps:
fail("deps changed: %r --> %r" % (deps, poller_config["deps"]))
native.cc_test(
name = poller_config["name"],
deps = ["%s_TEST_LIBRARY" % name],
tags = poller_config["tags"],
args = poller_config["args"],
env = poller_config["env"],
flaky = poller_config["flaky"],
**test_args
)
def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = [], features = [], visibility = None):
"""Generates a cc_binary for use in the gRPC repo.
Args:
name: The name of the target.
srcs: The source files.
deps: The dependencies.
external_deps: The external dependencies.
args: The arguments to supply to the binary.
data: The data dependencies.
language: The language of the binary, e.g. C, C++.
testonly: Whether the binary is for tests only.
linkshared: Enables linkshared on the binary.
linkopts: linkopts to supply to the cc_binary.
tags: Tags to apply to the target.
features: features to be supplied to the cc_binary.
visibility: The visibility of the target.
"""
visibility = _update_visibility(visibility)
copts = []
if language.upper() == "C":
copts = ["-std=c11"]
native.cc_binary(
name = name,
srcs = srcs,
args = args,
data = data,
testonly = testonly,
linkshared = linkshared,
deps = deps + _get_external_deps(external_deps) + ["//test/core/test_util:grpc_suppressions"],
copts = GRPC_DEFAULT_COPTS + copts,
linkopts = if_not_windows(["-pthread"]) + linkopts,
tags = tags,
features = features,
)
# buildifier: disable=unnamed-macro
def grpc_generate_one_off_targets():
# In open-source, grpc_objc* libraries depend directly on //:grpc
native.alias(
name = "grpc_objc",
actual = "//:grpc",
)
native.config_setting(
name = "windows_other",
values = {"define": "GRPC_WINDOWS_OTHER=1"},
)
def grpc_generate_objc_one_off_targets():
pass
def grpc_generate_one_off_internal_targets():
pass
def grpc_sh_test(name, srcs = [], args = [], data = [], uses_polling = True, size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, exclude_pollers = [], uses_event_engine = True):
"""Execute an sh_test for every <poller> x <EventEngine> combination
Args:
name: The name of the test.
srcs: The source files.
args: The args to supply to the test binary.
data: Data dependencies.
uses_polling: Whether the test uses polling.
size: The size of the test.
timeout: The test timeout.
tags: The tags for the test.
exec_compatible_with: A list of constraint values that must be
satisifed for the platform.
exec_properties: A dictionary of strings that will be added to the
exec_properties of a platform selected for this target.
shard_count: The number of shards for this test.
flaky: Whether this test is flaky.
exclude_pollers: list of poller names to exclude for this set of tests.
uses_event_engine: set to False if the test is not sensitive to
EventEngine implementation differences
"""
test_args = {
"data": data,
"size": size,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
"shard_count": shard_count,
}
for poller_config in expand_tests(name, srcs, [], tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky):
native.sh_test(
name = poller_config["name"],
srcs = poller_config["srcs"],
deps = poller_config["deps"],
tags = poller_config["tags"],
args = poller_config["args"],
env = poller_config["env"],
flaky = poller_config["flaky"],
**test_args
)
def grpc_sh_binary(name, srcs, data = []):
native.sh_binary(
name = name,
srcs = srcs,
data = data,
)
def grpc_py_binary(
name,
srcs,
data = [],
deps = [],
external_deps = [],
testonly = False,
python_version = "PY2",
**kwargs):
native.py_binary(
name = name,
srcs = srcs,
testonly = testonly,
data = data,
deps = deps + _get_external_deps(external_deps),
python_version = python_version,
**kwargs
)
def grpc_package(name, visibility = "private", features = []):
"""Creates a package.
Args:
name: The name of the target
visibility: The visibility of the target.
features: The features to enable.
"""
if visibility == "tests":
visibility = ["//test:__subpackages__"]
elif visibility == "public":
visibility = ["//visibility:public"]
elif visibility == "private":
visibility = []
else:
fail("Unknown visibility " + visibility)
if len(visibility) != 0:
# buildifier: disable=native-package
native.package(
default_visibility = visibility,
features = features,
)
def grpc_filegroup(name, srcs, **kwargs):
native.filegroup(
name = name,
srcs = srcs,
**kwargs
)
def grpc_objc_library(
name,
srcs = [],
hdrs = [],
non_arc_srcs = [],
textual_hdrs = [],
testonly = False,
data = [],
deps = [],
defines = [],
sdk_frameworks = [],
includes = [],
visibility = ["//visibility:public"]):
"""The grpc version of objc_library, only used for the Objective-C library compilation
Args:
name: name of target
hdrs: public headers
srcs: all source files (.m)
non_arc_srcs: list of Objective-C files that DO NOT use ARC.
textual_hdrs: private headers
testonly: Whether the binary is for tests only.
data: any other bundle resources
defines: preprocessors
sdk_frameworks: sdks
includes: added to search path, always [the path to objc directory]
deps: dependencies
visibility: visibility, default to public
"""
native.objc_library(
name = name,
hdrs = hdrs,
srcs = srcs,
non_arc_srcs = non_arc_srcs,
textual_hdrs = textual_hdrs,
copts = GRPC_DEFAULT_COPTS + ["-ObjC++", "-std=gnu++14"],
testonly = testonly,
data = data,
deps = deps,
defines = defines,
includes = includes,
sdk_frameworks = sdk_frameworks,
visibility = visibility,
)
def grpc_upb_proto_library(name, deps):
upb_proto_library(name = name, deps = deps)
def grpc_upb_proto_reflection_library(name, deps):
upb_proto_reflection_library(name = name, deps = deps)
# buildifier: disable=unnamed-macro
def python_config_settings():
native.config_setting(
name = "python3",
flag_values = {"@bazel_tools//tools/python:python_version": "PY3"},
)
# buildifier: disable=unnamed-macro
def grpc_clang_cl_settings():
native.platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
)
native.config_setting(
name = "windows_clang",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
)

View File

@ -1,415 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//bazel:grpc_python_deps.bzl", "grpc_python_deps")
# buildifier: disable=unnamed-macro
def grpc_deps():
"""Loads dependencies need to compile and test the grpc library."""
if "platforms" not in native.existing_rules():
http_archive(
name = "platforms",
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
],
)
if "boringssl" not in native.existing_rules():
http_archive(
name = "boringssl",
# Use github mirror instead of https://boringssl.googlesource.com/boringssl
# to obtain a boringssl archive with consistent sha256
sha256 = "9f441d72fccb9a3faf96470478c8ccfaaeb8db1cffd4d78b698f782124dad1b0",
strip_prefix = "boringssl-b8a2bffc598f230484ff48a247526a9820facfc2",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b8a2bffc598f230484ff48a247526a9820facfc2.tar.gz",
"https://github.com/google/boringssl/archive/b8a2bffc598f230484ff48a247526a9820facfc2.tar.gz",
],
)
if "zlib" not in native.existing_rules():
http_archive(
name = "zlib",
build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD",
sha256 = "18337cdb32562003c39d9f7322b9a166ad4abfb2b909566428e11f96d2385586",
strip_prefix = "zlib-09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/madler/zlib/archive/09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851.tar.gz",
"https://github.com/madler/zlib/archive/09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851.tar.gz",
],
)
if "com_google_protobuf" not in native.existing_rules():
http_archive(
name = "com_google_protobuf",
sha256 = "387478260190c540388839a3449c635a69708d92fc38ea6e2364b1196db90ea5",
strip_prefix = "protobuf-2434ef2adf0c74149b9d547ac5fb545a1ff8b6b5",
urls = [
# https://github.com/protocolbuffers/protobuf/commits/v26.1
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/2434ef2adf0c74149b9d547ac5fb545a1ff8b6b5.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/2434ef2adf0c74149b9d547ac5fb545a1ff8b6b5.tar.gz",
],
patches = [
"@com_github_grpc_grpc//third_party:protobuf.patch",
"@com_github_grpc_grpc//third_party:protobuf.10007.patch",
],
patch_args = ["-p1"],
)
if "com_google_googletest" not in native.existing_rules():
http_archive(
name = "com_google_googletest",
sha256 = "31bf78bd91b96dd5e24fab3bb1d7f3f7453ccbaceec9afb86d6e4816a15ab109",
strip_prefix = "googletest-2dd1c131950043a8ad5ab0d2dda0e0970596586a",
urls = [
# 2023-10-09
"https://github.com/google/googletest/archive/2dd1c131950043a8ad5ab0d2dda0e0970596586a.tar.gz",
],
)
if "com_google_fuzztest" not in native.existing_rules():
# when updating this remember to run:
# bazel run @com_google_fuzztest//bazel:setup_configs > tools/fuzztest.bazelrc
http_archive(
name = "com_google_fuzztest",
sha256 = "cdf8d8cd3cdc77280a7c59b310edf234e489a96b6e727cb271e7dfbeb9bcca8d",
strip_prefix = "fuzztest-4ecaeb5084a061a862af8f86789ee184cd3d3f18",
urls = [
# 2023-05-16
"https://github.com/google/fuzztest/archive/4ecaeb5084a061a862af8f86789ee184cd3d3f18.tar.gz",
],
)
if "rules_cc" not in native.existing_rules():
http_archive(
name = "rules_cc",
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
"https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
],
)
if "com_github_google_benchmark" not in native.existing_rules():
http_archive(
name = "com_github_google_benchmark",
sha256 = "8e7b955f04bc6984e4f14074d0d191474f76a6c8e849e04a9dced49bc975f2d4",
strip_prefix = "benchmark-344117638c8ff7e239044fd0fa7085839fc03021",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/344117638c8ff7e239044fd0fa7085839fc03021.tar.gz",
"https://github.com/google/benchmark/archive/344117638c8ff7e239044fd0fa7085839fc03021.tar.gz",
],
)
if "com_googlesource_code_re2" not in native.existing_rules():
http_archive(
name = "com_googlesource_code_re2",
sha256 = "1ae8ccfdb1066a731bba6ee0881baad5efd2cd661acd9569b689f2586e1a50e9",
strip_prefix = "re2-2022-04-01",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/re2/archive/2022-04-01.tar.gz",
"https://github.com/google/re2/archive/2022-04-01.tar.gz",
],
)
if "com_github_cares_cares" not in native.existing_rules():
http_archive(
name = "com_github_cares_cares",
build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD",
sha256 = "bf26e5b25e259911914a85ae847b6d723488adb5af4f8bdeb9d0871a318476e3",
strip_prefix = "c-ares-6360e96b5cf8e5980c887ce58ef727e53d77243a",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/c-ares/c-ares/archive/6360e96b5cf8e5980c887ce58ef727e53d77243a.tar.gz",
"https://github.com/c-ares/c-ares/archive/6360e96b5cf8e5980c887ce58ef727e53d77243a.tar.gz",
],
)
if "com_google_absl" not in native.existing_rules():
http_archive(
name = "com_google_absl",
sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440",
strip_prefix = "abseil-cpp-20240116.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/20240116.0.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/20240116.0.tar.gz",
],
)
if "bazel_toolchains" not in native.existing_rules():
# list of releases is at https://github.com/bazelbuild/bazel-toolchains/releases
http_archive(
name = "bazel_toolchains",
sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024",
strip_prefix = "bazel-toolchains-4.1.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
],
)
if "bazel_skylib" not in native.existing_rules():
http_archive(
name = "bazel_skylib",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
],
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
if "bazel_compdb" not in native.existing_rules():
http_archive(
name = "bazel_compdb",
sha256 = "bcecfd622c4ef272fd4ba42726a52e140b961c4eac23025f18b346c968a8cfb4",
strip_prefix = "bazel-compilation-database-0.4.5",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/grailbio/bazel-compilation-database/archive/0.4.5.tar.gz",
"https://github.com/grailbio/bazel-compilation-database/archive/0.4.5.tar.gz",
],
)
if "io_opencensus_cpp" not in native.existing_rules():
http_archive(
name = "io_opencensus_cpp",
sha256 = "46b3b5812c150a21bacf860c2f76fc42b89773ed77ee954c32adeb8593aa2a8e",
strip_prefix = "opencensus-cpp-5501a1a255805e0be83a41348bb5f2630d5ed6b3",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-cpp/archive/5501a1a255805e0be83a41348bb5f2630d5ed6b3.tar.gz",
"https://github.com/census-instrumentation/opencensus-cpp/archive/5501a1a255805e0be83a41348bb5f2630d5ed6b3.tar.gz",
],
)
if "envoy_api" not in native.existing_rules():
http_archive(
name = "envoy_api",
sha256 = "ddd3beedda1178a79e0d988f76f362002aced09749452515853f106e22bd2249",
strip_prefix = "data-plane-api-78f198cf96ecdc7120ef640406770aa01af775c4",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/data-plane-api/archive/78f198cf96ecdc7120ef640406770aa01af775c4.tar.gz",
"https://github.com/envoyproxy/data-plane-api/archive/78f198cf96ecdc7120ef640406770aa01af775c4.tar.gz",
],
)
if "io_bazel_rules_go" not in native.existing_rules():
http_archive(
name = "io_bazel_rules_go",
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
],
)
if "build_bazel_rules_apple" not in native.existing_rules():
http_archive(
name = "build_bazel_rules_apple",
sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz",
"https://github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz",
],
)
if "build_bazel_apple_support" not in native.existing_rules():
http_archive(
name = "build_bazel_apple_support",
sha256 = "cf4d63f39c7ba9059f70e995bf5fe1019267d3f77379c2028561a5d7645ef67c",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz",
"https://github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz",
],
)
if "com_google_googleapis" not in native.existing_rules():
http_archive(
name = "com_google_googleapis",
sha256 = "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0",
strip_prefix = "googleapis-2f9af297c84c55c8b871ba4495e01ade42476c92",
build_file = Label("//bazel:googleapis.BUILD"),
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz",
"https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz",
],
)
if "bazel_gazelle" not in native.existing_rules():
http_archive(
name = "bazel_gazelle",
sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
],
)
if "opencensus_proto" not in native.existing_rules():
http_archive(
name = "opencensus_proto",
sha256 = "b7e13f0b4259e80c3070b583c2f39e53153085a6918718b1c710caf7037572b0",
strip_prefix = "opencensus-proto-0.3.0/src",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz",
"https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz",
],
)
if "com_envoyproxy_protoc_gen_validate" not in native.existing_rules():
http_archive(
name = "com_envoyproxy_protoc_gen_validate",
strip_prefix = "protoc-gen-validate-4694024279bdac52b77e22dc87808bd0fd732b69",
sha256 = "1e490b98005664d149b379a9529a6aa05932b8a11b76b4cd86f3d22d76346f47",
urls = [
"https://github.com/envoyproxy/protoc-gen-validate/archive/4694024279bdac52b77e22dc87808bd0fd732b69.tar.gz",
],
patches = ["@com_github_grpc_grpc//third_party:protoc-gen-validate.patch"],
patch_args = ["-p1"],
)
if "com_github_cncf_xds" not in native.existing_rules():
http_archive(
name = "com_github_cncf_xds",
sha256 = "dc305e20c9fa80822322271b50aa2ffa917bf4fd3973bcec52bfc28dc32c5927",
strip_prefix = "xds-3a472e524827f72d1ad621c4983dd5af54c46776",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/cncf/xds/archive/3a472e524827f72d1ad621c4983dd5af54c46776.tar.gz",
"https://github.com/cncf/xds/archive/3a472e524827f72d1ad621c4983dd5af54c46776.tar.gz",
],
)
# TODO(stanleycheung): remove this when prometheus-cpp AND
# opentelemetry-cpp cut a new release
# This override is needed because this fix
# https://github.com/jupp0r/prometheus-cpp/pull/626
# has not been included in the latest prometheus-cpp release yet.
# We also need opentelemetry-cpp to update their dependency on
# prometheus-cpp after that fix is released.
# Without the fix, we cannot build the prometheus exporter with bazel 6
if "com_github_jupp0r_prometheus_cpp" not in native.existing_rules():
http_archive(
name = "com_github_jupp0r_prometheus_cpp",
strip_prefix = "prometheus-cpp-b1234816facfdda29845c46696a02998a4af115a",
urls = [
"https://github.com/jupp0r/prometheus-cpp/archive/b123481.zip",
],
)
if "io_opentelemetry_cpp" not in native.existing_rules():
http_archive(
name = "io_opentelemetry_cpp",
sha256 = "ed681d20a684b7d485a49288e7cfb2d182bf882e5c112c5f2fa3f9e9da2278fc",
strip_prefix = "opentelemetry-cpp-4bd64c9a336fd438d6c4c9dad2e6b61b0585311f",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/open-telemetry/opentelemetry-cpp/archive/4bd64c9a336fd438d6c4c9dad2e6b61b0585311f.tar.gz",
"https://github.com/open-telemetry/opentelemetry-cpp/archive/4bd64c9a336fd438d6c4c9dad2e6b61b0585311f.tar.gz",
],
)
if "google_cloud_cpp" not in native.existing_rules():
http_archive(
name = "google_cloud_cpp",
sha256 = "7ca7f583b60d2aa1274411fed3b9fb3887119b2e84244bb3fc69ea1db819e4e5",
strip_prefix = "google-cloud-cpp-2.16.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.16.0.tar.gz",
"https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.16.0.tar.gz",
],
)
grpc_python_deps()
# TODO: move some dependencies from "grpc_deps" here?
# buildifier: disable=unnamed-macro
def grpc_test_only_deps():
"""Internal, not intended for use by packages that are consuming grpc.
Loads dependencies that are only needed to run grpc library's tests.
"""
if "com_github_twisted_twisted" not in native.existing_rules():
http_archive(
name = "com_github_twisted_twisted",
sha256 = "ca17699d0d62eafc5c28daf2c7d0a18e62ae77b4137300b6c7d7868b39b06139",
strip_prefix = "twisted-twisted-17.5.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/twisted/archive/twisted-17.5.0.zip",
"https://github.com/twisted/twisted/archive/twisted-17.5.0.zip",
],
build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD",
)
if "com_github_yaml_pyyaml" not in native.existing_rules():
http_archive(
name = "com_github_yaml_pyyaml",
sha256 = "e34d97db6d846f5e2ad51417fd646e7ce6a3a70726ccea2a857e0580a7155f39",
strip_prefix = "pyyaml-6.0.1",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/yaml/pyyaml/archive/6.0.1.zip",
"https://github.com/yaml/pyyaml/archive/6.0.1.zip",
],
build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD",
)
if "com_github_twisted_incremental" not in native.existing_rules():
http_archive(
name = "com_github_twisted_incremental",
sha256 = "f0ca93359ee70243ff7fbf2d904a6291810bd88cb80ed4aca6fa77f318a41a36",
strip_prefix = "incremental-incremental-17.5.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/incremental/archive/incremental-17.5.0.zip",
"https://github.com/twisted/incremental/archive/incremental-17.5.0.zip",
],
build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD",
)
if "com_github_zopefoundation_zope_interface" not in native.existing_rules():
http_archive(
name = "com_github_zopefoundation_zope_interface",
sha256 = "e9579fc6149294339897be3aa9ecd8a29217c0b013fe6f44fcdae00e3204198a",
strip_prefix = "zope.interface-4.4.3",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/zopefoundation/zope.interface/archive/4.4.3.zip",
"https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip",
],
build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD",
)
if "com_github_twisted_constantly" not in native.existing_rules():
http_archive(
name = "com_github_twisted_constantly",
sha256 = "2702cd322161a579d2c0dbf94af4e57712eedc7bd7bbbdc554a230544f7d346c",
strip_prefix = "constantly-15.1.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/constantly/archive/15.1.0.zip",
"https://github.com/twisted/constantly/archive/15.1.0.zip",
],
build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD",
)
if "com_google_libprotobuf_mutator" not in native.existing_rules():
http_archive(
name = "com_google_libprotobuf_mutator",
sha256 = "9c8f800aed088cdf89adc3eaaa66b56b4da7da041f26338aa71a2ab43d860d46",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/libprotobuf-mutator/archive/1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d.tar.gz",
"https://github.com/google/libprotobuf-mutator/archive/1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d.tar.gz",
],
strip_prefix = "libprotobuf-mutator-1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d",
build_file = "@com_github_grpc_grpc//third_party:libprotobuf_mutator.BUILD",
)

View File

@ -1,76 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Loads the dependencies necessary for the external repositories defined in grpc_deps.bzl."""
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
load("@com_envoyproxy_protoc_gen_validate//:dependencies.bzl", "go_third_party")
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@rules_python//python:repositories.bzl", "py_repositories")
def grpc_extra_deps(ignore_version_differences = False):
"""Loads the extra dependencies.
These are necessary for using the external repositories defined in
grpc_deps.bzl. Projects that depend on gRPC as an external repository need
to call both grpc_deps and grpc_extra_deps, if they have not already loaded
the extra dependencies. For example, they can do the following in their
WORKSPACE
```
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps", "grpc_test_only_deps")
grpc_deps()
grpc_test_only_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
```
Args:
ignore_version_differences: Plumbed directly to the invocation of
apple_rules_dependencies.
"""
protobuf_deps()
api_dependencies()
go_rules_dependencies()
go_register_toolchains(version = "1.20")
gazelle_dependencies()
# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
# needed for building C++ xDS protos
go_third_party()
apple_rules_dependencies(ignore_version_differences = ignore_version_differences)
apple_support_dependencies()
# Initialize Google APIs with only C++ and Python targets
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
grpc = True,
python = True,
)
google_cloud_cpp_deps()
py_repositories()

View File

@ -1,46 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Load dependencies needed to compile and test the grpc python library as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
# buildifier: disable=unnamed-macro
def grpc_python_deps():
"""Loads dependencies for gRPC Python."""
if "rules_python" not in native.existing_rules():
http_archive(
name = "rules_python",
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
strip_prefix = "rules_python-0.26.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
)
python_configure(name = "local_config_python")
native.bind(
name = "python_headers",
actual = "@local_config_python//:python_headers",
)
if "cython" not in native.existing_rules():
http_archive(
name = "cython",
build_file = "@com_github_grpc_grpc//third_party:cython.BUILD",
sha256 = "a2da56cc22be823acf49741b9aa3aa116d4f07fa8e8b35a3cb08b8447b37c607",
strip_prefix = "cython-0.29.35",
urls = [
"https://github.com/cython/cython/archive/0.29.35.tar.gz",
],
)

View File

@ -1,72 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Follows convention set in objectivec_helpers.cc in the protobuf ObjC compiler.
"""
Contains generic helper utilities.
"""
_upper_segments_list = ["url", "http", "https"]
def strip_extension(str):
return str.rpartition(".")[0]
def capitalize(word):
if word in _upper_segments_list:
return word.upper()
else:
return word.capitalize()
def lower_underscore_to_upper_camel(str):
"""Converts from lower underscore case to upper camel case.
Args:
str: The snake case string to convert.
Returns:
The title case version of str.
"""
str = strip_extension(str)
camel_case_str = ""
word = ""
for c in str.elems(): # NB: assumes ASCII!
if c.isalpha():
word += c.lower()
else:
# Last word is finished.
if len(word):
camel_case_str += capitalize(word)
word = ""
if c.isdigit():
camel_case_str += c
# Otherwise, drop the character. See UnderscoresToCamelCase in:
# third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
if len(word):
camel_case_str += capitalize(word)
return camel_case_str
def file_to_upper_camel(src):
elements = src.rpartition("/")
upper_camel = lower_underscore_to_upper_camel(elements[-1])
return "".join(list(elements[:-1]) + [upper_camel])
def file_with_extension(src, ext):
elements = src.rpartition("/")
return "".join(list(elements[:-1]) + [elements[-1], "." + ext])
def to_upper_camel_with_extension(src, ext):
src = file_to_upper_camel(src)
return file_with_extension(src, ext)

View File

@ -1,43 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Python-related rules intended only for use internal to the repo."""
load("//bazel:gevent_test.bzl", "py_grpc_gevent_test")
def internal_py_grpc_test(name, **kwargs):
"""Runs a test under all supported environments.
Args:
name: The name of the test.
**kwargs: Any additional arguments to add to the test.
"""
native.py_test(
name = name + ".native",
python_version = "PY3",
**kwargs
)
py_grpc_gevent_test(name, **kwargs)
suite_kwargs = {}
if "visibility" in kwargs:
suite_kwargs["visibility"] = kwargs["visibility"]
native.test_suite(
name = name,
tests = [
name + ".native",
name + ".gevent",
],
**suite_kwargs
)

View File

@ -1,84 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Contains the objc_grpc_library rule.
"""
load(
"//bazel:generate_objc.bzl",
"generate_objc",
"generate_objc_hdrs",
"generate_objc_non_arc_srcs",
"generate_objc_srcs",
)
def objc_grpc_library(name, deps, srcs = [], use_well_known_protos = False, **kwargs):
"""Generates messages and/or service stubs for given proto_library and all transitively dependent proto files
Args:
name: name of target
deps: a list of proto_library targets that needs to be compiled
srcs: a list of labels to proto files with service stubs to be generated,
labels specified must include service stubs; otherwise Bazel will complain about srcs being empty
use_well_known_protos: whether to use the well known protos defined in
@com_google_protobuf//src/google/protobuf, default to false
**kwargs: other arguments
"""
objc_grpc_library_name = "_" + name + "_objc_grpc_library"
generate_objc(
name = objc_grpc_library_name,
srcs = srcs,
deps = deps,
use_well_known_protos = use_well_known_protos,
**kwargs
)
generate_objc_hdrs(
name = objc_grpc_library_name + "_hdrs",
src = ":" + objc_grpc_library_name,
)
generate_objc_non_arc_srcs(
name = objc_grpc_library_name + "_non_arc_srcs",
src = ":" + objc_grpc_library_name,
)
arc_srcs = None
if len(srcs) > 0:
generate_objc_srcs(
name = objc_grpc_library_name + "_srcs",
src = ":" + objc_grpc_library_name,
)
arc_srcs = [":" + objc_grpc_library_name + "_srcs"]
native.objc_library(
name = name,
hdrs = [":" + objc_grpc_library_name + "_hdrs"],
non_arc_srcs = [":" + objc_grpc_library_name + "_non_arc_srcs"],
srcs = arc_srcs,
defines = [
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0",
"GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO=0",
],
includes = [
"_generated_protos",
"src/objective-c",
],
deps = [
"@com_github_grpc_grpc//src/objective-c:proto_objc_rpc",
"@com_google_protobuf//:protobuf_objc",
],
**kwargs
)

View File

@ -1,37 +0,0 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
platform(
name = "x86_64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_64",
],
)
platform(
name = "arm64-v8a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:arm64",
],
)
platform(
name = "armeabi-v7a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:armv7",
],
)

View File

@ -1,341 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utility functions for generating protobuf code."""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
_PROTO_EXTENSION = ".proto"
_VIRTUAL_IMPORTS = "/_virtual_imports/"
_WELL_KNOWN_PROTOS_BASE = [
"any_proto",
"api_proto",
"compiler_plugin_proto",
"descriptor_proto",
"duration_proto",
"empty_proto",
"field_mask_proto",
"source_context_proto",
"struct_proto",
"timestamp_proto",
"type_proto",
"wrappers_proto",
]
def well_known_proto_libs():
return ["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE]
def is_well_known(label):
# Bazel surfaces labels as their undelying identity, even if they are referenced
# via aliases. Bazel also does not currently provide a way to find the real label
# underlying an alias. So the implementation detail that the WKTs present at the
# top level of the protobuf repo are actually backed by targets in the
# //src/google/protobuf package leaks through here.
# We include both the alias path and the underlying path to be resilient to
# reversions of this change as well as for continuing compatiblity with repos
# that happen to pull in older versions of protobuf.
all_wkt_targets = (["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE] +
["@com_google_protobuf//src/google/protobuf:" + b for b in _WELL_KNOWN_PROTOS_BASE])
return label in all_wkt_targets
def get_proto_root(workspace_root):
"""Gets the root protobuf directory.
Args:
workspace_root: context.label.workspace_root
Returns:
The directory relative to which generated include paths should be.
"""
if workspace_root:
return "/{}".format(workspace_root)
else:
return ""
def _strip_proto_extension(proto_filename):
if not proto_filename.endswith(_PROTO_EXTENSION):
fail('"{}" does not end with "{}"'.format(
proto_filename,
_PROTO_EXTENSION,
))
return proto_filename[:-len(_PROTO_EXTENSION)]
def proto_path_to_generated_filename(proto_path, fmt_str):
"""Calculates the name of a generated file for a protobuf path.
For example, "examples/protos/helloworld.proto" might map to
"helloworld.pb.h".
Args:
proto_path: The path to the .proto file.
fmt_str: A format string used to calculate the generated filename. For
example, "{}.pb.h" might be used to calculate a C++ header filename.
Returns:
The generated filename.
"""
return fmt_str.format(_strip_proto_extension(proto_path))
def get_include_directory(source_file):
"""Returns the include directory path for the source_file.
All of the include statements within the given source_file are calculated
relative to the directory returned by this method.
The returned directory path can be used as the "--proto_path=" argument
value.
Args:
source_file: A proto file.
Returns:
The include directory path for the source_file.
"""
directory = source_file.path
prefix_len = 0
if is_in_virtual_imports(source_file):
root, relative = source_file.path.split(_VIRTUAL_IMPORTS, 2)
result = root + _VIRTUAL_IMPORTS + relative.split("/", 1)[0]
return result
if not source_file.is_source and directory.startswith(source_file.root.path):
prefix_len = len(source_file.root.path) + 1
if directory.startswith("external", prefix_len):
external_separator = directory.find("/", prefix_len)
repository_separator = directory.find("/", external_separator + 1)
return directory[:repository_separator]
else:
return source_file.root.path if source_file.root.path else "."
def get_plugin_args(
plugin,
flags,
dir_out,
generate_mocks,
plugin_name = "PLUGIN"):
"""Returns arguments configuring protoc to use a plugin for a language.
Args:
plugin: An executable file to run as the protoc plugin.
flags: The plugin flags to be passed to protoc.
dir_out: The output directory for the plugin.
generate_mocks: A bool indicating whether to generate mocks.
plugin_name: A name of the plugin, it is required to be unique when there
are more than one plugin used in a single protoc command.
Returns:
A list of protoc arguments configuring the plugin.
"""
augmented_flags = list(flags)
if generate_mocks:
augmented_flags.append("generate_mock_code=true")
augmented_dir_out = dir_out
if augmented_flags:
augmented_dir_out = ",".join(augmented_flags) + ":" + dir_out
return [
"--plugin=protoc-gen-{plugin_name}={plugin_path}".format(
plugin_name = plugin_name,
plugin_path = plugin.path,
),
"--{plugin_name}_out={dir_out}".format(
plugin_name = plugin_name,
dir_out = augmented_dir_out,
),
]
def _make_prefix(label):
"""Returns the directory prefix for a label.
@repo//foo/bar:sub/dir/file.proto => 'external/repo/foo/bar/'
//foo/bar:sub/dir/file.proto => 'foo/bar/'
//:sub/dir/file.proto => ''
That is, the prefix can be removed from a file's full path to
obtain the file's relative location within the package's effective
directory."""
wsr = label.workspace_root
pkg = label.package
if not wsr and not pkg:
return ""
elif not wsr:
return pkg + "/"
elif not pkg:
return wsr + "/"
else:
return wsr + "/" + pkg + "/"
def get_staged_proto_file(label, context, source_file):
"""Copies a proto file to the appropriate location if necessary.
Args:
label: The label of the rule using the .proto file.
context: The ctx object for the rule or aspect.
source_file: The original .proto file.
Returns:
The original proto file OR a new file in the staged location.
"""
if source_file.dirname == label.package or \
is_in_virtual_imports(source_file):
# Current target and source_file are in same package
return source_file
else:
# Current target and source_file are in different packages (most
# probably even in different repositories)
prefix = _make_prefix(source_file.owner)
copied_proto = context.actions.declare_file(source_file.path[len(prefix):])
context.actions.run_shell(
inputs = [source_file],
outputs = [copied_proto],
command = "cp {} {}".format(source_file.path, copied_proto.path),
mnemonic = "CopySourceProto",
)
return copied_proto
def protos_from_context(context):
"""Copies proto files to the appropriate location.
Args:
context: The ctx object for the rule.
Returns:
A list of the protos.
"""
protos = []
for src in context.attr.deps:
for file in src[ProtoInfo].direct_sources:
protos.append(get_staged_proto_file(context.label, context, file))
return protos
def includes_from_deps(deps):
"""Get includes from rule dependencies."""
return [
file
for src in deps
for file in src[ProtoInfo].transitive_imports.to_list()
]
def get_proto_arguments(protos, genfiles_dir_path):
"""Get the protoc arguments specifying which protos to compile.
Args:
protos: The protob files to supply.
genfiles_dir_path: The path to the genfiles directory.
Returns:
The arguments to supply to protoc.
"""
arguments = []
for proto in protos:
strip_prefix_len = 0
if is_in_virtual_imports(proto):
incl_directory = get_include_directory(proto)
if proto.path.startswith(incl_directory):
strip_prefix_len = len(incl_directory) + 1
elif proto.path.startswith(genfiles_dir_path):
strip_prefix_len = len(genfiles_dir_path) + 1
arguments.append(proto.path[strip_prefix_len:])
return arguments
def declare_out_files(protos, context, generated_file_format):
"""Declares and returns the files to be generated.
Args:
protos: A list of files. The protos to declare.
context: The context object.
generated_file_format: A format string. Will be passed to
proto_path_to_generated_filename to generate the filename of each
generated file.
Returns:
A list of file providers.
"""
out_file_paths = []
for proto in protos:
if not is_in_virtual_imports(proto):
prefix = _make_prefix(proto.owner)
full_prefix = context.genfiles_dir.path + "/" + prefix
if proto.path.startswith(full_prefix):
out_file_paths.append(proto.path[len(full_prefix):])
elif proto.path.startswith(prefix):
out_file_paths.append(proto.path[len(prefix):])
else:
out_file_paths.append(proto.path[proto.path.index(_VIRTUAL_IMPORTS) + 1:])
return [
context.actions.declare_file(
proto_path_to_generated_filename(
out_file_path,
generated_file_format,
),
)
for out_file_path in out_file_paths
]
def get_out_dir(protos, context):
"""Returns the value to supply to the --<lang>_out= protoc flag.
The result is based on the input source proto files and current context.
Args:
protos: A list of protos to be used as source files in protoc command
context: A ctx object for the rule.
Returns:
The value of --<lang>_out= argument.
"""
at_least_one_virtual = 0
for proto in protos:
if is_in_virtual_imports(proto):
at_least_one_virtual = True
elif at_least_one_virtual:
fail("Proto sources must be either all virtual imports or all real")
if at_least_one_virtual:
out_dir = get_include_directory(protos[0])
ws_root = protos[0].owner.workspace_root
prefix = "/" + _make_prefix(protos[0].owner) + _VIRTUAL_IMPORTS[1:]
return struct(
path = out_dir,
import_path = out_dir[out_dir.find(prefix) + 1:],
)
out_dir = context.genfiles_dir.path
ws_root = context.label.workspace_root
if ws_root:
out_dir = out_dir + "/" + ws_root
return struct(path = out_dir, import_path = None)
def is_in_virtual_imports(source_file, virtual_folder = _VIRTUAL_IMPORTS):
"""Determines if source_file is virtual.
A file is virtual if placed in the _virtual_imports subdirectory. The
output of all proto_library targets which use import_prefix and/or
strip_import_prefix arguments is placed under _virtual_imports directory.
Args:
source_file: A proto file.
virtual_folder: The virtual folder name (is set to "_virtual_imports"
by default)
Returns:
True if source_file is located under _virtual_imports, False otherwise.
"""
return not source_file.is_source and virtual_folder in source_file.path

View File

@ -1,310 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Generates and compiles Python gRPC stubs from proto_library rules."""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"declare_out_files",
"get_include_directory",
"get_out_dir",
"get_plugin_args",
"get_proto_arguments",
"get_staged_proto_file",
"includes_from_deps",
"is_well_known",
"protos_from_context",
)
_GENERATED_PROTO_FORMAT = "{}_pb2.py"
_GENERATED_PROTO_STUB_FORMAT = "{}_pb2.pyi"
_GENERATED_GRPC_PROTO_FORMAT = "{}_pb2_grpc.py"
PyProtoInfo = provider(
"The Python outputs from the Protobuf compiler.",
fields = {
"py_info": "A PyInfo provider for the generated code.",
"generated_py_srcs": "The direct (not transitive) generated Python source files.",
},
)
def _merge_pyinfos(pyinfos):
return PyInfo(
transitive_sources = depset(transitive = [p.transitive_sources for p in pyinfos]),
imports = depset(transitive = [p.imports for p in pyinfos]),
)
def _gen_py_aspect_impl(target, context):
# Early return for well-known protos.
if is_well_known(str(context.label)):
return [
PyProtoInfo(
py_info = context.attr._protobuf_library[PyInfo],
generated_py_srcs = [],
),
]
protos = []
for p in target[ProtoInfo].direct_sources:
protos.append(get_staged_proto_file(target.label, context, p))
includes = depset(direct = protos, transitive = [target[ProtoInfo].transitive_imports])
out_files = (declare_out_files(protos, context, _GENERATED_PROTO_FORMAT) +
declare_out_files(protos, context, _GENERATED_PROTO_STUB_FORMAT))
generated_py_srcs = out_files
tools = [context.executable._protoc]
out_dir = get_out_dir(protos, context)
arguments = ([
"--python_out={}".format(out_dir.path),
"--pyi_out={}".format(out_dir.path),
] + [
"--proto_path={}".format(get_include_directory(i))
for i in includes.to_list()
] + [
"--proto_path={}".format(context.genfiles_dir.path),
])
arguments += get_proto_arguments(protos, context.genfiles_dir.path)
context.actions.run(
inputs = protos + includes.to_list(),
tools = tools,
outputs = out_files,
executable = context.executable._protoc,
arguments = arguments,
mnemonic = "ProtocInvocation",
)
imports = []
if out_dir.import_path:
imports.append("{}/{}".format(context.workspace_name, out_dir.import_path))
py_info = PyInfo(transitive_sources = depset(direct = out_files), imports = depset(direct = imports))
return PyProtoInfo(
py_info = _merge_pyinfos(
[
py_info,
context.attr._protobuf_library[PyInfo],
] + [dep[PyProtoInfo].py_info for dep in context.rule.attr.deps],
),
generated_py_srcs = generated_py_srcs,
)
_gen_py_aspect = aspect(
implementation = _gen_py_aspect_impl,
attr_aspects = ["deps"],
fragments = ["py"],
attrs = {
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
providers = ["files_to_run"],
executable = True,
cfg = "exec",
),
"_protobuf_library": attr.label(
default = Label("@com_google_protobuf//:protobuf_python"),
providers = [PyInfo],
),
},
)
def _generate_py_impl(context):
if (len(context.attr.deps) != 1):
fail("Can only compile a single proto at a time.")
py_sources = []
# If the proto_library this rule *directly* depends on is in another
# package, then we generate .py files to import them in this package. This
# behavior is needed to allow rearranging of import paths to make Bazel
# outputs align with native python workflows.
#
# Note that this approach is vulnerable to protoc defining __all__ or other
# symbols with __ prefixes that need to be directly imported. Since these
# names are likely to be reserved for private APIs, the risk is minimal.
if context.label.package != context.attr.deps[0].label.package:
for py_src in context.attr.deps[0][PyProtoInfo].generated_py_srcs:
reimport_py_file = context.actions.declare_file(py_src.basename)
py_sources.append(reimport_py_file)
import_line = "from %s import *" % py_src.short_path.replace("..", "external").replace("/", ".")[:-len(".py")]
context.actions.write(reimport_py_file, import_line)
# Collect output PyInfo provider.
imports = [context.label.package + "/" + i for i in context.attr.imports]
py_info = PyInfo(transitive_sources = depset(direct = py_sources), imports = depset(direct = imports))
out_pyinfo = _merge_pyinfos([py_info, context.attr.deps[0][PyProtoInfo].py_info])
runfiles = context.runfiles(files = out_pyinfo.transitive_sources.to_list()).merge(context.attr._protobuf_library[DefaultInfo].data_runfiles)
return [
DefaultInfo(
files = out_pyinfo.transitive_sources,
runfiles = runfiles,
),
out_pyinfo,
]
py_proto_library = rule(
attrs = {
"deps": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [ProtoInfo],
aspects = [_gen_py_aspect],
),
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
providers = ["files_to_run"],
executable = True,
cfg = "exec",
),
"_protobuf_library": attr.label(
default = Label("@com_google_protobuf//:protobuf_python"),
providers = [PyInfo],
),
"imports": attr.string_list(),
},
implementation = _generate_py_impl,
)
def _generate_pb2_grpc_src_impl(context):
protos = protos_from_context(context)
includes = includes_from_deps(context.attr.deps)
out_files = declare_out_files(protos, context, _GENERATED_GRPC_PROTO_FORMAT)
plugin_flags = ["grpc_2_0"] + context.attr.strip_prefixes
arguments = []
tools = [context.executable._protoc, context.executable._grpc_plugin]
out_dir = get_out_dir(protos, context)
if out_dir.import_path:
# is virtual imports
out_path = out_dir.path
else:
out_path = context.genfiles_dir.path
arguments += get_plugin_args(
context.executable._grpc_plugin,
plugin_flags,
out_path,
False,
)
arguments += [
"--proto_path={}".format(get_include_directory(i))
for i in includes
]
arguments.append("--proto_path={}".format(context.genfiles_dir.path))
arguments += get_proto_arguments(protos, context.genfiles_dir.path)
context.actions.run(
inputs = protos + includes,
tools = tools,
outputs = out_files,
executable = context.executable._protoc,
arguments = arguments,
mnemonic = "ProtocInvocation",
)
p = PyInfo(transitive_sources = depset(direct = out_files))
py_info = _merge_pyinfos(
[
p,
context.attr.grpc_library[PyInfo],
] + [dep[PyInfo] for dep in context.attr.py_deps],
)
runfiles = context.runfiles(files = out_files, transitive_files = py_info.transitive_sources).merge(context.attr.grpc_library[DefaultInfo].data_runfiles)
return [
DefaultInfo(
files = depset(direct = out_files),
runfiles = runfiles,
),
py_info,
]
_generate_pb2_grpc_src = rule(
attrs = {
"deps": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [ProtoInfo],
),
"py_deps": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [PyInfo],
),
"strip_prefixes": attr.string_list(),
"_grpc_plugin": attr.label(
executable = True,
providers = ["files_to_run"],
cfg = "exec",
default = Label("//src/compiler:grpc_python_plugin"),
),
"_protoc": attr.label(
executable = True,
providers = ["files_to_run"],
cfg = "exec",
default = Label("@com_google_protobuf//:protoc"),
),
"grpc_library": attr.label(
default = Label("//src/python/grpcio/grpc:grpcio"),
providers = [PyInfo],
),
},
implementation = _generate_pb2_grpc_src_impl,
)
def py_grpc_library(
name,
srcs,
deps,
strip_prefixes = [],
grpc_library = Label("//src/python/grpcio/grpc:grpcio"),
**kwargs):
"""Generate python code for gRPC services defined in a protobuf.
Args:
name: The name of the target.
srcs: (List of `labels`) a single proto_library target containing the
schema of the service.
deps: (List of `labels`) a single py_proto_library target for the
proto_library in `srcs`.
strip_prefixes: (List of `strings`) If provided, this prefix will be
stripped from the beginning of foo_pb2 modules imported by the
generated stubs. This is useful in combination with the `imports`
attribute of the `py_library` rule.
grpc_library: (`label`) a single `py_library` target representing the
python gRPC library target to be depended upon. This can be used to
generate code that depends on `grpcio` from the Python Package Index.
**kwargs: Additional arguments to be supplied to the invocation of
py_library.
"""
if len(srcs) != 1:
fail("Can only compile a single proto at a time.")
if len(deps) != 1:
fail("Deps must have length 1.")
_generate_pb2_grpc_src(
name = name,
deps = srcs,
py_deps = deps,
strip_prefixes = strip_prefixes,
grpc_library = grpc_library,
**kwargs
)

View File

@ -1,2 +0,0 @@
7.1.0
6.5.0

View File

@ -1,60 +0,0 @@
# Copyright 2023 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto generated by tools/codegen/core/gen_experiments.py
"""Dictionary of tags to experiments so we know when to test different experiments."""
TEST_EXPERIMENT_ENABLES = {
"test_experiment_1": "test_experiment_1",
"test_experiment_2": "test_experiment_2",
"test_experiment_3": "test_experiment_3",
"test_experiment_4": "test_experiment_4",
}
TEST_EXPERIMENT_POLLERS = [
]
TEST_EXPERIMENTS = {
"windows": {
"dbg": {
},
"off": {
"experiments_tag_test": [
"test_experiment_1",
],
},
"on": {
},
},
"ios": {
"dbg": {
},
"off": {
},
"on": {
},
},
"posix": {
"dbg": {
},
"off": {
},
"on": {
"experiments_tag_test": [
"test_experiment_1",
],
},
},
}

View File

@ -1,71 +0,0 @@
#!/bin/bash
# Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Script to upload github archives for bazel dependencies to GCS, creating a reliable mirror link.
# Archives are copied to "grpc-bazel-mirror" GCS bucket (https://console.cloud.google.com/storage/browser/grpc-bazel-mirror?project=grpc-testing)
# and will by downloadable with the https://storage.googleapis.com/grpc-bazel-mirror/ prefix.
#
# This script should be run each time bazel dependencies are updated.
set -e
cd $(dirname $0)/..
# Create a temp directory to hold the versioned tarball,
# and clean it up when the script exits.
tmpdir="$(mktemp -d)"
function cleanup {
rm -rf "$tmpdir"
}
trap cleanup EXIT
function upload {
local file="$1"
if gsutil stat "gs://grpc-bazel-mirror/${file}" > /dev/null
then
echo "Skipping ${file}"
else
echo "Downloading https://${file}"
curl -L --fail --output "${tmpdir}/archive" "https://${file}"
echo "Uploading https://${file} to https://storage.googleapis.com/grpc-bazel-mirror/${file}"
gsutil cp "${tmpdir}/archive" "gs://grpc-bazel-mirror/${file}"
rm -rf "${tmpdir}/archive"
fi
}
# How to check that all mirror URLs work:
# 1. clean $HOME/.cache/bazel
# 2. bazel clean --expunge
# 3. bazel sync (failed downloads will print warnings)
# A specific link can be upload manually by running e.g.
# upload "github.com/google/boringssl/archive/1c2769383f027befac5b75b6cedd25daf3bf4dcf.tar.gz"
# bazel binaries used by the tools/bazel wrapper script
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-windows-x86_64.exe
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-linux-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-windows-x86_64.exe
# Collect the github archives to mirror from grpc_deps.bzl
grep -o '"https://github.com/[^"]*"' bazel/grpc_deps.bzl | sed 's/^"https:\/\///' | sed 's/"$//' | while read -r line ; do
echo "Updating mirror for ${line}"
upload "${line}"
done

View File

@ -1,55 +0,0 @@
[tool.black]
line-length = 80
target-version = [
"py37",
"py38",
"py39",
"py310",
"py311",
]
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
(
site-packages
| test/cpp/naming/resolver_component_tests_runner.py # AUTO-GENERATED
# AUTO-GENERATED from a template:
| grpc_version.py
| src/python/grpcio/grpc_core_dependencies.py
| src/python/grpcio/grpc/_grpcio_metadata.py
# AUTO-GENERATED BY make_grpcio_tools.py
| tools/distrib/python/grpcio_tools/protoc_lib_deps.py
# AUTO-GENERATED BY make_grpcio_observability.py
| src/python/grpcio_observability/observability_lib_deps.py
| .*_pb2.py # autogenerated Protocol Buffer files
| .*_pb2_grpc.py # autogenerated Protocol Buffer gRPC files
# AUTO-GENERATED By tools/distrib/python/xds_protos/build.py
| tools/distrib/python/xds_protos/.*
)
'''
[tool.isort]
profile = "black"
line_length = 80
src_paths = [
"examples/python/data_transmission",
"examples/python/async_streaming",
"src/python/grpcio_tests",
"tools/run_tests",
]
known_first_party = [
"examples",
"src",
]
known_third_party = ["grpc"]
skip_glob = [
"*/third_party/*",
"*/env/*",
"*pb2*.py",
"*pb2*.pyi",
"**/site-packages/**/*",
"tools/distrib/python/xds_protos/*",
]
single_line_exclusions = ["typing"]
force_single_line = true
force_sort_within_sections = true

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +0,0 @@
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-42.dll'
end

View File

@ -1,216 +0,0 @@
'#1': This file describes the list of targets and dependencies.
'#2': It is used among other things to generate all of our project files.
'#3': Please refer to the templates directory for more information.
settings:
'#01': The public version number of the library.
'#02': ===
'#03': Please update the 'g_stands_for' field periodically with a new g word
'#04': not listed in doc/g_stands_for.md - and update that document to list the
'#05': new word. When doing so, please also update BUILD.
'#06': ===
'#07': Master always has a "-dev" suffix
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
core_version: 42.0.0
csharp_major_version: 2
g_stands_for: gnarly
protobuf_version: 3.26.1
version: 1.65.0-dev
configs:
asan:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=address -fno-omit-frame-pointer
-Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
LD: clang++
LDFLAGS: -fsanitize=address
LDXX: clang++
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
LSAN_OPTIONS: suppressions=test/core/test_util/lsan_suppressions.txt:report_objects=1
asan-noleaks:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=address -fno-omit-frame-pointer
-Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
LD: clang++
LDFLAGS: fsanitize=address
LDXX: clang++
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=0:color=always
asan-trace-cmp:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize-coverage=trace-cmp
-fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
-DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
LD: clang++
LDFLAGS: -fsanitize=address
LDXX: clang++
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
LSAN_OPTIONS: suppressions=test/core/test_util/lsan_suppressions.txt:report_objects=1
c++-compat:
CFLAGS: -Wc++-compat
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
dbg:
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
gcov:
CC: gcc
CPPFLAGS: -O0 -fprofile-arcs -ftest-coverage -Wno-return-type
CXX: g++
DEFINES: _DEBUG DEBUG GPR_GCOV
LD: gcc
LDFLAGS: -fprofile-arcs -ftest-coverage -rdynamic -lstdc++
LDXX: g++
helgrind:
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
LDFLAGS: -rdynamic
valgrind: --tool=helgrind
lto:
CPPFLAGS: -O2
DEFINES: NDEBUG
memcheck:
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
LDFLAGS: -rdynamic
valgrind: --tool=memcheck --leak-check=full
msan:
CC: clang
CPPFLAGS: -O0 -stdlib=libc++ -fsanitize-coverage=edge,trace-pc-guard -fsanitize=memory
-fsanitize-memory-track-origins -fsanitize-memory-use-after-dtor -fno-omit-frame-pointer
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument
-fPIE -pie -DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
DEFINES: NDEBUG
LD: clang++
LDFLAGS: -stdlib=libc++ -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
-fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,)
LDXX: clang++
compile_the_world: true
test_environ:
MSAN_OPTIONS: poison_in_dtor=1
noexcept:
CPPFLAGS: -O2 -Wframe-larger-than=16384
CXXFLAGS: -fno-exceptions
DEFINES: NDEBUG
opt:
CPPFLAGS: -O2 -Wframe-larger-than=16384
DEFINES: NDEBUG
tsan:
CC: clang
CPPFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
-DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
DEFINES: GRPC_TSAN
LD: clang++
LDFLAGS: -fsanitize=thread
LDXX: clang++
compile_the_world: true
test_environ:
TSAN_OPTIONS: suppressions=test/core/test_util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
ubsan:
CC: clang
CPPFLAGS: -O0 -stdlib=libc++ -fsanitize-coverage=edge,trace-pc-guard -fsanitize=undefined
-fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs
CXX: clang++
DEFINES: NDEBUG GRPC_UBSAN
LD: clang++
LDFLAGS: -stdlib=libc++ -fsanitize=undefined,unsigned-integer-overflow
LDXX: clang++
compile_the_world: true
test_environ:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/test_util/ubsan_suppressions.txt
defaults:
boringssl:
CFLAGS: -g
CPPFLAGS: -Ithird_party/boringssl-with-bazel/src/include -fvisibility=hidden -DOPENSSL_NO_ASM
-D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX
CXXFLAGS: -fno-exceptions
cares:
CFLAGS: -g
CPPFLAGS: -Ithird_party/cares/cares/include -Ithird_party/cares -Ithird_party/cares/cares
-fvisibility=hidden -D_GNU_SOURCE $(if $(subst Darwin,,$(SYSTEM)),,-Ithird_party/cares/config_darwin)
$(if $(subst FreeBSD,,$(SYSTEM)),,-Ithird_party/cares/config_freebsd) $(if $(subst
Linux,,$(SYSTEM)),,-Ithird_party/cares/config_linux) $(if $(subst OpenBSD,,$(SYSTEM)),,-Ithird_party/cares/config_openbsd)
-DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(if $(subst MINGW32,,$(SYSTEM)),-DHAVE_CONFIG_H,)
global:
CFLAGS: -g
COREFLAGS: -fno-exceptions
CPPFLAGS: -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2
-Ithird_party/upb -Isrc/core/ext/upb-gen -Isrc/core/ext/upbdefs-gen -Ithird_party/utf8_range
-Ithird_party/xxhash -Ithird_party/cares/cares/include -Ithird_party/cares -Ithird_party/cares/cares
-Ithird_party/address_sorting/include
LDFLAGS: -g
zlib:
CFLAGS: -fvisibility=hidden
CPPFLAGS: -DHAVE_UNISTD_H
php_config_m4:
deps:
- grpc
- address_sorting
- boringssl
- re2
- z
headers:
- src/php/ext/grpc/byte_buffer.h
- src/php/ext/grpc/call.h
- src/php/ext/grpc/call_credentials.h
- src/php/ext/grpc/channel.h
- src/php/ext/grpc/channel_credentials.h
- src/php/ext/grpc/completion_queue.h
- src/php/ext/grpc/php7_wrapper.h
- src/php/ext/grpc/php_grpc.h
- src/php/ext/grpc/server.h
- src/php/ext/grpc/server_credentials.h
- src/php/ext/grpc/timeval.h
- src/php/ext/grpc/version.h
src:
- src/php/ext/grpc/byte_buffer.c
- src/php/ext/grpc/call.c
- src/php/ext/grpc/call_credentials.c
- src/php/ext/grpc/channel.c
- src/php/ext/grpc/channel_credentials.c
- src/php/ext/grpc/completion_queue.c
- src/php/ext/grpc/php_grpc.c
- src/php/ext/grpc/server.c
- src/php/ext/grpc/server_credentials.c
- src/php/ext/grpc/timeval.c
python_dependencies:
deps:
- grpc
- address_sorting
- cares
- boringssl
- re2
- z
ruby_gem:
deps:
- grpc
- address_sorting
- cares
- boringssl
- re2
- z
swift_boringssl_package:
deps:
- boringssl
swift_package:
deps:
- grpc
- grpc_authorization_provider
- gpr
- upb_base_lib
- upb_mem_lib
- upb_message_lib
- upb_json_lib
- upb_textformat_lib
- utf8_range_lib
- re2

View File

@ -1,40 +0,0 @@
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if(TARGET absl::strings)
# If absl is included already, skip including it.
# (https://github.com/grpc/grpc/issues/29608)
elseif(gRPC_ABSL_PROVIDER STREQUAL "module")
if(NOT ABSL_ROOT_DIR)
set(ABSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp)
endif()
if(EXISTS "${ABSL_ROOT_DIR}/CMakeLists.txt")
if(gRPC_INSTALL)
# When gRPC_INSTALL is enabled and Abseil will be built as a module,
# Abseil will be installed along with gRPC for convenience.
set(ABSL_ENABLE_INSTALL ON)
endif()
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
else()
message(WARNING "gRPC_ABSL_PROVIDER is \"module\" but ABSL_ROOT_DIR is wrong")
endif()
if(gRPC_INSTALL AND NOT _gRPC_INSTALL_SUPPORTED_FROM_MODULE)
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ABSL_PROVIDER is \"module\" and CMake version (${CMAKE_VERSION}) is less than 3.13.")
set(gRPC_INSTALL FALSE)
endif()
elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
# Use "CONFIG" as there is no built-in cmake module for absl.
find_package(absl REQUIRED CONFIG)
endif()
set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()")

Some files were not shown because too many files have changed in this diff Show More