Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.
Перейти к файлу
Christopher Warrington 4ea1574809
[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
2022-02-23 09:24:46 -08:00
.github/workflows [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
cmake [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
compiler [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
cpp [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
cs [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
doc [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
examples [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
idl/bond/core [c++ c#] Remove Bond Comm 2018-03-20 15:42:42 -07:00
java [gbc] Handle forward- and backslashes in paths 2018-05-10 19:33:26 -07:00
python [c++] [python] Replace deprecated std::ptr_fun 2020-12-16 09:03:15 -08:00
test/compat [c++ c#] Remove left over Comm compat test IDL 2018-05-14 22:05:08 -07:00
thirdparty [c++] Add CMake support for pre-installed gRPC 2021-03-10 10:15:54 -08:00
tools [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
.gitattributes [git] Make Linux scripts always use LF 2018-02-16 14:05:04 -08:00
.gitignore Ignore .vs folder 2017-10-09 11:21:08 -07:00
.gitmodules [c++] Upgrade RapidJSON to Apr 10, 2020 commit 2020-05-26 22:36:43 -07:00
CHANGELOG.md [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
CMakeLists.txt [c++] Add CMake support for pre-installed gRPC 2021-03-10 10:15:54 -08:00
CONTRIBUTING.md Switch to microsoft/bond casing 2019-05-07 16:32:20 -07:00
LICENSE Initial commit 2015-01-09 11:21:05 -08:00
NuGet.Config [c#] Add explicit NuGet.Config with sources 2020-12-16 09:03:00 -08:00
README.md [c++][c#][grpc] Deprecate Bond-over-gRPC 2022-02-23 09:24:46 -08:00
ThirdPartyNotices.txt Update third-party notices with gRPC and more 2017-09-15 17:03:27 -07:00
appveyor.yml [doc] Do not fail build when there are no changes 2021-03-18 11:17:12 -07:00

README.md

The Bond logo: a stylized glue gun


Build Status Bond.CSharp NuGet package

Bond

Bond is an open-source, cross-platform framework for working with schematized 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.

Bond is published on GitHub at https://github.com/microsoft/bond/.

For details, see the User's Manuals:

For a discussion about how Bond compares to similar frameworks see Why Bond.

Dependencies

Bond C++ library requires some C++11 features (currently limited to those supported by Visual C++ 2015); a C++11 compiler is required. Additionally, to build Bond you will need CMake (3.1+), Haskell Stack (1.5.1+) and Boost (1.61+).

Additionally, Bond requires RapidJSON and optionally requires gRPC. The Bond repository primarily uses Git submodules for these two dependencies. It should be cloned with the --recursive flag:

git clone --recursive https://github.com/microsoft/bond.git

If you already have RapidJSON and would like to build against it, add argument -DBOND_FIND_RAPIDJSON=TRUE to the CMake invocation. It will use find_package(RapidJSON). If you do not provide a RapidJSON library, Bond will also install RapidJSON.

If you do not wish to build the gRPC component, add argument -DBOND_ENABLE_GRPC=FALSE to the CMake invocation.

Following are specific instructions for building on various platforms.

Linux

Bond must be built with C++11 compiler. We test with Clang (3.8) and GNU C++ (5.4). We recommend Clang as it's faster with template-heavy code like Bond.

Run the following commands to install the minimal set of packages needed to build the core Bond library on Ubuntu 14.04:

sudo apt-get install \
    clang \
    cmake \
    zlib1g-dev \
    libboost-dev \
    libboost-thread-dev

Additionally, you need the Haskell Tool Stack. If your distro isn't shipping a new enough version of it, you may encounter some non-obvious build failures, so we recommend installing the latest Stack outside of package management:

curl -sSL https://get.haskellstack.org/ | sh

In the root bond directory run:

mkdir build
cd build
cmake -DBOND_ENABLE_GRPC=FALSE ..
make
sudo make install

The build directory is just an example. Any directory can be used as the build destination.

To build the Bond Python module, all the C++/Python tests and examples, and Bond-over-gRPC, a few more packages are needed.

sudo apt-get install \
    autoconf \
    build-essential \
    golang \
    libboost-date-time-dev \
    libboost-python-dev \
    libboost-test-dev \
    libtool \
    python2.7-dev

CMake needs to be re-run with different options. This can be done after building just the core libraries: the build tree will simply be updated with the new options.

cd build # or wherever you ran CMake before
cmake -DBOND_ENABLE_GRPC=TRUE -DgRPC_ZLIB_PROVIDER=package ..

Running the following command in the build directory will build and execute all the tests and examples:

make --jobs 8 check
sudo make install # To install the other libraries just built

(The unit tests are large so you may want to run 4-8 build jobs in parallel, assuming you have enough memory.)

macOS

Install Xcode and then run the following command to install the required packages using Homebrew (http://brew.sh/):

brew install \
    cmake \
    haskell-stack \
    boost \
    boost-python

(boost-python is optional and only needed for Python support.)

Bond can be built on macOS using either standard *nix makefiles or Xcode. In order to generate and build from makefiles, in the root bond directory run:

mkdir build
cd build
cmake -DBOND_ENABLE_GRPC=FALSE ..
make
sudo make install

Alternatively, you can generate Xcode projects by passing the -G Xcode option to cmake:

cmake -DBOND_ENABLE_GRPC=FALSE -G Xcode ..

You can build and run unit tests by building the check target in Xcode or by running make in the build directory:

make --jobs 8 check

Note that if you are using Homebrew's Python, you'll need to build boost-python from source:

brew install --build-from-source boost-python

and tell cmake the location of Homebrew's libpython by setting the PYTHON_LIBRARY variable, e.g.:

cmake .. \
    -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

Windows

Build Status

Install the following tools:

If you are building on a network behind a proxy, set the environment variable HTTP_PROXY, e.g.:

set HTTP_PROXY=http://your-proxy-name:80

Now you are ready to build the C# version of Bond. Open the solution file cs\cs.sln in Visual Studio and build as usual. The C# unit tests can also be run from within the solution.

To build using the .NET Core SDK:

dotnet restore cs\cs.sln
dotnet msbuild cs\cs.sln

The C++ and Python versions of Bond additionally require:

You may need to set the environment variables BOOST_ROOT and BOOST_LIBRARYDIR to specify where Boost and its pre-built libraries for your environment (MSVC 12 or MSVC 14) can be found, e.g.:

set BOOST_ROOT=D:\boost_1_61_0
set BOOST_LIBRARYDIR=D:\boost_1_61_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, and gRPC support. If Boost or Python libraries are not found on the system, then some tests and examples will not be built.

To generate a solution to build the Bond Core C++ and Python with Visual Studio 2015 run the following commands from the root bond directory:

mkdir build
cd build
set PreferredToolArchitecture=x64
cmake -DBOND_ENABLE_GRPC=FALSE -G "Visual Studio 14 2015 Win64" ..

Setting PreferredToolArchitecture=x64 selects the 64-bit toolchain which dramatically improves build speed. (The Bond unit tests are too big to build with 32-bit tools.)

Instead of cmake you can also use cmake-gui and specify configuration settings in the UI. This configuration step has to be performed only once. From then on you can use the generated solution build\bond.sln from Visual Studio or build from the command line using cmake:

cmake --build . --target
cmake --build . --target INSTALL

To build and execute the unit tests and examples run:

cmake --build . --target check -- /maxcpucount:8

To build Bond's gRPC++ integration from source, some of gRPC's prerequisites are also needed:

choco install activeperl golang ninja yasm

You will also need to enable gRPC in the cmake configuration step by running the following in the build directory from above and then following the other cmake commands above:

cmake -DBOND_ENABLE_GRPC=TRUE -G "Visual Studio 14 2015 Win64" ..

Alternatively, you can build and install Bond using the vcpkg dependency manager:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg integrate install
./vcpkg install bond

The Bond port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request in the vcpkg repository.

Contributing

Interested in contributing to Bond? Take a look at our contribution guidelines to get started.