Граф коммитов

828 Коммитов

Автор SHA1 Сообщение Дата
Brody Berg f080297ca9 [gbc] Enable Stack for building gbc
- Enable install/build/test with Stack
- Ignore stack work
2017-06-26 11:25:10 -07:00
Christopher Warrington e3e7f0deb9 [c#] Switch to bond.snk for all strong-name signing (#505)
Previously, when when an official release of Bond was produced, a
Microsoft-internal key instead of bond.snk was used to strong-name sign
the assemblies. This means that locally produced assemblies and
Microsoft-produced assemblies have different strong names, making it
difficult to consume non-official releases in applications that require
strong-name signed assemblies.

This change switches to using bond.snk for all strong-name signing.

Official Microsoft release will still be Authenticode signed for
integrity. (Official release of Bond are already Authenticode signed.)

This is a breaking change, as it will change the strong name of the
assemblies.

Resolves https://github.com/Microsoft/bond/issues/414
2017-06-23 10:18:55 -07:00
Adam Sapek 7880d68dc6 Note service inheritance support in CHANGELOG 2017-06-19 10:48:15 -07:00
Adam Sapek 73ddb10d03 Make service inheritance syntax opt-in
Service inheritance syntax is disabled by default and can be enabled
using `--enable-service-inheritance` compiler switch.

Until code generation templates are updated to support service
inheritance the compiler will fail if `--grpc` or `--comm` options is
specified and the schema contains any service with a base.
2017-06-19 10:48:15 -07:00
Adam Sapek c2760d1b65 Extend IDL syntax to support service inheritance
Add syntax for inheritance in service definitions, e.g.:

    service Foo
    {
        Result foo(Param);
    }

    service Bar : Foo
    {
        Result bar(Param);
    }

In the AST a service base is represented as `Maybe Type`, the same way
as struct bases are represented. The parser validates that only a
concrete service or an instance of a generic service is used as a
base.
2017-06-19 10:48:15 -07:00
Christopher Warrington c94415ef42 [c++] Remove last boost::integral_constant uses
Commit fd9a186676 switched from boost::integral_constant to
std::integral_constant, but didn't make a clean break. With this change,
everything now uses std::integral_constant.
2017-06-15 16:49:53 -07:00
Chad Walters 236009e1be [c++] Upgrade rapidjson to v1.1
v1.1 addresses warning from Clang. Also, fix some issues in VC++ that the
upgrade exposed, specifically:

* Unreachable code warnings
* Conflicts due to mix/max macros in windef.h
* Warning due to converting enum to uint16_t
2017-06-13 19:04:04 -07:00
Chad Walters 7c6d64ad72 [c++] Suppress Comm codegen when Comm not enabled 2017-06-12 18:01:28 -07:00
Ara Ayvazyan 5454d52ea0 [c++] Remove bond::customize<protocols>
`bond::customize<protocols>` has been removed. All the public APIs that require a protocol list (e.g. `bond::Marshal`) now accept an extra template argument `Protocols` which defaults to `bond::BuiltInProtocols`. Custom input streams now require `bond::type_id<>` to be specialized with a unique magic number.

Closes https://github.com/Microsoft/bond/pull/425
2017-06-12 17:59:44 -07:00
Christopher Warrington e81d51b33b [c#] Remove deprecated Bond.BondReflection type 2017-06-07 11:10:51 -07:00
Chad Walters fa6f64617f [grpc] Add events to gRPC compat tests
Events have been added to both C++ and C#.
2017-06-05 17:08:23 -07:00
Chad Walters 82c97e1262 [c++ grpc] Expose ClientContext in proxy callback
The ClientContext is now passed back in the proxy's callback so that it
can be inspected after the response has been received.

Due to the larger number of items now being passed to the callback, the
struct unary_call_result has been introduced to bundle these together.
2017-06-02 21:59:15 -07:00
Chad Walters 35919011a0 [c++ grpc] Pass ClientContext by shared_ptr<>
* Simplify lifetime management of ClientContext by having
  unary_call_data own shared_ptr<ClientContext> instead of just taking
  ClientContext *.
* Generate overloads without a ClientContext parameter that construct
  one for the caller to simplify the common case.
* Documentation and examples used to demonstrate use of ClientContext.
2017-06-02 21:59:15 -07:00
Christopher Warrington f6c065cf17 [c++ grpc] Keep server io_manager alive for shutdown
When a `bond::ext::gRPC::server` is shutting down, it may need to send
responses to in-flight calls. To send these responses is needs an active
`io_manager`.

Before, `server::Shutdown()` also shut down the io_manager, which caused
in-flight calls to trigger the assert `!cqd->shutdown_called` inside of
gRPC's completion_queue.c (around line 500).

Now, we delay shutting down the `io_manager` until the server has been
completely shutdown and drained of existing work.
2017-06-01 19:22:31 -07:00
Christopher Warrington 9295e0106d [c++ grpc] Fix crash during unary_call destruction
There was a race between completion of sending a response (initiated by
`unary_call::Finish()` or `unary_call::FinishWithError()`) and
`unary_call::~unary_call()`.

The state backing `unary_call` (which is needed to send a response as
well) was stored in an instance of `unary_call_impl`. When
`unary_call::Finish()` or `unary_call::FinishWithError()` was called,
the response was enqueued with gRPC to be sent, referencing members of
`unary_call_impl`. When the response had finished being sent and gRPC no
longer needed to reference the members, `unary_call_impl::invoke()` was
called. The old behavior was to have `unary_call_impl` then delete
itself. That was not correct: the state inside of `unary_call_impl` is
needed while both 1) the response is being sent and 2) there is a
`unary_call` instance alive.

