Skip to content
/ bond Public
forked from microsoft/bond

Commit

Permalink
[c++ c#] Remove Bond Comm
Browse files Browse the repository at this point in the history
  • Loading branch information
chwarr committed Mar 9, 2018
1 parent b9950c4 commit e250b47
Show file tree
Hide file tree
Showing 352 changed files with 46 additions and 34,782 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ env:
- FLAVOR="cpp-core" BOOST="1.60.0" COMPILER="clang"
- FLAVOR="cpp-core" BOOST="1.59.0" COMPILER="clang"
- FLAVOR="cpp-core" BOOST="1.58.0" COMPILER="clang"
- FLAVOR="cpp-comm" BOOST="1.63.0" COMPILER="clang"
- FLAVOR="cpp-grpc" BOOST="1.66.0" COMPILER="gcc"
- FLAVOR="cpp-grpc" BOOST="1.65.1" COMPILER="clang"
- FLAVOR="cpp-grpc" BOOST="1.64.0" COMPILER="clang"
Expand Down
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ different versioning scheme, following the Haskell community's

## Unreleased ##
* `gbc` & compiler library: (major bump already done in bond.cabal)
* IDL core version: TBD
* IDL comm version: TBD
* IDL core version: (major bump needed)
* IDL comm version: (major bump needed)
* C++ version: (major bump needed)
* C# NuGet version: (major bump needed)
* C# Comm NuGet version: TBD

### `gbc` and Bond compiler library ###

* **Breaking change** Bond Comm, which has been deprecated since March 2017,
has been removed. [Issue
#824](https://github.com/Microsoft/bond/issues/824)
* C++ codegen now properly generates move assignment operator which was broken
for some cases.
* C++ codegen no longer generates checks for C++11, except for MSVC 2013 workarounds.
Expand All @@ -40,6 +42,9 @@ different versioning scheme, following the Haskell community's

### C++ ###

* **Breaking change** Bond Comm, which has been deprecated since March 2017,
has been removed. [Issue
#824](https://github.com/Microsoft/bond/issues/824)
* **Breaking change** Constructors accepting a `Comparer` have been removed from
`bond::maybe` and `bond::nullable` types.
* **Breaking change** The `bond::is_blob` and `bond::is_nullable` traits
Expand All @@ -65,6 +70,9 @@ different versioning scheme, following the Haskell community's

### C# ###

* **Breaking change** Bond Comm, which has been deprecated since March 2017,
has been removed. [Issue
#824](https://github.com/Microsoft/bond/issues/824)
* **Breaking change** The Bond.CSharp and Bond.Compiler.CSharp NuGet
packages perform implicit codegen when the simplified .NET Core `.csproj`
format is used. This breaking change *does not* affect projects using the
Expand Down
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ data. It supports cross-language serialization/deserialization and powerful
generic mechanisms for efficiently manipulating data. Bond is broadly used at
Microsoft in high scale services.

**IMPORTANT NOTE: The [Bond Communications framework](https://Microsoft.github.io/bond/manual/bond_comm.html)
-- known as Bond Comm -- is deprecated. We recommend using
[Bond-over-gRPC](https://Microsoft.github.io/bond/manual/bond_over_grpc.html) for communication.
The [Bond Comm C# manual](https://Microsoft.github.io/bond/manual/bond_cs.html#bond-comm)
and the [Bond Comm C++ manual](https://Microsoft.github.io/bond/manual/bond_cpp.html#bond-comm)
are preserved for transition purposes.**

Bond is published on GitHub at [https://github.com/Microsoft/bond/](https://github.com/Microsoft/bond/).
Bond is published on GitHub at
[https://github.com/Microsoft/bond/](https://github.com/Microsoft/bond/).

For details, see the User's Manuals:

Expand All @@ -43,12 +37,11 @@ The Bond repository uses Git submodules and should be cloned with the
git clone --recursive https://github.com/Microsoft/bond.git
```

Bond C++ library requires some C++11 features (currently limited to those
supported bv Visual C++ 2013); a C++11 compiler is required. Additionally,
to build Bond you will need CMake (3.1+),
[Haskell Stack](https://docs.haskellstack.org/en/stable/README/#how-to-install)
(1.5.1+) and Boost (1.58+). (Note: Boost 1.59 may not work with Bond Comm due to
some bugs in that version of the Boost ASIO library).
The Bond C++ library requires some C++11 features (currently limited to
those supported by Visual C++ 2013); a C++11 compiler is required.
Additionally, to build Bond you will need CMake (3.1+), [Haskell
Stack](https://docs.haskellstack.org/en/stable/README/#how-to-install)
(1.5.1+) and Boost (1.58+).

Following are specific instructions for building on various platforms.

Expand Down Expand Up @@ -227,7 +220,7 @@ set BOOST_LIBRARYDIR=D:\boost_1_58_0\lib64-msvc-14.0
```

The core Bond library and most examples only require Boost headers. The
pre-built libraries are only needed for unit tests, Python, gRPC, and Comm
pre-built libraries are only needed for unit tests, Python, and gRPC
support. If Boost or Python libraries are not found on the system, then some
tests and examples will not be built.

Expand Down
22 changes: 2 additions & 20 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# the Windows builds.
- .travis.yml
- tools/ci-scripts/linux/**

environment:
global:
STACK_ROOT: "c:\\sr"
Expand Down Expand Up @@ -73,27 +73,13 @@
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_GRPC=FALSE"
# C++ Comm build and tests
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_COMM=TRUE;-DBOND_ENABLE_GRPC=FALSE;-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
# C++ gRPC build and tests
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
# C++ Comm build and tests (Visual C++ 2013)
- BOND_BUILD: C++
BOND_VS: "Visual Studio 12 2013"
BOND_VS_NUM: 12
BOND_ARCH: 64
BOND_BOOST: 58
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_COMM=TRUE;-DBOND_ENABLE_GRPC=FALSE;-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
install:
- ps: >-
if (($env:BOND_BUILD -eq 'C++') -or ($env:BOND_BUILD -eq 'Python')) {
Expand Down Expand Up @@ -208,7 +194,7 @@
# on what part of C++ we're building--but they're pretty
# fast to build, so build them all.
$compatTests = ('Tests\CommCompatClient', 'Tests\CommCompatServer', 'Tests\Compat', 'Tests\GrpcCompatClient', 'Tests\GrpcCompatServer')
$compatTests = ('Tests\Compat', 'Tests\GrpcCompatClient', 'Tests\GrpcCompatServer')
msbuild cs\cs.sln /verbosity:minimal "/target:$($compatTests -join ';')" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Expand Down Expand Up @@ -321,10 +307,6 @@
& examples\cs\grpc\scalar\bin\Debug\grpc-scalar.exe
if (-not $?) { throw "tests failed" }
# We need to investigate why these tests are failing in AppVeyor, but not locally.
# nunit-console-x86 /framework:net-4.5 /labels "cs\test\comm\bin\debug\net45\${env:BOND_OUTPUT}\Bond.Comm.UnitTest.dll"
# if (-not $?) { throw "tests failed" }
}
if ($env:BOND_BUILD -eq "C# .NET Core") {
Expand Down
21 changes: 2 additions & 19 deletions cmake/Bond.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ include (Folders)
#
# add_bond_codegen (file.bond [file2.bond ...]
# [ENUM_HEADER]
# [COMM]
# [GRPC]
# [OUTPUT_DIR dir]
# [IMPORT_DIR dir [dir2, ...]]
# [OPTIONS opt [opt2 ...]])
# [TARGET name]
#
function (add_bond_codegen)
set (flagArgs ENUM_HEADER COMM GRPC)
set (flagArgs ENUM_HEADER GRPC)
set (oneValueArgs OUTPUT_DIR TARGET)
set (multiValueArgs IMPORT_DIR OPTIONS)
cmake_parse_arguments (arg "${flagArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand All @@ -32,9 +31,6 @@ function (add_bond_codegen)
if (arg_ENUM_HEADER)
list(APPEND options --enum-header)
endif()
if (arg_COMM)
list(APPEND options --comm)
endif()
if (arg_GRPC)
list(APPEND options --grpc)
endif()
Expand All @@ -52,10 +48,6 @@ function (add_bond_codegen)
if (arg_ENUM_HEADER)
list(APPEND outputs "${outputDir}/${name}_enum.h")
endif()
if (arg_COMM)
list(APPEND outputs "${outputDir}/${name}_comm.cpp")
list(APPEND outputs "${outputDir}/${name}_comm.h")
endif()
if (arg_GRPC)
list(APPEND outputs "${outputDir}/${name}_grpc.cpp")
list(APPEND outputs "${outputDir}/${name}_grpc.h")
Expand Down Expand Up @@ -84,39 +76,31 @@ endfunction()
# add_bond_executable (name
# [schem.bond [schema2.bond]]
# source.cpp [source2.cpp]
# [COMM]
# [GRPC])
#
function (add_bond_executable target)
set (schemas)
set (sources)
set (flagArgs COMM GRPC)
set (flagArgs GRPC)
cmake_parse_arguments (arg "${flagArgs}" "" "" ${ARGN})
foreach (file ${ARGV})
get_filename_component (ext ${file} EXT)
if (ext STREQUAL ".bond")
get_filename_component (name ${file} NAME_WE)
list (APPEND schemas "${file}")
list (APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}_types.cpp")
if (arg_COMM)
list (APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}_comm.cpp")
endif()
if (arg_GRPC)
list (APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}_grpc.cpp")
endif()
endif()
endforeach()
if (schemas)
set (options)
if (arg_COMM)
list (APPEND options COMM)
endif()
if (arg_GRPC)
list (APPEND options GRPC)
endif()
add_bond_codegen (${schemas} ${options})
endif()
list (REMOVE_ITEM ARGV COMM)
list (REMOVE_ITEM ARGV GRPC)
add_executable (${ARGV} ${sources})
add_target_to_folder(${target})
Expand All @@ -133,7 +117,6 @@ endfunction()
# [schem.bond [schema2.bond]]
# source.cpp [source2.cpp]
# [BUILD_ONLY]
# [COMM]
# [GRPC])
#
function (add_bond_test test)
Expand Down
22 changes: 2 additions & 20 deletions cmake/Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ if (WIN32)
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/core/bin/debug"
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/core/bin/retail")

find_program (BOND_CSHARP_COMM_COMPAT_SERVER CommCompatServer.exe
PATH_SUFFIXES net45
NO_DEFAULT_PATH
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/server/bin/debug"
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/server/bin/retail")

find_program (BOND_CSHARP_COMM_COMPAT_CLIENT CommCompatClient.exe
PATH_SUFFIXES net45
NO_DEFAULT_PATH
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/client/bin/debug"
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/client/bin/retail")

find_program (BOND_CSHARP_GRPC_COMPAT_SERVER GrpcCompatServer.exe
PATH_SUFFIXES net45
NO_DEFAULT_PATH
Expand Down Expand Up @@ -205,10 +191,6 @@ set (BOND_LIBRARIES_INSTALL_CPP
"FALSE"
CACHE BOOL "If TRUE, the .cpp files for the Bond libraries will be installed under src/ as part of the INSTALL target.")

set (BOND_ENABLE_COMM
"FALSE"
CACHE BOOL "If FALSE, then do not build Comm")

set (BOND_ENABLE_JAVA
"FALSE"
CACHE BOOL "If TRUE, then build Java libraries")
Expand All @@ -229,6 +211,6 @@ set (BOND_STACK_OPTIONS
""
CACHE STRING "Options to pass to Haskell Stack")

if (((BOND_ENABLE_COMM) OR (BOND_ENABLE_GRPC)) AND ((CXX_STANDARD LESS 11) OR (MSVC_VERSION LESS 1800)))
message(FATAL_ERROR "BOND_ENABLE_COMM and/or BOND_ENABLE_GRPC is TRUE but compiler specified does not support C++11 standard")
if (BOND_ENABLE_GRPC AND ((CXX_STANDARD LESS 11) OR (MSVC_VERSION LESS 1800)))
message(FATAL_ERROR "BOND_ENABLE_GRPC is TRUE but compiler specified does not support C++11 standard")
endif()
9 changes: 3 additions & 6 deletions compiler/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ cppCodegen options@Cpp {..} = do
]
templates = concat $ map snd $ filter fst codegen_templates
codegen_templates = [ (core_enabled, core_files)
, (comm_enabled, [comm_h export_attribute, comm_cpp])
, (grpc_enabled, [grpc_h export_attribute, grpc_cpp])
]
core_files = [
Expand All @@ -122,7 +121,6 @@ csCodegen options@Cs {..} = do
else Properties
templates = concat $ map snd $ filter fst codegen_templates
codegen_templates = [ (structs_enabled, [types_cs Class fieldMapping])
, (comm_enabled, [comm_interface_cs, comm_proxy_cs, comm_service_cs])
, (grpc_enabled, [grpc_cs])
]
csCodegen _ = error "csCodegen: impossible happened."
Expand All @@ -141,10 +139,9 @@ codeGen options typeMapping templates file = do
namespaceMapping <- parseNamespaceMappings $ namespace options
(Bond imports namespaces declarations) <- parseFile (import_dir options) file
let mappingContext = MappingContext typeMapping aliasMapping namespaceMapping namespaces
case (anyServiceInheritance declarations, service_inheritance_enabled options, grpc_enabled options, comm_enabled options) of
(True, False, _, _) -> fail "Use --enable-service-inheritance to enable service inheritance syntax."
(True, True, True, _) -> fail "Service inheritance is not supported in gRPC codegen."
(True, True, _, True) -> fail "Service inheritance is not supported in Comm codegen."
case (anyServiceInheritance declarations, service_inheritance_enabled options, grpc_enabled options) of
(True, False, _) -> fail "Use --enable-service-inheritance to enable service inheritance syntax."
(True, True, True) -> fail "Service inheritance is not supported in gRPC codegen."
_ -> forM_ templates $ \template -> do
let (suffix, code) = template mappingContext baseName imports declarations
let fileName = baseName ++ suffix
Expand Down
4 changes: 0 additions & 4 deletions compiler/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ data Options
, jobs :: Maybe Int
, no_banner :: Bool
, core_enabled :: Bool
, comm_enabled :: Bool
, grpc_enabled :: Bool
, alloc_ctors_enabled :: Bool
, type_aliases_enabled :: Bool
Expand All @@ -58,7 +57,6 @@ data Options
, jobs :: Maybe Int
, no_banner :: Bool
, structs_enabled :: Bool
, comm_enabled :: Bool
, grpc_enabled :: Bool
, service_inheritance_enabled :: Bool
}
Expand Down Expand Up @@ -96,7 +94,6 @@ cpp = Cpp
, jobs = def &= opt "0" &= typ "NUM" &= name "j" &= help "Run NUM jobs simultaneously (or '$ncpus' if no NUM is not given)"
, no_banner = def &= help "Omit the banner at the top of generated files"
, core_enabled = True &= explicit &= name "core" &= help "Generate core serialization definitions (true by default, --core=false to disable)"
, comm_enabled = False &= explicit &= name "comm" &= help "Generate comm definitions"
, grpc_enabled = False &= explicit &= name "grpc" &= help "Generate gRPC definitions"
, alloc_ctors_enabled = False &= explicit &= name "alloc-ctors" &= help "Generate constructors with allocator argument"
, type_aliases_enabled = False &= explicit &= name "type-aliases" &= help "Generate type aliases"
Expand All @@ -112,7 +109,6 @@ cs = Cs
, readonly_properties = def &= name "r" &= help "Generate private property setters"
, fields = def &= name "f" &= help "Generate public fields rather than properties"
, structs_enabled = True &= explicit &= name "structs" &= help "Generate C# types for Bond structs and enums (true by default, use \"--structs=false\" to disable)"
, comm_enabled = False &= explicit &= name "comm" &= help "Generate C# services and proxies for Bond Comm"
, grpc_enabled = False &= explicit &= name "grpc" &= help "Generate C# services and proxies for gRPC"
} &=
name "c#" &=
Expand Down
3 changes: 0 additions & 3 deletions compiler/bond.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ library
Language.Bond.Codegen.Cpp.Reflection_h
Language.Bond.Codegen.Cpp.Types_cpp
Language.Bond.Codegen.Cpp.Types_h
Language.Bond.Codegen.Cpp.Comm_cpp
Language.Bond.Codegen.Cpp.Comm_h
Language.Bond.Codegen.Cpp.Grpc_cpp
Language.Bond.Codegen.Cpp.Grpc_h
Language.Bond.Codegen.Cs.Types_cs
Language.Bond.Codegen.Cs.Comm_cs
Language.Bond.Codegen.Cs.Grpc_cs
Language.Bond.Codegen.Cpp.ApplyOverloads
Language.Bond.Codegen.Cpp.Util
Expand Down
33 changes: 0 additions & 33 deletions compiler/src/Language/Bond/Codegen/Cpp/Comm_cpp.hs

This file was deleted.

Loading

0 comments on commit e250b47

Please sign in to comment.