[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:
Christopher Warrington 2022-02-23 09:24:46 -08:00 коммит произвёл GitHub
Родитель 48dfc05838
Коммит 4ea1574809
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
39 изменённых файлов: 151 добавлений и 41 удалений

2
.github/workflows/linux_cron.yml поставляемый
Просмотреть файл

@ -45,8 +45,6 @@ jobs:
- { FLAVOR: cpp-grpc, BOOST: 1.62.0, COMPILER: gcc } - { FLAVOR: cpp-grpc, BOOST: 1.62.0, COMPILER: gcc }
- { FLAVOR: cpp-grpc, BOOST: 1.61.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 }} env: ${{ matrix.env }}
steps: steps:

Просмотреть файл

@ -14,12 +14,21 @@ different versioning scheme, following the Haskell community's
## Unreleased ## ## Unreleased ##
* IDL core version: TBD * IDL core version: TBD
* C++ version: TBD (minor version bump needed) * C++ version: TBD (major version bump needed)
* C# NuGet version: (minor version bump needed) * C# NuGet version: TBD (major version bump needed)
* `gbc` & compiler library: TBD * `gbc` & compiler library: TBD
### C++ ### ### 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 * Fixed multiple symbol definition for Win32Exception in
`grpc/win_thread_pool.h`. ([Issue `grpc/win_thread_pool.h`. ([Issue
\#1129](https://github.com/microsoft/bond/issues/1129)) \#1129](https://github.com/microsoft/bond/issues/1129))
@ -39,6 +48,14 @@ different versioning scheme, following the Haskell community's
### C# ### ### 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 * Added virtual method `OutputBuffer.ResizeBuffer` that can be overridden to
use buffer allocators other than `new byte[]` (e.g. use buffer allocators other than `new byte[]` (e.g.
`ArrayPool<byte>.Rent()`). ([Pull request `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) * [Java](https://microsoft.github.io/bond/manual/bond_java.html)
* [Python](https://microsoft.github.io/bond/manual/bond_py.html) * [Python](https://microsoft.github.io/bond/manual/bond_py.html)
* [Bond-over-gRPC](https://microsoft.github.io/bond/manual/bond_over_grpc.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) * [`gbc`, the Bond compiler/codegen tool](https://microsoft.github.io/bond/manual/compiler.html)
* See also * See also
[the compiler library](https://hackage.haskell.org/package/bond) that [the compiler library](https://hackage.haskell.org/package/bond) that

Просмотреть файл

@ -18,3 +18,15 @@ function (cxx_add_compile_options compiler)
add_compile_options (${ARGV}) add_compile_options (${ARGV})
endif() endif()
endfunction() 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 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 -- see: https://github.com/sol/hpack
-- --
-- hash: 5f829cf187d9630385924b752fae193c51da82b2d9bfc0ef8f38f23a638fc604 -- hash: b3e1e8755f812c54ff2252111e7b261404f305c68fbcdde72babcd762faf6acb
name: bond name: bond
version: 0.12.1.0 version: 0.12.1.0
@ -89,7 +89,7 @@ executable gbc
Options Options
Paths_bond Paths_bond
hs-source-dirs: hs-source-dirs:
./. ./
build-depends: build-depends:
aeson aeson
, async , async
@ -130,7 +130,7 @@ test-suite gbc-tests
Options Options
hs-source-dirs: hs-source-dirs:
tests tests
./. ./
build-depends: build-depends:
Diff Diff
, HUnit , HUnit

Просмотреть файл

@ -5,7 +5,7 @@
#include <bond/core/config.h> #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 namespace detail
{ {

Просмотреть файл

@ -27,7 +27,7 @@
#include <thread> #include <thread>
#include <vector> #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. /// @brief Basic thread pool implementation.
class basic_thread_pool class basic_thread_pool

Просмотреть файл

@ -10,7 +10,7 @@
#include <grpcpp/client_context.h> #include <grpcpp/client_context.h>
#include <grpcpp/impl/codegen/status.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 /// @brief %Exception thrown to indicate that a callback has been
/// invoked multiple times when only one invocation is expected. /// invoked multiple times when only one invocation is expected.

Просмотреть файл

@ -36,7 +36,7 @@
#include <thread> #include <thread>
#include <vector> #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 namespace detail
{ {

Просмотреть файл

@ -7,7 +7,7 @@
#include <bond/core/reflection.h> #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 /// @brief Method description in compile-time schema

Просмотреть файл

@ -7,7 +7,7 @@
#include <functional> #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 #ifdef BOND_DOXYGEN_ONLY

Просмотреть файл

@ -70,7 +70,7 @@
#include <thread> #include <thread>
#include <vector> #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. /// @brief Models a grpc server powered by Bond services.
/// ///

Просмотреть файл

@ -14,7 +14,7 @@
#include <string> #include <string>
#include <vector> #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. /// @brief A collection of services that is used to construct a server.
class service_collection final class service_collection final

Просмотреть файл

@ -10,7 +10,7 @@
#include <utility> #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. /// @brief A shared owner of the details of a single async, unary call.
/// ///

Просмотреть файл

@ -9,7 +9,7 @@
#include "win_thread_pool.h" #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; using thread_pool = win_thread_pool;
@ -19,7 +19,7 @@ namespace bond { namespace ext { namespace grpc
#include "basic_thread_pool.h" #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; using thread_pool = basic_thread_pool;

Просмотреть файл

@ -11,7 +11,7 @@
#include <utility> #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> template <typename Request, typename Response>
class shared_unary_call; class shared_unary_call;

Просмотреть файл

@ -14,7 +14,7 @@
#include <memory> #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. /// @brief The client-side results of a unary call.
template <typename Response> template <typename Response>

Просмотреть файл

@ -19,7 +19,7 @@
#include <mutex> #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. /// @brief A callback type that can be manually waited upon.
/// ///

Просмотреть файл

@ -21,7 +21,7 @@
#include <system_error> #include <system_error>
#include <type_traits> #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 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 target_compile_definitions (cpp_grpc_compat_codegen_lib PUBLIC
-DBOND_COMPACT_BINARY_PROTOCOL -DBOND_COMPACT_BINARY_PROTOCOL
-DBOND_FAST_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 # server and client executables
add_bond_executable (cpp_grpc_compat_server GRPC EXCLUDE_FROM_ALL 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 cxx_target_compile_definitions (MSVC cpp_grpc_compat_client PRIVATE
-D_WIN32_WINNT=0x0600) -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 target_compile_definitions (grpc_compatibility_test PRIVATE
-DBOND_COMPACT_BINARY_PROTOCOL -DBOND_COMPACT_BINARY_PROTOCOL
-DBOND_FAST_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 (Clang ${name} PRIVATE -DBOOST_ASIO_HAS_STD_CHRONO)
cxx_target_compile_options (AppleClang ${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() endfunction()
@ -35,6 +38,8 @@ add_target_to_folder (grpc_test_common)
target_include_directories (grpc_test_common PUBLIC target_include_directories (grpc_test_common PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) ${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 target_link_libraries (grpc_test_common PUBLIC
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
grpc++) grpc++)
@ -57,6 +62,8 @@ target_include_directories (grpc_test_services PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
cxx_target_compile_options (MSVC grpc_test_services PRIVATE -D_WIN32_WINNT=0x0600) 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++) target_link_libraries(grpc_test_services PRIVATE bond grpc++)
add_dependencies(grpc_test_services grpc_test_services_codegen) add_dependencies(grpc_test_services grpc_test_services_codegen)

Просмотреть файл

@ -8,6 +8,7 @@ namespace Bond.Grpc
using Bond.IO.Unsafe; using Bond.IO.Unsafe;
using Bond.Protocols; using Bond.Protocols;
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public static class Marshaller<T> public static class Marshaller<T>
{ {
static Marshaller() static Marshaller()

Просмотреть файл

@ -9,6 +9,7 @@ namespace Bond.Grpc
/// Interface representing a Bond message of a specific payload type. /// Interface representing a Bond message of a specific payload type.
/// </summary> /// </summary>
/// <typeparam name="T">The type of the message payload.</typeparam> /// <typeparam name="T">The type of the message payload.</typeparam>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public interface IMessage<out T> public interface IMessage<out T>
{ {
/// <summary> /// <summary>
@ -31,6 +32,7 @@ namespace Bond.Grpc
/// <summary> /// <summary>
/// Factory methods for creating <see cref="IMessage{T}" /> instances. /// Factory methods for creating <see cref="IMessage{T}" /> instances.
/// </summary> /// </summary>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public static class Message public static class Message
{ {
/// <summary> /// <summary>
@ -99,6 +101,7 @@ namespace Bond.Grpc
/// A Bond message of a given type /// A Bond message of a given type
/// </summary> /// </summary>
/// <typeparam name="TPayload">The type of the message payload.</typeparam> /// <typeparam name="TPayload">The type of the message payload.</typeparam>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public class Message<TPayload> : IMessage<TPayload> public class Message<TPayload> : IMessage<TPayload>
{ {
/// <summary> /// <summary>

Просмотреть файл

@ -17,6 +17,7 @@ namespace Bond.Grpc.Internal
/// considered part of Bond's public API surface. They may change at /// considered part of Bond's public API surface. They may change at
/// any time for any reason. /// any time for any reason.
/// </remarks> /// </remarks>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public static class NothingCallInvoker public static class NothingCallInvoker
{ {
/// <summary> /// <summary>
@ -75,6 +76,7 @@ namespace Bond.Grpc.Internal
/// considered part of Bond's public API surface. They may change at /// considered part of Bond's public API surface. They may change at
/// any time for any reason. /// any time for any reason.
/// </remarks> /// </remarks>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public static class NothingCallHandler public static class NothingCallHandler
{ {
/// <summary> /// <summary>

13
cs/src/grpc/Obsolete.cs Normal file
Просмотреть файл

@ -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> <AssemblyName>GrpcCompatClient</AssemblyName>
<TargetFrameworks>net45</TargetFrameworks> <TargetFrameworks>net45</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
<NoWarn>618;$(NoWarn)</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Grpc.Core" Version="1.17.1" /> <PackageReference Include="Grpc.Core" Version="1.17.1" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -8,6 +8,10 @@
<AssemblyName>GrpcCompatServer</AssemblyName> <AssemblyName>GrpcCompatServer</AssemblyName>
<TargetFrameworks>net45</TargetFrameworks> <TargetFrameworks>net45</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
<NoWarn>618;$(NoWarn)</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Grpc.Core" Version="1.17.1" /> <PackageReference Include="Grpc.Core" Version="1.17.1" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -8,6 +8,10 @@
<AssemblyName>GrpcCompatShared</AssemblyName> <AssemblyName>GrpcCompatShared</AssemblyName>
<TargetFrameworks>net45</TargetFrameworks> <TargetFrameworks>net45</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
<NoWarn>618;$(NoWarn)</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Grpc.Core" Version="1.17.1" /> <PackageReference Include="Grpc.Core" Version="1.17.1" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -22,6 +22,10 @@
<OutputPath>$(OutputPath)\Fields\</OutputPath> <OutputPath>$(OutputPath)\Fields\</OutputPath>
<BondOptions>--collection-interfaces --fields --grpc</BondOptions> <BondOptions>--collection-interfaces --fields --grpc</BondOptions>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!-- Suppress warning about calling Obsolete Bond.Grpc code. -->
<NoWarn>618;$(NoWarn)</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(IntermediateOutputPath)services_grpc.cs" Condition="false" /> <Compile Include="$(IntermediateOutputPath)services_grpc.cs" Condition="false" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -5,6 +5,27 @@
Bond-over-gRPC provides code generation from Bond IDL service definitions Bond-over-gRPC provides code generation from Bond IDL service definitions
to send Bond objects via [gRPC](http://www.grpc.io/). 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-gRPCs.
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 # # Features #
## Defining Services ## ## Defining Services ##

Просмотреть файл

@ -265,6 +265,12 @@ See example: `examples/cpp/core/schema_view`
Service definition 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: 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) 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) if (BOND_FIND_GRPC)
find_package(grpc CONFIG REQUIRED) find_package(grpc CONFIG REQUIRED)
target_link_libraries(grpc-async-server PRIVATE gRPC::grpc++) 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 cxx_target_compile_definitions (MSVC grpc_dll_example_lib PRIVATE
-D_WIN32_WINNT=0x0600) -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 add_bond_test (grpc_dll_example
using_grpc_dll.cpp) using_grpc_dll.cpp)
@ -41,3 +44,6 @@ target_link_libraries (grpc_dll_example PUBLIC
cxx_target_compile_definitions (MSVC grpc_dll_example PRIVATE cxx_target_compile_definitions (MSVC grpc_dll_example PRIVATE
-D_WIN32_WINNT=0x0600) -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 cxx_target_compile_definitions (MSVC grpc_static_library_client PRIVATE
-D_WIN32_WINNT=0x0600) -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) add_bond_test (grpc-helloworld helloworld.bond helloworld.cpp GRPC)
cxx_target_compile_definitions (MSVC grpc-helloworld PRIVATE -D_WIN32_WINNT=0x0600) 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) if (BOND_FIND_GRPC)
find_package(grpc CONFIG REQUIRED) find_package(grpc CONFIG REQUIRED)

Просмотреть файл

@ -1,6 +1,8 @@
add_bond_test (grpc-pingpong pingpong.bond pingpong.cpp GRPC) add_bond_test (grpc-pingpong pingpong.bond pingpong.cpp GRPC)
cxx_target_compile_definitions (MSVC grpc-pingpong PRIVATE -D_WIN32_WINNT=0x0600) 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) if (BOND_FIND_GRPC)
find_package(grpc CONFIG REQUIRED) find_package(grpc CONFIG REQUIRED)

Просмотреть файл

@ -1,6 +1,8 @@
add_bond_test (grpc-scalar scalar.bond scalar.cpp GRPC) add_bond_test (grpc-scalar scalar.bond scalar.cpp GRPC)
cxx_target_compile_definitions (MSVC grpc-scalar PRIVATE -D_WIN32_WINNT=0x0600) 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) if (BOND_FIND_GRPC)
find_package(grpc CONFIG REQUIRED) 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 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 ` Install-NuGetPackage `
-PackageId 'boost' ` -PackageId 'boost' `
@ -114,9 +114,9 @@ function Install-BoostComponent([string]$Component)
{ {
$packageId = "$Component-vc$(ConvertVcToolsetVer-ToBoostPackageFormat $VcToolsetVer)" $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 ` Install-NuGetPackage `
-PackageId $packageId ` -PackageId $packageId `