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

1231 Коммитов

Автор SHA1 Сообщение Дата
Ted Stein a9167d7ccc [cmake] Print out errors from failed stack steps
Per [cmake docs](https://cmake.org/cmake/help/v3.0/command/execute_process.html), if you set both `OUTPUT_VARIABLE` and `ERROR_VARIABLE` to the same var, it will contain both streams' lines, merged in the order they were printed.
2018-02-13 09:18:07 -08:00
Ara Ayvazyan f32cf13c2b [doc] Improve syntax highlighting
Language-specific syntax highlighting now used on code blocks.
2018-02-05 18:49:27 -08:00
Ted Stein 95747ded0b [c++] #include <new> for std::bad_alloc
Resolves https://github.com/Microsoft/bond/issues/786
2018-02-01 09:23:30 -08:00
Christopher Warrington cf0de7f1df [gbc] Clean up service AST documentation
* Remove duplicate "Service" section.
* Remove incorrect "Service method" that talked about passing messages
  and services, which was never implemented in gbc.
2018-01-31 15:58:26 -08:00
Christopher Warrington 14c425bd57 Fix whitespace in .gitmodules
Tabs to spaces.
2018-01-29 10:08:59 -08:00
Christopher Warrington fc1581a114 Ignore dirty grpc submodule
When using CMake to build, the zlib submodule inside of the grpc
submodule ends up with a generated file that makes Git consider the
submodule dirty. This state can be ignored for day-to-day development.
2018-01-26 08:55:07 -08:00
Christopher Warrington 0054ec653b [c++] Add missing static_casts in io_manager tests
grpc::Alarm takes a void*, but io_manager expects io_manager_tag*. Thus,
we should have been casting alarm_completion_tag* to io_manager_tag*.
2018-01-17 11:29:58 -08:00
Ara Ayvazyan 88635fc413 [c++] Fix potential size overflow in binary protocols' Skip 2018-01-12 14:24:20 -08:00
Ara Ayvazyan 03b4484b56 [c++] Fix potential loop overflows 2018-01-11 08:08:08 -08:00
Ara Ayvazyan 27e91d5119 [c++] Improve compact/fast binary protocols' Skip 2018-01-10 11:36:58 -08:00
Christopher Warrington e96a8deb44 [travis] Add Boost 1.66 flavors
* Switch G++ tests to use Boost 1.66
* Add Clang++ test for Boost 1.66
* Switch CI image to one built from commit 0637203975
2018-01-09 11:00:12 -08:00
Ara Ayvazyan 05d6783e08 [c++ grpc] Simplify io_manager::wait 2018-01-08 17:41:53 -08:00
Christopher Warrington 0637203975 [travis] Add Boost 1.66 to CI image builder script
This is the first step in enabling Boost 1.66 CI build on Travis. After
an image is produced that contains Boost 1.66, we still need to consume
that image in .travis.yml and add 1.66 to the configuration matrix.

I've locally tested that Bond builds and the basic tests pass with Boost
1.66 using Clang.
2018-01-08 16:22:05 -08:00
Ara Ayvazyan 8eebf59d88 [c++ grpc] Fix race in unary_call destruction 2018-01-08 16:13:38 -08:00
Ara Ayvazyan 55509efb11 [c++ grpc] Fix race in io_manager
Fixes a race condition when `bond::ext::gRPC::io_manager::shutdown` and
`bond::ext::gRPC::io_manager::wait` are called concurrently. The functions
are not mutually exclusive and the latter destroys the
`grpc::CompletionQueue` which is not necessary.

Fixes https://github.com/Microsoft/bond/issues/744
2018-01-05 17:14:38 -08:00
Ara Ayvazyan ffae9a86a8 [c++ grpc] Fix atomic_flag init. in io_manager 2017-12-29 17:37:30 -08:00
Ara Ayvazyan 2f5619d9d4 [c++ grpc] Fix std::atomic_flag initialization 2017-12-29 10:45:11 -08:00
Ara Ayvazyan 4720490e14 [c++ grpc] Fix incorrect casts to void*
The bond::ext::gRPC::io_manager expects pointers to bond::ext::gRPC::io_manager_tag base when it receives void* tags. However, we are are directly passing a pointer to derived type instead of explicitly casting to base (which does not cause issues due to current layout of those objects).
2017-12-29 10:44:33 -08:00
Ara Ayvazyan 533092bb25 [c++] Minor refactoring of bond::MapTo 2017-12-20 15:18:21 -08:00
Ara Ayvazyan f2c105f279 [c++] Fix missing type param. in MapTo<T>::Field 2017-12-19 11:22:21 -08:00
Ara Ayvazyan e59bd43f20 [c++] Improve StaticParser<Input>::ReadFields
Simplifies the StaticParser<Input>::ReadFields function when used with protocols that do not implement field omitting by excluding some run-time code paths.
2017-12-18 13:35:08 -08:00
Ara Ayvazyan 5274f45f70 [doc] Update README with min. stack version 2017-12-18 11:16:33 -08:00
Ara Ayvazyan 03c685ecb4 [c++] Use extern template for common code 2017-12-14 14:55:57 -08:00
Christopher Warrington 3e03d438cf [c++] Add toolchain agnostic integration instructions 2017-12-14 14:42:11 -08:00
Ara Ayvazyan 0cc2355067 [c++] Minor refactoring of bond::To 2017-12-14 13:25:48 -08:00
Ara Ayvazyan d5d7927b3a [c++] Improve bonded<void, Reader>::_Apply
Simplifies the `bonded<void, Reader>::_Apply` function when used with
protocols that specify `uses_marshaled_bonded<Reader>` to be `false_type`
(currently all except `Simple`) by excluding some run-time code paths.
2017-12-13 13:09:41 -08:00
Ara Ayvazyan cf56ab5099 [c++] Improve UnknownFieldOrTypeMismatch
Simplifies the `DynamicParser<Input>::UnknownFieldOrTypeMismatch` function
for basic types by excluding some run-time code paths.
2017-12-13 13:09:10 -08:00
Ara Ayvazyan 9edf0a4c55 [c++] Remove duplicated code in DynamicParser 2017-12-13 13:08:36 -08:00
Ara Ayvazyan 9ca99d45b8 [c++] Fix base to derived deserialization
With this change deserialization will now fail by throwing `bond::CoreException` when `BT_STOP` is encountered while deserializing a base struct.

Fixes https://github.com/Microsoft/bond/issues/742
2017-12-11 13:34:17 -08:00
Christopher Warrington 524921206a
[c# grpc] Allow [Bond.Attribute] on methods
* This fixes broken C# codegen when a service method has attributes.
* Add both C++ and C# unit test to make sure that service and method
  attributes are properly generated and accessible.

Fixes https://github.com/Microsoft/bond/issues/617
2017-12-07 17:38:40 -08:00
Christopher Warrington 7b6dcedd7a
[travis] Automate building of Docker images
* Use `docker pull` to download a pre-built image from
  bondciimages.azurecr.io instead of `wget` then `docker load`.
    * This speeds up image downloading by about 25%.
* Update tools/ci-scripts/linux/image-builder/README.md to indicate that
  images are built automatically in a Microsoft VSTS build queue.
* Delete helper build_image.zsh and upload_image.zsh scripts.
2017-12-07 17:37:49 -08:00
Christopher Warrington 95c4f9d6e4 [c++ grpc] Fix includes when bond::Void is used
When a service contains events or parameter-less methods, the generated
code uses `bond::Void` as the request/result type. To serialize
`bond::Void`, bond_reflection.h needs to be included.

The generated service code now includes bond_reflection.h if any service
contains an event or a parameter-less method.

Fixes https://github.com/Microsoft/bond/issues/735
2017-12-05 18:07:41 -08:00
Ara Ayvazyan 48c4d43011 [gbc c++] Use Pass0 instead of private counter 2017-12-04 18:06:30 -08:00
Eduardo Salinas 5f82bc68b1 [gbc] Switch from Parsec to Megaparsec
- gbc can only be built with GHC >= 8.0.1
- stack resolver has been updated
- improve error messages
- add a comment about parser ordering to avoid regression
- added python script to compare gbc outputs
2017-12-04 18:00:37 -08:00
Ara Ayvazyan 924050a30d [c++] Make Serializer::Field faster to compile
The change adds overloads of `Serializer::Field` function that avoids generating calls to `detail::omit_field` in the cases where the result is known at compilation. This makes the compilation a bit faster (it depends on actual types being used, but the expected estimate would be 3-5%) and also likely to generate faster, smaller and more efficient runtime code when compiler fails to optimize away the above calls.
2017-12-04 17:16:22 -08:00
Ted Stein 77a2f76a92 Generate Java docs properly + add gradle plugin docs
* Generate Java docs properly.

* Add explicit documentation of the Gradle plugin.

* Update Java documentation and improve linking.
2017-12-04 16:33:51 -08:00
Ted Stein a8ad34994f Add Java guide. 2017-12-01 15:39:00 -08:00
Ted Stein ae93a9f2e9 java core: Make protocol version vars consistent. 2017-12-01 15:39:00 -08:00
Christopher Warrington 46527ce7df [c++] Copy edit coding guidelines 2017-11-27 13:33:36 -08:00
Christopher Warrington 7189d4c4e0 [c++] Clean up includes
* Use `#pragma once` everywhere.
* Every header now include `<bond/core/config.h>` before anything else.
* Includes are done in sections, from least general to most general.
* Includes within each section are sorted in lexicographical order.
* CODING_GUIDELINES_CPP.md added to capture these guidelines.
2017-11-27 13:05:07 -08:00
Christopher Warrington c31e5ce3b2 [c++] Skip core_test_common in default build
Fixes https://github.com/Microsoft/bond/issues/723
2017-11-21 16:32:46 -08:00
Eduardo Salinas ce95a54265 [gbc] Improve parsing of import statements
* [gbc] Improve parsing of import statements
* add optional semi colon after an import statement
2017-11-21 16:30:03 -08:00
Ted Stein c3faed8656 [travis] Split CI into flavor scripts
* Eliminate redundant vars.
* Set up for separated build scripts.
* Break hs and cs into separate scripts.
2017-11-20 20:03:54 -08:00
Ara Ayvazyan 77424c7ab2 [gbc] Remove redundant import 2017-11-17 15:42:05 -08:00
Christopher Warrington 20c611110a [c#] Add cloning to expressions test
Also, tweaked the friendly names assigned to some variables used during
expression generation to distinguish between source and destination
objects.
2017-11-17 13:24:28 -08:00
Ara Ayvazyan edf6bdc62c [c++] Reduce included headers for Simple JSON
This change introduces a `BOND_LIB_TYPE` macro and moves some utility
functions used by the Simple JSON protocol to corresponding source file
which reduces the number of included files by over 240.

The `BOND_LIB_TYPE` macro will allow:
- to keep some expensive-to-compile headers away from public ones
- pre-compile some common parts of the library
2017-11-17 11:30:05 -08:00
Ara Ayvazyan 55ca8fa7d1 [c++] Support custom types for enum name/value maps
Currently C++ enum's name-to-value and value-to-name maps use a `std::map`
and are always constructed, even when not used. This change:

- allows the user to provide custom map type (e.g.
  `boost::container::flat_map`)
- lazily constructs the map on first access
- changes the default generated conversion functions to use
  `std::unordered_map`
2017-11-17 11:28:46 -08:00
Ted Stein c758ffa117 [java] Allow maven publication and clean up
This commit removes the need for the mvn binary and converts all
Java dependencies within the repo to true dependencies, rather than file
references. It also generates automatic versions for the core and
gradle-plugin projects from git tags.
2017-11-16 16:00:58 -08:00
Ara Ayvazyan 91c3991bb9 [gbc c++] Use init. list for populating attr. map
Currently, `boost::assign::map_list_of` is used to initialize C++ metadata
attribute maps. This change makes use of [list initialization][1] available
in C++11 which is more appropriate and removed the dependency on a Boost
header.

[1]: [http://en.cppreference.com/w/cpp/language/list_initialization
2017-11-16 15:41:50 -08:00
Ara Ayvazyan cfbd4170e0 [gbc c++] Do not apply export attrib. to generics
Currently, the `--export-attribute` is used to mark all static
`bond::Metadata` fields in a compile-time `Schema` object, including when
the type is a template, which is not correct. This change has `gbc` skip the
attribute in such cases.
2017-11-15 14:26:20 -08:00