[c++][c#][grpc] Deprecate Bond-over-gRPC
Microsoft ceased its direct investment in Bond-over-gRPC in December 2021. GitHub issue [#1131, Bond-over-gRPC will be deprecated February 2022][1], outlines a two-step removal process should no one in the community be interested in maintaining Bond-over-gRPC: 1. mark Bond-over-gRPC as deprecated in February 2022 and 2. delete the Bond-over-gRPC code in May 2022. No one in the community has expressed an interest in maintaining Bond-over-gRPC. Mark the Bond-over-gRPC code as deprecated using the `[[deprecated]]` attribute in C# and the `[Obsolete]` attribute in .NET, implementing step 1. * Add suppressions for the new errors this generates in test and example code. * Remove the weekly gRPC master branch build: it has been failing since April 2021. Fixes https://github.com/microsoft/bond/issues/1108 * Add note about deprecation in documentation. * Minor usability improvements to the Install-Boost.ps1 script. [1]: https://github.com/microsoft/bond/issues/1131
This commit is contained in:
Родитель
48dfc05838
Коммит
4ea1574809
|
@ -45,8 +45,6 @@ jobs:
|
|||
- { FLAVOR: cpp-grpc, BOOST: 1.62.0, COMPILER: gcc }
|
||||
- { FLAVOR: cpp-grpc, BOOST: 1.61.0, COMPILER: gcc }
|
||||
|
||||
- { FLAVOR: cpp-grpc-master, BOOST: 1.66.0, COMPILER: clang }
|
||||
|
||||
env: ${{ matrix.env }}
|
||||
|
||||
steps:
|
||||
|
|
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -14,12 +14,21 @@ different versioning scheme, following the Haskell community's
|
|||
## Unreleased ##
|
||||
|
||||
* IDL core version: TBD
|
||||
* C++ version: TBD (minor version bump needed)
|
||||
* C# NuGet version: (minor version bump needed)
|
||||
* C++ version: TBD (major version bump needed)
|
||||
* C# NuGet version: TBD (major version bump needed)
|
||||
* `gbc` & compiler library: TBD
|
||||
|
||||
### C++ ###
|
||||
|
||||
* **Breaking change**: Bond-over-gRPC has been marked deprecated.
|
||||
Bond-over-gRPC will be removed in the next major version of Bond. See
|
||||
[issue \#1131, Bond-over-gRPC will be deprecated February
|
||||
2022](https://github.com/microsoft/bond/issues/1131), for the full
|
||||
announcement.
|
||||
* The `[[deprecated]]` attribute has been added to the `bond::ext::grpc`
|
||||
namespace in every top-level Bond-over-gRPC++ header. This will cause
|
||||
compiler warnings/errors for uses of Bond-over-gRPC++ that you may need
|
||||
to handle.
|
||||
* Fixed multiple symbol definition for Win32Exception in
|
||||
`grpc/win_thread_pool.h`. ([Issue
|
||||
\#1129](https://github.com/microsoft/bond/issues/1129))
|
||||
|
@ -39,6 +48,14 @@ different versioning scheme, following the Haskell community's
|
|||
|
||||
### C# ###
|
||||
|
||||
* **Breaking change**: Bond-over-gRPC code has been marked deprecated.
|
||||
Bond-over-gRPC will be removed in the next major version of Bond. See
|
||||
[issue \#1131, Bond-over-gRPC will be deprecated February
|
||||
2022](https://github.com/microsoft/bond/issues/1131), for the full
|
||||
announcement.
|
||||
* The `[Obsolete]` attribute has been added to every public type in the
|
||||
`Bond.Grpc` assembly. This will cause compiler warnings/errors for uses
|
||||
of Bond-over-gRPC# that you may need to handle.
|
||||
* Added virtual method `OutputBuffer.ResizeBuffer` that can be overridden to
|
||||
use buffer allocators other than `new byte[]` (e.g.
|
||||
`ArrayPool<byte>.Rent()`). ([Pull request
|
||||
|
|
|
@ -20,6 +20,8 @@ For details, see the User's Manuals:
|
|||
* [Java](https://microsoft.github.io/bond/manual/bond_java.html)
|
||||
* [Python](https://microsoft.github.io/bond/manual/bond_py.html)
|
||||
* [Bond-over-gRPC](https://microsoft.github.io/bond/manual/bond_over_grpc.html)
|
||||
([deprecated: will be removed in May
|
||||
2022](https://github.com/microsoft/bond/issues/1131))
|
||||
* [`gbc`, the Bond compiler/codegen tool](https://microsoft.github.io/bond/manual/compiler.html)
|
||||
* See also
|
||||
[the compiler library](https://hackage.haskell.org/package/bond) that
|
||||
|
|
|
@ -18,3 +18,15 @@ function (cxx_add_compile_options compiler)
|
|||
add_compile_options (${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# TODO: remove when deleting Bond-over-gRPC code
|
||||
function (cxx_target_no_warn_deprecated target)
|
||||
# Need to ignore both the warning about not understanding [[deprecated]]
|
||||
# and the warning about [[deprecated]] things if the compiler _does_
|
||||
# understand [[deprecated]]
|
||||
cxx_target_compile_options (AppleClang ${target} PRIVATE -Wno-unknown-attributes -Wno-deprecated-declarations -Wno-c++14-extensions)
|
||||
cxx_target_compile_options (Clang ${target} PRIVATE -Wno-unknown-attributes -Wno-deprecated-declarations -Wno-c++14-extensions)
|
||||
cxx_target_compile_options (GNU ${target} PRIVATE -Wno-attributes -Wno-deprecated-declarations)
|
||||
|
||||
cxx_target_compile_options (MSVC ${target} PRIVATE /wd4996)
|
||||
endfunction()
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
cabal-version: 1.12
|
||||
|
||||
-- This file has been generated from package.yaml by hpack version 0.33.0.
|
||||
-- This file has been generated from package.yaml by hpack version 0.34.4.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: 5f829cf187d9630385924b752fae193c51da82b2d9bfc0ef8f38f23a638fc604
|
||||
-- hash: b3e1e8755f812c54ff2252111e7b261404f305c68fbcdde72babcd762faf6acb
|
||||
|
||||
name: bond
|
||||
version: 0.12.1.0
|
||||
|
@ -89,7 +89,7 @@ executable gbc
|
|||
Options
|
||||
Paths_bond
|
||||
hs-source-dirs:
|
||||
./.
|
||||
./
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
|
@ -130,7 +130,7 @@ test-suite gbc-tests
|
|||
Options
|
||||
hs-source-dirs:
|
||||
tests
|
||||
./.
|
||||
./
|
||||
build-depends:
|
||||
Diff
|
||||
, HUnit
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <bond/core/config.h>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief Basic thread pool implementation.
|
||||
class basic_thread_pool
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/impl/codegen/status.h>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief %Exception thrown to indicate that a callback has been
|
||||
/// invoked multiple times when only one invocation is expected.
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <bond/core/reflection.h>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc { namespace reflection {
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc { namespace reflection {
|
||||
|
||||
|
||||
/// @brief Method description in compile-time schema
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
|
||||
#ifdef BOND_DOXYGEN_ONLY
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief Models a grpc server powered by Bond services.
|
||||
///
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief A collection of services that is used to construct a server.
|
||||
class service_collection final
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief A shared owner of the details of a single async, unary call.
|
||||
///
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "win_thread_pool.h"
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
using thread_pool = win_thread_pool;
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace bond { namespace ext { namespace grpc
|
|||
|
||||
#include "basic_thread_pool.h"
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
using thread_pool = basic_thread_pool;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
template <typename Request, typename Response>
|
||||
class shared_unary_call;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
/// @brief The client-side results of a unary call.
|
||||
template <typename Response>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <mutex>
|
||||
|
||||
|
||||
namespace bond { namespace ext { namespace grpc {
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc {
|
||||
|
||||
/// @brief A callback type that can be manually waited upon.
|
||||
///
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <system_error>
|
||||
#include <type_traits>
|
||||
|
||||
namespace bond { namespace ext { namespace grpc
|
||||
namespace bond { namespace ext { namespace [[deprecated("Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131")]] grpc
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
|
|
@ -19,6 +19,8 @@ add_dependencies(cpp_grpc_compat_codegen_lib cpp_grpc_compat_codegen)
|
|||
target_compile_definitions (cpp_grpc_compat_codegen_lib PUBLIC
|
||||
-DBOND_COMPACT_BINARY_PROTOCOL
|
||||
-DBOND_FAST_BINARY_PROTOCOL)
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (cpp_grpc_compat_codegen_lib)
|
||||
|
||||
# server and client executables
|
||||
add_bond_executable (cpp_grpc_compat_server GRPC EXCLUDE_FROM_ALL
|
||||
|
@ -37,6 +39,10 @@ cxx_target_compile_definitions (MSVC cpp_grpc_compat_server PRIVATE
|
|||
cxx_target_compile_definitions (MSVC cpp_grpc_compat_client PRIVATE
|
||||
-D_WIN32_WINNT=0x0600)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (cpp_grpc_compat_server)
|
||||
cxx_target_no_warn_deprecated (cpp_grpc_compat_client)
|
||||
|
||||
target_compile_definitions (grpc_compatibility_test PRIVATE
|
||||
-DBOND_COMPACT_BINARY_PROTOCOL
|
||||
-DBOND_FAST_BINARY_PROTOCOL)
|
||||
|
|
|
@ -26,6 +26,9 @@ function (add_unit_test)
|
|||
|
||||
cxx_target_compile_options (Clang ${name} PRIVATE -DBOOST_ASIO_HAS_STD_CHRONO)
|
||||
cxx_target_compile_options (AppleClang ${name} PRIVATE -DBOOST_ASIO_HAS_STD_CHRONO)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (${name})
|
||||
endfunction()
|
||||
|
||||
|
||||
|
@ -35,6 +38,8 @@ add_target_to_folder (grpc_test_common)
|
|||
target_include_directories (grpc_test_common PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc_test_common)
|
||||
target_link_libraries (grpc_test_common PUBLIC
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
grpc++)
|
||||
|
@ -57,6 +62,8 @@ target_include_directories (grpc_test_services PUBLIC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
cxx_target_compile_options (MSVC grpc_test_services PRIVATE -D_WIN32_WINNT=0x0600)
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc_test_services)
|
||||
target_link_libraries(grpc_test_services PRIVATE bond grpc++)
|
||||
add_dependencies(grpc_test_services grpc_test_services_codegen)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace Bond.Grpc
|
|||
using Bond.IO.Unsafe;
|
||||
using Bond.Protocols;
|
||||
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public static class Marshaller<T>
|
||||
{
|
||||
static Marshaller()
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace Bond.Grpc
|
|||
/// Interface representing a Bond message of a specific payload type.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the message payload.</typeparam>
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public interface IMessage<out T>
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -31,6 +32,7 @@ namespace Bond.Grpc
|
|||
/// <summary>
|
||||
/// Factory methods for creating <see cref="IMessage{T}" /> instances.
|
||||
/// </summary>
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public static class Message
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -99,6 +101,7 @@ namespace Bond.Grpc
|
|||
/// A Bond message of a given type
|
||||
/// </summary>
|
||||
/// <typeparam name="TPayload">The type of the message payload.</typeparam>
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public class Message<TPayload> : IMessage<TPayload>
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace Bond.Grpc.Internal
|
|||
/// considered part of Bond's public API surface. They may change at
|
||||
/// any time for any reason.
|
||||
/// </remarks>
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public static class NothingCallInvoker
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -75,6 +76,7 @@ namespace Bond.Grpc.Internal
|
|||
/// considered part of Bond's public API surface. They may change at
|
||||
/// any time for any reason.
|
||||
/// </remarks>
|
||||
[Obsolete(message: ObsoleteMessage.Value, error: false)]
|
||||
public static class NothingCallHandler
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
namespace Bond.Grpc
|
||||
{
|
||||
using System;
|
||||
|
||||
[Obsolete(message: Value, error: false)]
|
||||
internal static class ObsoleteMessage
|
||||
{
|
||||
internal const string Value = "Bond-over-gRPC will be removed in the next major version of Bond. See https://github.com/microsoft/bond/issues/1131";
|
||||
}
|
||||
}
|
|
@ -8,6 +8,10 @@
|
|||
<AssemblyName>GrpcCompatClient</AssemblyName>
|
||||
<TargetFrameworks>net45</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
|
||||
<NoWarn>618;$(NoWarn)</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grpc.Core" Version="1.17.1" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
<AssemblyName>GrpcCompatServer</AssemblyName>
|
||||
<TargetFrameworks>net45</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
|
||||
<NoWarn>618;$(NoWarn)</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grpc.Core" Version="1.17.1" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
<AssemblyName>GrpcCompatShared</AssemblyName>
|
||||
<TargetFrameworks>net45</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
|
||||
<NoWarn>618;$(NoWarn)</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grpc.Core" Version="1.17.1" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
<OutputPath>$(OutputPath)\Fields\</OutputPath>
|
||||
<BondOptions>--collection-interfaces --fields --grpc</BondOptions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
|
||||
<NoWarn>618;$(NoWarn)</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(IntermediateOutputPath)services_grpc.cs" Condition="false" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -5,6 +5,27 @@
|
|||
Bond-over-gRPC provides code generation from Bond IDL service definitions
|
||||
to send Bond objects via [gRPC](http://www.grpc.io/).
|
||||
|
||||
**Bond-over-gRPC is deprecated and will be completely removed from Bond in
|
||||
May 2022.** See GitHub issue [\#1131, Bond-over-gRPC will be deprecated
|
||||
February 2022](https://github.com/microsoft/bond/issues/1131), for full
|
||||
details.
|
||||
|
||||
If you are looking for something similar in spirit to Bond-over-gRPC, we recommend the following.
|
||||
|
||||
* For C++, gRPC++ now supports a [callback-based asynchronous
|
||||
API](https://github.com/grpc/proposal/pull/180) like Bond-over-gRPC’s.
|
||||
Check out the
|
||||
[client](https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_callback_client.cc)
|
||||
and
|
||||
[server](https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_callback_server.cc)
|
||||
examples.
|
||||
* For C# and .NET, we recommend [gRPC for
|
||||
.NET](https://github.com/grpc/grpc-dotnet/). The Grpc.Core library that
|
||||
Bond-over-gRPC is built atop [will no longer be supported as of May
|
||||
2022](https://grpc.io/blog/grpc-csharp-future/).
|
||||
* Both gRPC++ and gRPC for .NET support pluggable serialization formats, so
|
||||
you can use them with Bond, JSON, Protocol Buffers, or anything else.
|
||||
|
||||
# Features #
|
||||
|
||||
## Defining Services ##
|
||||
|
|
|
@ -265,6 +265,12 @@ See example: `examples/cpp/core/schema_view`
|
|||
Service definition
|
||||
------------------
|
||||
|
||||
**Bond-over-gRPC is deprecated and will be completely removed from Bond in
|
||||
May 2022.** See GitHub issue [\#1131, Bond-over-gRPC will be deprecated
|
||||
February 2022](https://github.com/microsoft/bond/issues/1131), for full
|
||||
details. `gbc` will still be able to parse service definitions and emit them
|
||||
in JSON AST, but C++ and C# codegen will be removed in May 2022.
|
||||
|
||||
A service definition consists of a service name and methods:
|
||||
|
||||
```
|
||||
|
|
|
@ -2,6 +2,9 @@ add_bond_test (grpc-async-server async-server.bond async-server.cpp GRPC)
|
|||
|
||||
cxx_target_compile_definitions (MSVC grpc-async-server PRIVATE -D_WIN32_WINNT=0x0600)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc-async-server)
|
||||
|
||||
if (BOND_FIND_GRPC)
|
||||
find_package(grpc CONFIG REQUIRED)
|
||||
target_link_libraries(grpc-async-server PRIVATE gRPC::grpc++)
|
||||
|
|
|
@ -29,6 +29,9 @@ target_link_libraries (grpc_dll_example_lib PUBLIC
|
|||
cxx_target_compile_definitions (MSVC grpc_dll_example_lib PRIVATE
|
||||
-D_WIN32_WINNT=0x0600)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc_dll_example_lib)
|
||||
|
||||
add_bond_test (grpc_dll_example
|
||||
using_grpc_dll.cpp)
|
||||
|
||||
|
@ -41,3 +44,6 @@ target_link_libraries (grpc_dll_example PUBLIC
|
|||
|
||||
cxx_target_compile_definitions (MSVC grpc_dll_example PRIVATE
|
||||
-D_WIN32_WINNT=0x0600)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc_dll_example)
|
||||
|
|
|
@ -42,3 +42,8 @@ cxx_target_compile_definitions (MSVC grpc_static_library_server PRIVATE
|
|||
|
||||
cxx_target_compile_definitions (MSVC grpc_static_library_client PRIVATE
|
||||
-D_WIN32_WINNT=0x0600)
|
||||
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc_static_library_lib)
|
||||
cxx_target_no_warn_deprecated (grpc_static_library_server)
|
||||
cxx_target_no_warn_deprecated (grpc_static_library_client)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
add_bond_test (grpc-helloworld helloworld.bond helloworld.cpp GRPC)
|
||||
|
||||
cxx_target_compile_definitions (MSVC grpc-helloworld PRIVATE -D_WIN32_WINNT=0x0600)
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc-helloworld)
|
||||
|
||||
if (BOND_FIND_GRPC)
|
||||
find_package(grpc CONFIG REQUIRED)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
add_bond_test (grpc-pingpong pingpong.bond pingpong.cpp GRPC)
|
||||
|
||||
cxx_target_compile_definitions (MSVC grpc-pingpong PRIVATE -D_WIN32_WINNT=0x0600)
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc-pingpong)
|
||||
|
||||
if (BOND_FIND_GRPC)
|
||||
find_package(grpc CONFIG REQUIRED)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
add_bond_test (grpc-scalar scalar.bond scalar.cpp GRPC)
|
||||
|
||||
cxx_target_compile_definitions (MSVC grpc-scalar PRIVATE -D_WIN32_WINNT=0x0600)
|
||||
# Supress warning about [[deprecated]] Bond-over-gRPC code.
|
||||
cxx_target_no_warn_deprecated (grpc-scalar)
|
||||
|
||||
if (BOND_FIND_GRPC)
|
||||
find_package(grpc CONFIG REQUIRED)
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/zsh
|
||||
|
||||
set -eux
|
||||
|
||||
# Get gRPC's current master
|
||||
pushd "$BOND_ROOT/thirdparty/grpc"
|
||||
git fetch origin master
|
||||
git checkout origin/master
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive
|
||||
popd
|
||||
|
||||
BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_SKIP_CORE_TESTS=TRUE -DgRPC_ZLIB_PROVIDER=package"
|
||||
source "$BUILD_SCRIPTS/build_cpp-common.zsh"
|
|
@ -95,9 +95,9 @@ mkdir $lib64Dir | Out-Null
|
|||
|
||||
function Install-BoostHeaders
|
||||
{
|
||||
Write-Progress -Activity 'Installing Boost' -Status "Installing 'boost' (headers)"
|
||||
Write-Progress -Activity 'Installing Boost' -Status "Installing 'boost' (headers) version $Version"
|
||||
|
||||
if ($PSCmdlet.ShouldProcess('boost', 'Install NuGet package'))
|
||||
if ($PSCmdlet.ShouldProcess("boost version $Version", 'Install NuGet package'))
|
||||
{
|
||||
Install-NuGetPackage `
|
||||
-PackageId 'boost' `
|
||||
|
@ -114,9 +114,9 @@ function Install-BoostComponent([string]$Component)
|
|||
{
|
||||
$packageId = "$Component-vc$(ConvertVcToolsetVer-ToBoostPackageFormat $VcToolsetVer)"
|
||||
|
||||
Write-Progress -Activity 'Installing Boost' -Status "Installing '$packageId'"
|
||||
Write-Progress -Activity 'Installing Boost' -Status "Installing '$packageId' version $Version"
|
||||
|
||||
if ($PSCmdlet.ShouldProcess($packageId, 'Install NuGet package'))
|
||||
if ($PSCmdlet.ShouldProcess("$packageId version $Version", 'Install NuGet package'))
|
||||
{
|
||||
Install-NuGetPackage `
|
||||
-PackageId $packageId `
|
||||
|
|
Загрузка…
Ссылка в новой задаче