grpc/third_party
Austin Schuh d30404868f
ARM and -Wextra fixups (#19141)
* Make generated code compile with -Wunused-parameters

-Wunused-parameters is turned on by -Werror -Wextra.  gRPC code
generation creates header files with unused parameters.  So let's modify
the generator to not generate code which will make -Wunused-parameters
unhappy.

* Fix unsigned vs signed comparisons and 32 bit string formats

Fix unsigned vs signed comparison warnings.

For 64 bit numbers printed in gRPC, the string formats assume that you
are running on a 64 bit machine.  Use inttypes.h to make it portable.
Also, use size_t format strings for the same reason.

* Fix unaligned memory access

cost_entry_ptr has no alignment guarentees that ubsan can find.  So it
fails the test with an alignment problem.  Use memcopy to read the data
from the pointer to fix this.

* Fix undefined behavior with memcpy and memcmp

Passing in a 0 length piece of data and a null pointer is undefined
behavior.  If the length is 0, don't pass it in.  This fixes ubsan
failures.

* Clang-format

* Automated change: Fix sanity tests
2021-09-27 04:54:05 -07:00
..
abseil-cpp@997aaf3a28 Updated Abseil to LTS 20210324.0 (#25835) 2021-03-30 09:22:05 -07:00
address_sorting ARM and -Wextra fixups (#19141) 2021-09-27 04:54:05 -07:00
benchmark@73d4d5e8d6 Update third_party/benchmark to v1.5.2 (#25184) 2021-03-10 10:49:24 -08:00
bloaty@73594cde8c Submodule bloaty mcbloatface 2017-10-04 10:49:20 -07:00
boringssl-with-bazel@fc44652a42 update submodule boringssl-with-bazel with origin/master-with-bazel (#27208) 2021-09-01 11:25:01 -07:00
cares Add darwin_arm64 and darwin_arm64e to c-ares' config settings 2020-12-08 19:56:10 +09:00
envoy-api@2f0d081fab Update submodule envoy-api to origin/main (#27256) 2021-09-07 12:54:20 -07:00
googleapis@2f9af297c8 Update Envoy API to the latest version (2021-07-30) (#26848) 2021-08-03 09:12:42 -07:00
googletest@c9ccac7cb7 Update googletest version to fix BoringSSL support 2019-08-22 12:42:18 -07:00
istio/security/proto/providers/google Move the proto to third_party 2020-08-12 14:21:14 -07:00
libuv@15ae750151 move submodule libuv to v1.34.0 2020-01-07 17:09:58 -08:00
objective_c Revert "Import cronet net error list and modify grpc-cronet error message." 2020-09-21 11:57:23 -07:00
opencensus-proto@4aa53e15cb [xDS Proto] Update Bazel dependencies (#25511) 2021-03-01 17:53:11 -08:00
opentelemetry@60fa8754d8 Add opentelemetry as a submodule for latest xDS API (#26850) 2021-08-02 12:42:44 -07:00
protobuf@909a0f36a1 Upgrade third_party/protobuf to v3.17.3 (#27227) 2021-09-05 22:21:37 -07:00
protoc-gen-validate@59da36e59f Update Envoy API to the latest version (2021-07-30) (#26848) 2021-08-03 09:12:42 -07:00
py Fix python header resolution on Windows (#26693) 2021-07-16 12:51:06 -07:00
rake-compiler-dock Add ruby 3.0 to build matrix; upgrade rake-compiler-docker image to 1.1.0 2020-12-29 15:58:20 -08:00
re2@aecba11114 Add support for xDS regex matchers. 2020-07-07 13:17:25 -07:00
toolchains Upgrade bazel to 4.2.1 (LTS), upgrade bazel toolchain to 4.1.0 (#27410) 2021-09-23 16:20:25 +02:00
udpa@6414d71391 Update Envoy API to the latest version (2021-07-30) (#26848) 2021-08-03 09:12:42 -07:00
upb Upgrade third_party/protobuf to v3.17.3 (#27227) 2021-09-05 22:21:37 -07:00
xxhash Trim xxhash CLI LICENSE (#26929) 2021-08-06 13:43:39 -07:00
zlib@cacf7f1d4e Update to avoid ubsan failure 2017-04-19 15:24:59 -07:00
ABSEIL_MANUAL.md Update abseil-doc (#26450) 2021-06-08 13:52:46 -07:00
BUILD Make patch work for downstream dependencies 2021-01-16 13:12:16 +01:00
README.md Trim xxhash CLI LICENSE (#26929) 2021-08-06 13:43:39 -07:00
constantly.BUILD Add python bazel deps needed to run resolver component tests 2018-02-14 14:06:00 -08:00
cython.BUILD Basic setup to build gRPC Python with Bazel 2018-07-27 14:39:14 +00:00
enum34.BUILD Separate py_grpc_library and py_proto_library. 2019-08-01 15:16:22 -07:00
futures.BUILD Separate py_grpc_library and py_proto_library. 2019-08-01 15:16:22 -07:00
incremental.BUILD Add python bazel deps needed to run resolver component tests 2018-02-14 14:06:00 -08:00
libprotobuf_mutator.BUILD Add structurally aware fuzzing support (#27405) 2021-09-22 14:40:43 -07:00
libuv.BUILD Fix sanity checks and "really" add the libuv submodule to third_party. 2020-01-07 15:44:42 -08:00
protobuf.patch Upgrade third_party/protobuf to v3.17.3 (#27227) 2021-09-05 22:21:37 -07:00
six.BUILD Upgrade six from 1.12 to 1.16 in Bazel (#26451) 2021-06-08 14:37:44 -07:00
twisted.BUILD Add python bazel deps needed to run resolver component tests 2018-02-14 14:06:00 -08:00
yaml.BUILD Add python bazel deps needed to run resolver component tests 2018-02-14 14:06:00 -08:00
zlib.BUILD Update zlib dependency 2019-05-29 17:07:00 -07:00
zope_interface.BUILD Add python bazel deps needed to run resolver component tests 2018-02-14 14:06:00 -08:00

README.md

Third-party libraries

gRPC depends on several third-party libraries, their source code is available (usually as a git submodule) in this directory.

Guidelines on updating submodules

  • IMPORTANT: whenever possible, try to only update to a stable release of a library (= not to master / random commit). Depending on unreleased revisions makes gRPC installation harder for users, as it forces them to always build the dependency from source and prevents them from using more convenient installation channels (linux packages, package managers etc.)

  • bazel BUILD uses a different dependency model - whenever updating a submodule, also update the revision in grpc_deps.bzl so that bazel and non-bazel builds stay in sync (this is actually enforced by a sanity check in some cases)

Considerations when adding a new third-party dependency

  • gRPC C++ needs to stay buildable/installable even if the submodules are not present (e.g. the tar.gz archive with gRPC doesn't contain the submodules), assuming that the dependencies are already installed. This is a requirement for being able to provide a reasonable install process (e.g. using cmake) and to support package managers for gRPC C++.

  • Adding a new dependency is a lot of work (both for us and for the users). We currently support multiple build systems (BAZEL, cmake, make, ...) so adding a new dependency usually requires updates in multiple build systems (often not trivial). The installation process also needs to continue to work (we do have distrib tests to test many of the possible installation scenarios, but they are not perfect). Adding a new dependency also usually affects the installation instructions that need to be updated. Also keep in mind that adding a new dependency can be quite disruptive for the users and community - it means that all users will need to update their projects accordingly (for C++ projects often non-trivial) and the community-provided C++ packages (e.g. vcpkg) will need to be updated as well.

Checklist for adding a new third-party dependency

READ THIS BEFORE YOU ADD A NEW DEPENDENCY

  • Make sure you understand the hidden costs of adding a dependency (see section above) and that you understand the complexities of updating the build files. Maintenance of the build files isn't for free, so expect to be involved in maintenance tasks, cleanup and support (e.g resolving user bugs) of the build files in the future.

  • Once your change is ready, start an adhoc run of artifact - packages - distribtests flow and make sure everything passes (for technical reasons, not all the distribtests can run on each PR automatically).

  • Check the impact of the new dependency on the size of our distribution packages (compare BEFORE and AFTER) and post the comparison on your PR (it should not be approved without checking the impact sizes of packages first). The package sizes AFTER can be obtained from the adhoc package build from bullet point above.

Instructions for updating dependencies

Usually the process is

  1. update the submodule to selected commit (see guidance above)
  2. update the dependency in grpc_deps.bzl to the same commit
  3. update tools/run_tests/sanity/check_submodules.sh to make the sanity test pass
  4. (when needed) run tools/buildgen/generate_projects.sh to regenerate the generated files
  5. populate the bazel download mirror by running bazel/update_mirror.sh

Updating some dependencies requires extra care.

Updating third_party/abseil-cpp

  • Two additional steps should be done before running generate_projects.sh above.
    • Running src/abseil-cpp/preprocessed_builds.yaml.gen.py.
    • Updating abseil_version = scripts in templates/gRPC-C++.podspec.template and templates/gRPC-Core.podspec.template.
  • You can see an example of previous upgrade.

Updating third_party/boringssl-with-bazel

  • Update the third_party/boringssl-with-bazel submodule to the latest master-with-bazel branch
git submodule update --init      # just to start in a clean state
cd third_party/boringssl-with-bazel
git fetch origin   # fetch what's new in the boringssl repository
git checkout origin/master-with-bazel  # checkout the current state of master-with-bazel branch in the boringssl repo
# Note the latest commit SHA on master-with-bazel-branch 
cd ../..   # go back to grpc repo root
git status   #  will show that there are new commits in third_party/boringssl-with-bazel
git add  third_party/boringssl-with-bazel     # we actually want to update the changes to the submodule
git commit -m "update submodule boringssl-with-bazel with origin/master-with-bazel"   # commit
  • Update boringssl dependency in bazel/grpc_deps.bzl to the same commit SHA as master-with-bazel branch

    • Update http_archive(name = "boringssl", section by updating the sha in strip_prefix and urls fields.
    • Also, set sha256 field to "" as the existing value is not valid. This will be added later once we know what that value is.
  • Update tools/run_tests/sanity/check_submodules.sh with the same commit

  • Commit these changes git commit -m "update boringssl dependency to master-with-bazel commit SHA"

  • Run tools/buildgen/generate_projects.sh to regenerate the generated files

    • Because sha256 in bazel/grpc_deps.bzl was left empty, you will get a DEBUG msg like this one:
      Rule 'boringssl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "SHA value"
      
    • Commit the regenrated files git commit -m "regenerate files"
    • Update bazel/grpc_deps.bzl with the SHA value shown in the above debug msg. Commit again git commit -m "Updated sha256"
  • Run tools/distrib/generate_boringssl_prefix_header.sh

    • Commit again git commit -m "generate boringssl prefix headers"
  • Increment the boringssl podspec version number in templates/src/objective-c/BoringSSL-GRPC.podspec.template and templates/gRPC-Core.podspec.template. example

    • Commit again git commit -m "Increment podspec version"
  • Run tools/buildgen/generate_projects.sh (yes, again)

    • Commit again git commit -m "Second regeneration"
  • Create a PR with all the above commits.

  • Run bazel/update_mirror.sh to update GCS mirror.

Updating third_party/protobuf

See http://go/grpc-third-party-protobuf-update-instructions (internal only)

Updating third_party/envoy-api

Apart from the above steps, please perform the following two steps to generate the Python xds-protos package:

  1. Bump the version in the tools/distrib/python/xds_protos/setup.py;
  2. Run tools/distrib/python/xds_protos/build_validate_upload.sh to upload the built wheel.

Updating third_party/upb

Since upb is vendored in the gRPC repo, you cannot use submodule to update it. Please follow the steps below.

  1. Update third_party/upb directory by running git subtree pull --squash --prefix=third_party/upb https://github.com/protocolbuffers/upb.git master
  2. Update the dependency in grpc_deps.bzl to the same commit
  3. Populate the bazel download mirror by running bazel/update_mirror.sh
  4. Update src/upb/gen_build_yaml.py for newly added or removed upb files
  5. Run tools/buildgen/generate_projects.sh to regenerate the generated files
  6. Run tools/codegen/core/gen_upb_api.sh to regenerate upb files. If you see breaking changes here, you may want to import upb into Google3 along with gRPC.

Updating third_party/xxhash

TODO(https://github.com/Cyan4973/xxHash/issues/548): revisit LICENSE instructions if upstream splits library and CLI.

The upstream xxhash repository contains a bunch of files that we don't want, so we employ a rather manual update flow to pick up just the bits we care about:

git remote add xxhash https://github.com/Cyan4973/xxHash.git
git fetch xxhash
git show xxhash/dev:xxhash.h > third_party/xxhash/xxhash.h
git show xxhash/dev:LICENSE | sed -nE '/^-+$/q;p' > third_party/xxhash/LICENSE