If the response was sent and `unary_call_impl::invoke()` was called
BEFORE the `unary_call` instance was destroyed, `unary_call` ended up
accessing the now-deleted `unary_call_impl` instance.

The new behavior is to have `unary_call` and `unary_call_impl`
participate in shared ownership, so the backing `unary_call_impl` will
remain alive as long as the `unary_call` instance is alive OR the
response is being sent.
2017-06-01 19:22:31 -07:00
Christopher Warrington e24b85a34b [c++ grpc] Upgrade to gRPC v1.3.4 (#477)
ClientAsyncResponseReader had a breaking API change that we needed to
adjust to.

The gRPC zlib submodule is now conflicting with the system-wide zlib.
When using CMake inside of Travis, we prefer the system-wide zlib
package over the submodule.

There also appears to be a bug with ClientAsyncResponseReader's
placement new and placement delete operators, so we're consuming a
slightly patched version (see
https://github.com/chwarr/grpc/commit/8bd0fb92ec for the delta).
Upstream issue https://github.com/grpc/grpc/issues/11301 has been opened
about this problem.
2017-06-01 19:17:48 -07:00
Eduardo Salinas f1daa5a798 [doc] Fix appveyor badge
- readme was not showing the correct badge
- appveyor badge api change
2017-06-01 17:30:40 -07:00
Christopher Warrington ba994530bb [c++] Mark custom stream interface BOND_NORETURN
The unspecialized custom stream inferface functions that exist solely to
describe the interface have static asserts that are always false.
However, they are also non-void functions that have no return
statements. g++ 5.4.0 emits a warning about the lack of a return
statement. It apparently cannot see that the static assert is always
false. BOND_NORETURN is used to indicate that these methods don't
actually ever return anything.
2017-05-31 21:48:39 -07:00
Eduardo Salinas f7f585bc2a [doc] Output all gbc options
- Show all gbc options in documentation
- When running gbc without options show full help
2017-05-31 19:12:54 -07:00
Christopher Warrington 4b96096668 [c++ grpc] Merge initial gRPC++ support 2017-05-31 14:50:14 -07:00
Chad Walters 12164849fa [grpc] Address race condition in gRPC compat tests
Ensure that the server has shutdown once all the expected requests have
been received and response have been queued up.
2017-05-31 12:51:27 -07:00
Chad Walters 8e1c32a31f [c++ grpc] Initial documentation of C++ gRPC
Also, align usage of term 'stub' with gRPC convention and improve
consistency of C# docs with new C++ documentation.
2017-05-31 12:32:17 -07:00
Eduardo Salinas 84dfc3cb1c [c++ grpc] Add non-bonded overloads to calls
- client-side, overload methods without bonded are generated
- server-side, Finish has an overload without bonded
- server-side, Finish's status paramater defaults to Status::OK
2017-05-31 12:24:32 -07:00
Christopher Warrington f9f2250356 [doc] Refine nullable, nothing, and default values
* Add an explicit section about default values
* Be explicit about what field types can have explicit vs. implicit vs.
  nothing default values.
* Improve cross-references.
* Copy relevant sections for C++ manual to C# manual. (This is the best
  we can do until we switch to something that let's us import section
  into multiple pages.

Closes https://github.com/Microsoft/bond/issues/464
2017-05-31 12:11:13 -07:00
Christopher Warrington 40170e6cce [c++ grpc] Use wait_callback to simplify pingpong 2017-05-31 11:42:32 -07:00
Christopher Warrington f2cdd185e9 [c++ grpc] Rename sync objects' wait to wait_for
The wait member function of barrier, countdown_event, and event that
takes a timeout has been renamed to wait_for to match
std::condition_variable.
2017-05-31 11:29:44 -07:00
Christopher Warrington 6edbef4d72 [c++ grpc] Make wait_callback final 2017-05-31 11:29:08 -07:00
Eduardo Salinas 35b6b85b74 [c++ grpc] Implement events and generic services
- codegen enabled for events and void types
- codegen for generic services
2017-05-30 21:09:01 -07:00
Christopher Warrington 9b38414874 [c++ grpc] Add wait_callback helper
The wait_callback helper can be used with the generated gRPC proxies to
synchronously wait for the proxy callback to be invoked.

* helloworld updated to use wait_callback
* gRPC compat client updated to use wait_callback
* unit tests added
2017-05-30 19:18:58 -07:00
Eduardo Salinas d08d1a889c [grpc c#] Remove use of localhost in examples and tests
- replace localhost with 127.0.0.1
2017-05-30 15:03:17 -07:00
Christopher Warrington 3cf0cf30b0 [c++ grpc] Take durations by const reference
For wait()-like functions we now take std::chrono::duration arguments by
const reference, just like std::condition_variable does.
2017-05-30 11:09:44 -07:00
Chad Walters 2be617f156 [appveyor] More optimization of AppVeyor builds
* Only load git submodules when they are needed.
* Remove redundant .NET Core build.
* Start slowest configurations first to reduce overall turn-around time.

Closes https://github.com/Microsoft/bond/pull/457
2017-05-26 17:22:45 -07:00
Christopher Warrington 8fbb4adc3f [travis] Refine boost-builder README
Closes https://github.com/Microsoft/bond/pull/462
2017-05-26 17:12:41 -07:00
Christopher Warrington 625dea66c7 [travis] Add Boost 1.64 to boost-builder 2017-05-26 17:12:41 -07:00
Christopher Warrington 37b926eb23 [travis] Add Boost 1.64 flavor
Closes https://github.com/Microsoft/bond/pull/461
2017-05-26 17:12:29 -07:00
Christopher Warrington 26cb3046ff [gbc] Pin gbc-tests to ansi-terminal < 0.6.3
The Hackage package ansi-terminal as of version 0.6.3 is no longer
building with GHC 7.8.3, which causes out CI builds to fail.

Issue https://github.com/feuerbach/ansi-terminal/issues/22 has been
opened about this, but until it is resolved, we need to use an earlier
version.
2017-05-25 17:13:49 -07:00
Christopher Warrington fb52cfe500 [c++] Only use /permissive- on VC++ 2017 and later
The original condition (`NOT (MSVC_VERSION LESS 1900)`) was triggering
for Visual C++ 2015 as well.

* Visual C++ 2015 has a `MSVC_VERSION` of 1900.
* Visual C++ 2017 has a `MSVC_VERSION` of 1910.

The original error was not caught, as it was causing the _command line
warning_ "Command line warning D9002 : ignoring unknown option
'/permissive-'" to be emitted. The CI builds don't fail on these sort of
warnings. (The cl.exe switch `/WX` does not turn this warning into a
non-zero exit code.)
2017-05-25 14:36:05 -07:00
Chad Walters 107e3facd0 [c#] Address issue with Mono .mdb -> .pdb change
Handle Mono build producing either a .mdb or a .pdb file.
2017-05-25 13:03:12 -07:00
Chad Walters 80ff78bde8 Fix gRPC example run in AppVeyor script 2017-05-24 19:16:31 -07:00
Chad Walters f2d35da213 Reduce redundancy in AppVeyor matrix 2017-05-24 19:16:31 -07:00
Christopher Warrington a8b8f9477f [c++ grpc] Use this-> for dependent base members
Accessing names that are dependent on the tempalted base class need to
be accessed via this->. Visual C++ 2015 doesn't enforce this everywhere,
but other compilers and Visual C++ 2017 need this.
2017-05-24 16:12:54 -07:00
Chad Walters e66d81faea [C# gRPC] Expand and improve documentation 2017-05-24 15:20:54 -07:00
Chad Walters 1f7c9e76fe [C# gRPC] Update examples
Move gRPC example to separate directory. Add link to standalone
example project.
2017-05-24 09:55:01 -07:00
Christopher Warrington a0b13dfa2e [appveyor] Build all C# compat tests in C++ build
We were only building the core C# compat test before. Now, we build the
Comm and gRPC variants as well.

We don't always need all of these C# compat tests--depending on what
part of C++ we're building--but they're pretty fast to build, so build
them all.
2017-05-24 01:38:48 -07:00
Christopher Warrington 1ce0cd3cde [appveyor] Install yasm if gRPC++ isn't disabled
The previous approach only installed yasm for entries in the matrix that
explicitly opted-in, which resulted in duplicate state. Now, it figures
out whether yasm is needed by looking for the BOND_ENABLE_GRPC CMake
flag.
2017-05-24 01:38:44 -07:00
Christopher Warrington 7e5a952994 [c++ grpc] Move thread_pool to bond::ext::gRPC
The namespace now matches the directory structure.
2017-05-24 01:15:59 -07:00
Christopher Warrington f600ed62fa [c++ grpc] Use more uniform Bond-style formatting 2017-05-24 01:09:05 -07:00
Christopher Warrington 105575567c [c++ grpc] Pass thread pool via shared_ptr
The thread pool needs to remain alive while its clients are alive as
well. This is now indicated by having the clients participate in shared
ownership of the thread pool.
2017-05-24 00:45:30 -07:00
Christopher Warrington f37dd5185a [c++ grpc] Simplify io_manager constructors
* For the common case when an io_manager is just needed to drive some
  I/O work (e.g., for a client proxy), there are new overloads that
  create a grpc::CompletionQueue.
2017-05-23 23:55:00 -07:00
Christopher Warrington d7cb5c608a Merge current master branch into grpc++ 2017-05-23 23:08:26 -07:00