Skip to content
/ bond Public
forked from microsoft/bond

Commit

Permalink
[c++][c#][grpc] Deprecate Bond-over-gRPC
Browse files Browse the repository at this point in the history
Microsoft ceased its direct investment in Bond-over-gRPC in December
2021. GitHub issue [microsoft#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.
* Add note about deprecation in documentation.
* Minor usability improvements to the Install-Boost.ps1 script.

Fixes microsoft#1108

[1]: microsoft#1131
  • Loading branch information
chwarr committed Feb 19, 2022
1 parent 48dfc05 commit 76a6809
Show file tree
Hide file tree
Showing 39 changed files with 151 additions and 41 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/linux_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* A `[[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))
Expand All @@ -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.
* A `[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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions cmake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
cxx_target_compile_options (Clang ${target} PRIVATE -Wno-unknown-attributes -Wno-deprecated-declarations)
cxx_target_compile_options (GNU ${target} PRIVATE -Wno-attributes -Wno-deprecated-declarations)

cxx_target_compile_options (MSVC ${target} PRIVATE /wd4996)
endfunction()
8 changes: 4 additions & 4 deletions compiler/bond.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -89,7 +89,7 @@ executable gbc
Options
Paths_bond
hs-source-dirs:
./.
./
build-depends:
aeson
, async
Expand Down Expand Up @@ -130,7 +130,7 @@ test-suite gbc-tests
Options
hs-source-dirs:
tests
./.
./
build-depends:
Diff
, HUnit
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/abstract_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/basic_thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/io_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/reflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/service_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/shared_unary_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions cpp/inc/bond/ext/grpc/thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/unary_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/unary_call_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/wait_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion cpp/inc/bond/ext/grpc/win_thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 6 additions & 0 deletions cpp/test/compat/grpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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)
Expand Down
7 changes: 7 additions & 0 deletions cpp/test/grpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -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++)
Expand All @@ -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)

Expand Down
1 change: 1 addition & 0 deletions cs/src/grpc/Marshaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions cs/src/grpc/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -31,6 +32,7 @@ public interface IMessage<out T>
/// <summary>
/// Factory methods for creating <see cref="IMessage{T}" /> instances.
/// </summary>
[Obsolete(message: ObsoleteMessage.Value, error: false)]
public static class Message
{
/// <summary>
Expand Down Expand Up @@ -99,6 +101,7 @@ internal static IBonded<TMessage> MakeMostDerivedIBonded<TMessage>(TMessage payl
/// 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>
Expand Down
2 changes: 2 additions & 0 deletions cs/src/grpc/NothingCalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -75,6 +76,7 @@ private static void ObserveAndIgnoreTaskException(Task t)
/// 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>
Expand Down
13 changes: 13 additions & 0 deletions cs/src/grpc/Obsolete.cs
Original file line number Diff line number Diff line change
@@ -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";
}
}
4 changes: 4 additions & 0 deletions cs/test/compat/grpc/client/GrpcCompatClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions cs/test/compat/grpc/server/GrpcCompatServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions cs/test/compat/grpc/shared/GrpcCompatShared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions cs/test/grpc/grpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading

0 comments on commit 76a6809

Please sign in to comment.