26 Commits

Author SHA1 Message Date
RomantsovS 9b77138b71 examples/cpp/route_guide add missing command line parsing (#37857)
The gRPC basic turorial says to call the following command to run the server `./route_guide_server --db_path=path/to/route_guide_db.json`

But the server and client do not parse command line arguments and they always use default value `route_guide_db.json`. Thus the example only works if we run it from `examples/cpp/route_guide` dir. Otherwise we get the following error: `helper.cc:49] Failed to open route_guide_db.json
Aborted (core dumped)`

Add
`absl::ParseCommandLine(argc, argv);`
to both server and client `main` similar to `route_guide_callback_server.cc`

Closes #37857

PiperOrigin-RevId: 709154601
2024-12-23 14:41:20 -08:00
Esun Kim 93b29607cc [C++] Transition to C++17 (#37919)
This bumps the minimum version of C++ to 17 from 14 per https://github.com/grpc/proposal/blob/master/L120-requiring-cpp17.md

Changes:
- Used C++17 instead of C++14 when building gRPC.
- Disabled `modernize-unary-static-assert` clang-tidy rule for the smooth transition. This rule will be re-enabled in a future update, along with a fix to address any identified issues.
- Added a post-install script for XCode/Cocoapod examples to enforce the use of C++17 across all projects, preventing build errors. (I'd like to have a better solution here but couldn't find it)

Closes #37919

PiperOrigin-RevId: 709073401
2024-12-23 08:53:24 -08:00
Yash Tibrewal 1071ada87c [Example] Update route_guide example (#36930)
The intention behind this PR is to improve the example to aid the upcoming callback API guide.

Also fixes #25823

Closes #36930

PiperOrigin-RevId: 644166441
2024-06-17 16:20:44 -07:00
Jan Tattermusch 0f1afec5a8 [protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.

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

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

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

---------

Co-authored-by: Craig Tiller <ctiller@google.com>
2023-04-12 18:43:58 +02:00
Esun Kim 5fb4c2364d Clean-up pkgconfig (#31660)
* Clean-up pkgconfig

* Removed run_distrib_test_cmake_module_install_pkgconfig.sh

* Proper re2

* Clean up pkgconfig.sh test script
2022-11-22 10:51:17 -08:00
Esun Kim 03e9ac6f1f Requiring C++14 (#29589) 2022-05-12 21:17:32 -07:00
Nicolas Noble a325d7f77a Pointing the protobuf submodule to the new URL (#26811)
* Pointing the protobuf submodule to the new URL

* Also changing WORKSPACE dependencies

* More references to the old URL...
2021-07-29 10:19:16 -07:00
Hao Nguyen 7f787bd083 Link against pthread in examples 2019-06-11 12:12:33 -07:00
Toshihito Kikuchi 351506688d Update compiler/linker options to use pkg-config in C++ examples 2017-06-13 16:15:04 -07:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Nicolas "Pixel" Noble 7f074e0e20 Merge branch 'v1.0.x' into manual-upmerge 2016-08-11 21:00:08 +02:00
Jorge Canizales 7a2bc14fc0 Merge commit '5e623b8d8d8d106bd4ab9a6d77ef43b1a134d8ec' into p0-advance-protobuf-version 2016-07-29 15:45:02 -07:00
Jorge Canizales 4343c904e2 Update Protobuf submodule to v3.0.0 (GA) 2016-07-29 15:39:45 -07:00
Muxi Yan cd0d8aed65 Identify system and remove --no-as-need if it is Mac OS 2016-07-26 14:13:46 -07:00
Muxi Yan 4e3df00f00 Removed --no-as-needed options from Makefile of HelloWorld and RouteGuide 2016-07-26 13:28:54 -07:00
Nicolas Noble 7645fdc4f0 Merge pull request #7393 from y-zeng/example_makefile
Enable server reflection in c++ examples
2016-07-21 14:28:55 -07:00
Jorge Canizales 9e6372380d Update protobuf submodule to 3.0.0-beta-4
Which has the fix for oneofs when using dynamic frameworks in ObjectiveC
2016-07-19 17:35:06 -07:00
Yuchen Zeng 1c58bd221d Enable server reflection in c++ examples 2016-07-07 14:19:04 -07:00
Jorge Canizales f29e364168 Bump protobuf version to beta-3.3
It’s just the merge of beta-3.1 and beta-3.2, both of which we need.
2016-07-01 15:56:57 -07:00
Nicolas "Pixel" Noble 81159e5adc Fixing examples. 2016-04-23 01:30:12 +02:00
Craig Tiller 6169d5f7b0 Update copyrights 2016-03-31 07:46:18 -07:00
Jan Tattermusch e7c2566252 Merge pull request #4913 from pszemus/master
Update protobuf version to v3.0.0-beta-2
2016-02-11 11:27:19 -08:00
Przemysław Sobala fbf8c0b8ca Update copyright 2016-02-11 11:03:21 +01:00
yang-g b45f265326 Remove reference to lgpr in examples 2016-02-04 09:48:39 -08:00
Przemysław Sobala ea9a031fed Update protobuf version 2016-01-27 14:07:09 +01:00
Stanley Cheung 20fa6693f3 move examples to correct locations 2015-08-27 14:00:20 -07:00