Gichan Jang [Fri, 14 May 2021 01:09:11 +0000 (10:09 +0900)]
[Python] Add flatbuffers python packaging
Add flatbuffers python packaging
Change-Id: Idb93e673facd7c8eb91dad731547fec13af68101
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
Gichan Jang [Thu, 13 May 2021 03:47:29 +0000 (12:47 +0900)]
Bump to flatbuffers 2.0.0
Bump to flatbuffers 2.0.0
Change-Id: I5f229796cccfdb60cd15c29996aff57f75bc5cdb
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
Wook Song [Tue, 15 Sep 2020 07:54:01 +0000 (16:54 +0900)]
[Dist/Debian] Include .pc file in the dev-kit package
This patch revises the packaging files for Debian/Ubuntu to include .pc
file in the development kit package.
Change-Id: Ib94702ace3a970cfe5ab435c34795ac03296e02e
Signed-off-by: Wook Song <wook16.song@samsung.com>
Wook Song [Tue, 15 Sep 2020 07:48:57 +0000 (16:48 +0900)]
[Dist/Tizen] Revise the rpm spec file to include .pc in the dev package
This patch revises the rpm spec file to include the .pc file in the
dev-kit package.
Change-Id: I456b1fa494a38cd9cd1724863028a9b69ac7df4b
Signed-off-by: Wook Song <wook16.song@samsung.com>
Wook Song [Tue, 15 Sep 2020 07:46:31 +0000 (16:46 +0900)]
[PkgConfig] Add a template for .pc file generation
This patch adds a template file to use .pc file generation.
Change-Id: Ia4841a6c4bcf3560e1156a606a85f0d2103ffebd
Signed-off-by: Wook Song <wook16.song@samsung.com>
Wook Song [Tue, 15 Sep 2020 02:40:39 +0000 (11:40 +0900)]
[Dist/Debian] Fix unmet dependency on libgcc-s1 in the PPA package
Since PPA tries to use the latest gcc, the package released via PPA has
an issue related to the unmet dependency on libgcc-s1. To fix it, this
patch adds explicit build dependencies on gcc << 10.
Change-Id: If76cde33d9b6aaeb051894b55c22f256bddc9a36
Signed-off-by: Wook Song <wook16.song@samsung.com>
Geunsik Lim [Mon, 3 Aug 2020 08:34:45 +0000 (17:34 +0900)]
Bump to flatbuffers 1.12.0
Change-Id: I228241b006edf9850e035a96b69fc6c305905280
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
Semun Lee [Fri, 17 Jul 2020 09:27:47 +0000 (18:27 +0900)]
Add -fno-lto for creating static library
When -flto option is used, static library doesn't contain
symbol names in it.
It may leads "undefined symbol" problem in some applications.
Change-Id: I3ab5f644b72e504d9390311e4ce945d9ac28527e
Signed-off-by: Semun Lee <semun.lee@samsung.com>
Wook Song [Wed, 12 Feb 2020 07:25:15 +0000 (16:25 +0900)]
[Dist/Debian] Initial debianization for v1.11.0
Initial debianization for v1.11.0.
Change-Id: Ie27a37855e782277c60908ebea9b363d296d34a3
Signed-off-by: Wook Song <wook16.song@samsung.com>
MyungJoo Ham [Fri, 27 Mar 2020 00:52:34 +0000 (09:52 +0900)]
Re-ported build-error workaround from 1.6.0
There was a build-error fix in flatbuffers-1.6.0, which
was in bash build script. They appear to lose it when
they abandoned the bash build script.
The following is the commit message of the workaround
of flatbuffers 1.6.0 mainline:
Work around flatbuffers flaky build
The flatbuffers build ocasionally fails with the following error:
/flatbuffers/flatbuffers-1.6.0/src/idl_parser.cpp
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:17:
error: 'MyGame' has not been declared
using namespace MyGame::Sample;
^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:25:
error: 'Sample' is not a namespace-name
using namespace MyGame::Sample;
^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:31:
error: expected namespace-name before ';' token
using namespace MyGame::Sample;
^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp: In
function 'int main(int, const char**)':
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:25:3:
error: 'flatbuffers' has not been declared
flatbuffers::FlatBufferBuilder builder;
^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:28:26:
error: 'builder' was not declared in this scope
auto weapon_one_name = builder.CreateString("Sword");
^
...
Disabling the BUILD_TESTS target removes the flakiness and makes the
compilation faster.
Reviewed-on: http://gerrit.cloudera.org:8080/12886
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Tim Armstrong <tarmstrong@cloudera.com>
Change-Id: Ica8300d7edad7d10adad311cc22c18b8987b1f9b
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Parichay Kapoor [Fri, 15 Nov 2019 06:22:27 +0000 (15:22 +0900)]
[Dist/Tizen] Add rpm spec and manifest files to support GBS
This PR provides tizen packages, flatbuffers and flatbuffers-devel.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Wouter van Oortmerssen [Mon, 10 May 2021 18:45:16 +0000 (11:45 -0700)]
More missing version changes
Wouter van Oortmerssen [Mon, 10 May 2021 18:35:00 +0000 (11:35 -0700)]
Dart generated code update
Change-Id: I317d731d17d733088cad608364b614bff8151c36
Wouter van Oortmerssen [Mon, 10 May 2021 18:20:09 +0000 (11:20 -0700)]
Swift/Kotlin generated code version updates
Change-Id: I035163cb5edd087a190bb518e686c79887241383
Wouter van Oortmerssen [Mon, 10 May 2021 18:27:06 +0000 (11:27 -0700)]
C++/Rust version changes
Wouter van Oortmerssen [Mon, 10 May 2021 18:17:31 +0000 (11:17 -0700)]
C#/Java generated code version updates
Wouter van Oortmerssen [Mon, 10 May 2021 18:14:47 +0000 (11:14 -0700)]
Updated main version numbers to 2.0
mogemimi [Mon, 10 May 2021 17:52:10 +0000 (02:52 +0900)]
[Go] Add missing namespace when using Object API (#6633)
Vladimir Glavnyy [Mon, 10 May 2021 16:07:56 +0000 (23:07 +0700)]
Fix reverse iterators for Vector and Array (#6626)
This commit fixes two serious issues connected with reverse iterators:
1. Vector's rbegin/rend was incompatible with std::reverse_iterator::base();
2. Array's rend() was incorrect, it based on end() instead of begin().
罗泽轩 [Sat, 8 May 2021 05:57:13 +0000 (13:57 +0800)]
[Lua] manipulate byte array as string (#6624)
* [Lua] manipulate byte array as string
Sometimes it would be more effective than reading byte by byte
* change according to the review
* update
Piotr Dziwiński [Thu, 6 May 2021 21:42:44 +0000 (09:42 +1200)]
[C++] Fix union copy constructor to work with nested structs (#6552) (#6607)
mustiikhalil [Thu, 6 May 2021 04:55:03 +0000 (07:55 +0300)]
Updates swift generated monster sample file (#6616)
Updates swift generated monster sample file
Adds frozen attribute
罗泽轩 [Thu, 6 May 2021 02:39:42 +0000 (10:39 +0800)]
[Lua] Avoid infinite loop when creating empty string (#6614)
* [Lua] Avoid infinite loop when creating empty string
* [Lua] Check empty string output
Derek Bailey [Wed, 5 May 2021 23:36:49 +0000 (16:36 -0700)]
Added support for Lua 5.1, 5.2 and 5.4 (#6606)
This adds basic support for different Lua versions.
For Lua 5.2 and Lua 5.3, both the Bit32 and Compat53 Lua modules must be
installed for it to work. You can typically get these on Linux using
apt install lua-compat53 lua-bit32
For Lua 5.4, it should work as is, as it is a clean superset of Lua 5.3,
which is what the original Lua Flatbuffers supported.
Björn Harrtell [Mon, 3 May 2021 19:04:34 +0000 (21:04 +0200)]
[TS] Remove wrong and obsolete NS prefix use (#6604)
Derek Bailey [Mon, 3 May 2021 18:35:49 +0000 (11:35 -0700)]
Fixed LuaJIT when not compiled with COMPAT mode (#6605)
LuaJIT as installed by apt doesn't include the COMPAT mode for using
Lua5.2 features. So this change just makes the flatbuffer code use a
common implementation.
Kamil Rojewski [Mon, 3 May 2021 17:40:59 +0000 (19:40 +0200)]
removed unneeded type prefixing (#6601)
Casper [Sun, 2 May 2021 16:28:17 +0000 (12:28 -0400)]
Bump Rust to 0.9.0 (#6610)
Co-authored-by: Casper Neo <cneo@google.com>
罗泽轩 [Fri, 30 Apr 2021 17:38:16 +0000 (01:38 +0800)]
[Lua] Add LuaJIT support (#6584)
* [Lua] Add LuaJIT support
Here is the output of LuaTest.sh:
Run with LuaJIT:
built 100 512-byte flatbuffers in 0.16sec: 0.63/msec, 0.31MB/sec
built 1000 512-byte flatbuffers in 0.08sec: 12.06/msec, 5.89MB/sec
built 10000 512-byte flatbuffers in 0.80sec: 12.44/msec, 6.07MB/sec
built 10000 512-byte flatbuffers in 0.33sec: 30.58/msec, 14.93MB/sec
traversed 100 592-byte flatbuffers in 0.04sec: 2.51/msec, 1.42MB/sec
traversed 1000 592-byte flatbuffers in 0.03sec: 31.52/msec, 17.79MB/sec
traversed 10000 592-byte flatbuffers in 0.21sec: 48.77/msec, 27.53MB/sec
Run with Lua 5.3:
built 100 512-byte flatbuffers in 0.02sec: 5.44/msec, 2.66MB/sec
built 1000 512-byte flatbuffers in 0.17sec: 5.74/msec, 2.80MB/sec
built 10000 512-byte flatbuffers in 1.75sec: 5.72/msec, 2.79MB/sec
built 10000 512-byte flatbuffers in 1.38sec: 7.26/msec, 3.55MB/sec
traversed 100 592-byte flatbuffers in 0.00sec: 27.64/msec, 15.60MB/sec
traversed 1000 592-byte flatbuffers in 0.03sec: 30.46/msec, 17.20MB/sec
traversed 10000 592-byte flatbuffers in 0.34sec: 29.62/msec, 16.72MB/sec
* [Lua] Better usage description
* update according to the review
Casper [Thu, 29 Apr 2021 22:23:22 +0000 (18:23 -0400)]
Introduce new_from_vec in Rust (also fix formatting) (#6599)
* Introduce new_from_vec in Rust (also fix formatting)
Also, rename `new_with_capacity` to `with_capacity` to match
how `Vec` does it.
* bump rust version
* mut_finished_buffer
Co-authored-by: Casper Neo <cneo@google.com>
shiyuge [Thu, 29 Apr 2021 17:05:55 +0000 (01:05 +0800)]
fix typo in CppUsage.md (#6595)
Thanks!
Derek Bailey [Tue, 27 Apr 2021 20:02:13 +0000 (13:02 -0700)]
[Lua] GetRootAs can accept strings. Made Luatest Benchmarks optional (#6593)
Casper [Tue, 27 Apr 2021 14:10:59 +0000 (10:10 -0400)]
Add advance feature indicators to reflection (#6546)
* Add advance feature indicators to reflection
* deserialize too
* model advanced features as bitflags
* use uint64_t instead of AdvancedFeatures
* git clang format
* initialize advanced_features_
* remove whitespace
Co-authored-by: Casper Neo <cneo@google.com>
Casper [Mon, 26 Apr 2021 23:28:25 +0000 (19:28 -0400)]
Rust Remove SafeSliceAccess for Arrays, and fix miri. (#6592)
* Fix Miri flag passing and bump Rust version.
* Fix Miri problems from Arrays PR.
SafeSliceAccess was removed for Arrays. It's kind of unsound.
It has two properties:
1. EndianSafe
2. Alignment 1
We only need 1. in create_vector_direct to memcpy data.
We both 1. and 2. for accessing things with slices as buffers are built on &[u8]
which is unaligned. Conditional compilation implements
SafeSliceAccess for >1byte scalars (like f32) on LittleEndian machines
which is wrong since they don't satisfy 2.
This UB is still accessible for Vectors (though not exercised our
tests) as it implements SafeSliceAccess. I'll fix this later by
splitting SafeSliceAccess into its 2 properties.
Co-authored-by: Casper Neo <cneo@google.com>
Casper [Mon, 26 Apr 2021 13:18:58 +0000 (09:18 -0400)]
Mark endian_scalar as unsafe. (#6588)
* Mark endian_scalar as unsafe.
Also
- removed the deprecated flexbuffer slice from example
- fixed some cargo warnings
* Assertions and read_scalar made unsafe
* Clippy lints
* Add to Safety
Co-authored-by: Casper Neo <cneo@google.com>
mustiikhalil [Sat, 24 Apr 2021 11:47:24 +0000 (14:47 +0300)]
[swift] Implements union strings (#6589)
Alexander Zaitsev [Thu, 22 Apr 2021 19:36:23 +0000 (22:36 +0300)]
[Rust] Fix small mistyping (#6585)
Hi!
Just a veeeeeery small fix in the Rust sample. No functionality is affected.
That's not important at all but annoying for my eyes :)
罗泽轩 [Thu, 22 Apr 2021 18:15:18 +0000 (02:15 +0800)]
[TS] Commit the generated tests code (#6579)
* [TS] Ignore generated monster_test_grpc files
* [TS] Commit the generated tests code
罗泽轩 [Mon, 19 Apr 2021 21:30:55 +0000 (05:30 +0800)]
chore: ensure bash is used to generate code (#6577)
In some platforms, like Ubuntu, `sh` is linked to `dash` but not `bash`.
罗泽轩 [Mon, 19 Apr 2021 21:30:20 +0000 (05:30 +0800)]
[Lua] Fix EnforceNumberAndPack for bool type (#6576)
罗泽轩 [Mon, 19 Apr 2021 21:28:26 +0000 (05:28 +0800)]
[TS] Remove duplicated build-ts ci (#6575)
Now we already have a real build-ts ci job, let's remove the commented
one.
Ádám Lippai [Mon, 19 Apr 2021 20:43:11 +0000 (22:43 +0200)]
[Rust] Specify Minimum Supported Rust Version (#6573)
Related to #6572
Eddie Linder [Fri, 16 Apr 2021 15:15:59 +0000 (18:15 +0300)]
[Rust] Add support for fixed size arrays (#6548)
* Add support for fixed size arrays
* clang-format
* Update rust image to 1.51 to support const generics
* Handle correctly big endian
* Add fuzz tests and clean code
* Add struct fuzz test and optimize struct arrays for api
* Bump flatbuffers crate version
Paulo Pinheiro [Thu, 15 Apr 2021 18:29:51 +0000 (20:29 +0200)]
[Kotlin][FlexBuffers] Add support for Kotlin-iOS (#6564)
With this change, Flexbuffers for Kotlin now supports iOS(arm32, arm64, X64).
WatchOS and tvOS not supported.
Kamil Rojewski [Thu, 15 Apr 2021 15:19:13 +0000 (17:19 +0200)]
silenced clippy warning (#6565)
Paulo Pinheiro [Mon, 12 Apr 2021 20:47:40 +0000 (22:47 +0200)]
[Kotlin] Bump kotlinx.benchmark dependency to 0.3.0 (#6560)
Kotlinx.benchmark project just abandoned bintray and moving to maven central,
removing the artifacts from bintray and causing missing dependencies in our build.
So we are updating the dependency to point to the new version on maven central.
More information in:
https://github.com/Kotlin/kotlinx-benchmark/commit/
53ee45d0d914ceff111d3581ba3f5897fa897adc#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
Björn Harrtell [Mon, 12 Apr 2021 17:41:59 +0000 (19:41 +0200)]
[TS] Add Build TS to CI jobs (#6524)
* Add Build TS to CI jobs
* Add npm compile step
* Fix syntax
* Add required code gen for TS
* Exit on failure
* Make TS code gen identical to test run
* Remove duplicate TS code gen artifacts
* Remove bad gitignore
* Forgot parts of generate_code and make sure same settings for test run
* Don't forget about the bat
* Try and fix flatc args
* Another attempt to fix args
* Fix typo
* Commit up to date code gen
* Another attempt to fix sh/bat
* Move -o param to after -I
* Commit missing code gen file
* Fix grpc code gen and test
* Another grpc code gen fix
* Rework to not use ts folder
* Fix env vars in bat and make less churn
* Move TS code gen to dedicated folder
* Fix transpilation output folder and module paths
* Fixes to code gen
* Include generated js
* Moved ts code gen
* Remove test ts code gen folder
Paulo Pinheiro [Mon, 12 Apr 2021 17:30:15 +0000 (19:30 +0200)]
[Kotlin][FlexBuffers] Add support for Kotlin-JS (#6554)
Flexbuffers for Kotlin currently supports JVM and MacOS. This change
introduces support to JS as well.
Casper [Tue, 6 Apr 2021 11:23:45 +0000 (07:23 -0400)]
Default-empty vectors of enums (#6505)
* disable clippy
* Vector of enum default
* swift and tests
* git clang format
* Rewrite enum parser checks
* Remove Voids from more_defaults
* vector enum swift
* remove vector accessor from swift
* clang format
Co-authored-by: Casper Neo <cneo@google.com>
mustiikhalil [Mon, 5 Apr 2021 09:34:42 +0000 (12:34 +0300)]
[CI] fixes buildkite (#6544)
mustiikhalil [Thu, 1 Apr 2021 17:09:43 +0000 (20:09 +0300)]
Limit formatter to pull requests only (#6540)
Casper [Mon, 29 Mar 2021 23:56:45 +0000 (19:56 -0400)]
Rust structz (#6539)
* Rust structz
* struct of structs test
* swift tmp variables
Co-authored-by: Casper Neo <cneo@google.com>
Paulo Pinheiro [Mon, 29 Mar 2021 22:57:23 +0000 (00:57 +0200)]
[Kotlin][FlexBuffers] JSON support for Flexbuffers (#6417)
* [Kotlin][FlexBuffers] Add JSON support for FlexBuffers
* [Kotlin][Flexbuffers] Re-implement JSON parser with a tokenizer.
Jeong YunWon [Thu, 25 Mar 2021 19:12:35 +0000 (04:12 +0900)]
[grpc] Support latest version of grpc PoC (#6338)
* use grpcpp rather than deprecated grpc++
* grpcpp Deserialize take ByteBuffer instead of grpc_byte_buffer
* grpc 1.36.0
* Fix to use grpc 1.36.0
* Fix CMakeLists to refer gRPC
* add find_package(Threads)
* Update bazel deps
* Apply workaround about boringssl build error
* Install latest cmake for osx on travis-ci
Co-authored-by: Yeom Gyusun <omniavinco@gmail.com>
Kamil Rojewski [Thu, 25 Mar 2021 17:25:00 +0000 (18:25 +0100)]
fixed packing structs (#6530)
* fixed packing structs in nested buffers
* fixed packing structs
mustiikhalil [Thu, 18 Mar 2021 18:03:44 +0000 (21:03 +0300)]
[GO] Tries to add go format to the CI (#6518)
* Trys to add go format to the CI
Adds Gofmt to CI
* Adds formatting for go dir in grpc
* Small fix
Michael [Thu, 18 Mar 2021 18:01:50 +0000 (19:01 +0100)]
[C++] #6501 - Problem when mapping a native type multiple times (#6514)
* [C++] #6501 - Problem when mapping a native type multiple times
- idl.h:
added "native_type_pack_name"
- flatbuffers.h:
added CreateVectorOfNativeStructs variants which receive a pointer to the serialization function
- idl_gen_cpp.cpp:
adapted code generation in case "native_type_pack_name" attribute is present
- extended tests & docs; improved surrounding native_type docs a little
* integrated review feedback
Vladimir Glavnyy [Thu, 18 Mar 2021 17:56:28 +0000 (00:56 +0700)]
[fuzzer] Add `monster_debug` target (#6513)
Add the `monster_debug` target for better troubleshooting.
Improve oss-fuzz logs.
mustiikhalil [Wed, 17 Mar 2021 10:22:49 +0000 (13:22 +0300)]
[Swift] Removes allman rule (#6519)
Vladimir Glavnyy [Mon, 15 Mar 2021 18:44:42 +0000 (01:44 +0700)]
[flexbuffers, json] Parse `nan` and `inf` (#6512)
Kamil Rojewski [Thu, 11 Mar 2021 19:14:23 +0000 (20:14 +0100)]
fixed packing structs in nested buffers (#6509)
Vladimir Glavnyy [Thu, 11 Mar 2021 19:12:06 +0000 (02:12 +0700)]
[idl_parser] Add kTokenNumericConstant token (#6432)
* [idl_parser] Add kTokenNumericConstant token
This commit adds the new token for correct parsing of signed numeric constants.
Before this expressions `-nan` or `-inf` were treated as kTokenStringConstant.
This was ambiguous if a real string field parsed.
For example, `{ "text_field" : -name }` was accepted by the parser as valid JSON object.
Related oss-fuzz issue:
6200301176619008
* Add additional positive tests fo 'inf' and 'nan' as identifiers
* Rebase to HEAD
* Move processing of signed constants to ParseSingleValue method.
* Add missed `--cpp-static-reflection` (#6324) to pass CI
* Remove `flatbuffers.pc` from repository to unblock CI (#6455).
Probably the generated flatbuffers.pc should not be a part of repo.
* Fix FieldIdentifierTest()
Vladimir Glavnyy [Thu, 11 Mar 2021 19:11:04 +0000 (02:11 +0700)]
Remove `flatbuffers.pc` from the repository (#6508)
mustiikhalil [Tue, 9 Mar 2021 07:56:06 +0000 (10:56 +0300)]
Bump grpc to 1.0.0 (#6507)
Adds void to keywords
dpacbach [Mon, 8 Mar 2021 18:59:17 +0000 (13:59 -0500)]
Move Traits struct and Create method out of --cpp-static-reflection. (#6503)
Ben Niu [Mon, 8 Mar 2021 18:53:04 +0000 (10:53 -0800)]
Disable x64-specific optimizations for ARM64EC ReadInt64 (#6506)
ARM64EC is a new ARM64 ABI designed by Microsoft to support x64 application emulation on ARM64 CPUs. When compiling for ARM64EC, both the _M_X64 and _M_ARM64EC macros are defined. However, that causes problem in compiling this file, because the __movsb intrinsic, which is lowered to rep movsb, is not supported on ARM64, so the optimization for native x64 should be disabled for ARM64EC.
dpacbach [Sat, 6 Mar 2021 15:28:27 +0000 (10:28 -0500)]
Add --cpp-static-reflection to generate_code.bat. (#6502)
David P. Sicilia [Fri, 5 Mar 2021 18:01:40 +0000 (13:01 -0500)]
[C++17] Add compile-time reflection for fields. (#6324)
* [C++17] Add compile-time reflection for fields.
Included in this commit is the following:
- The C++ generator has been modified so that,
when in C++17 mode, it will emit Table and
Struct field traits that can be used at com-
pile time as a form of static reflection. This
includes field types, field names, and a tuple
of field getter results.
- Diffs to the cpp17 generated files. No other
generated files are affected.
- A unit test that also serves as an example. It
demonstrates how to use the full power of this
reflection to implement a full recursive
JSON-like stringifier for Flatbuffers types,
but without needing any runtime access to the
*.fbs definition files; the computation is
done using only static reflection.
Tested on Linux with gcc 10.2.0.
Fixes #6285.
* Fix int-conversion warning on MSVC.
* Try to fix std::to_string ambiguity on MSVC.
* Fix clang-format diffs.
* Fix more clang-format diffs.
* Fix last clang-format diff.
* Enable C++17 build/test for VC 19 platform in CI.
* Forgot to add value to cmake command line variable.
* Various fixes/changes in response to @vglavnyy's feedback.
* Replace "fields pack" with index-based getters.
* Fix MSVC error.
* Fix clang-format diffs.
* getter_for method returns result instead of address-of-getter.
* Next round of reviewer suggestions.
* Use type instead of hardcoded struct name.
* Fix clang-format diff.
* Add test for FieldType since it is not used in the stringify test.
* Add fields_number field to Traits struct.
* Add --cpp-static-reflection flag and put those features behind it.
* Fix clang-format diffs.
* Remove <tuple> include.
Kamil Rojewski [Thu, 4 Mar 2021 20:12:44 +0000 (21:12 +0100)]
fixed invalid TS call and added test files (#6495)
e581013e3d42af13d2fe37b0ac46a3fd43f3638c broke TS generation - please don't use "replace" to refactor function names :)
Casper [Mon, 1 Mar 2021 21:51:22 +0000 (16:51 -0500)]
disable clippy (#6494)
Co-authored-by: Casper Neo <cneo@google.com>
Vladimir Glavnyy [Mon, 1 Mar 2021 21:40:58 +0000 (04:40 +0700)]
[idl_parser, JSON] Disable parsing of JSON for incomplete schemes (#6493)
This commit disable JSON parsing for an incomplete scheme if JSON object is embedded into one file with the scheme.
This should improve the quality of OSS-Fuzz inputs for the parser_fuzzer target.
Mark Spatz [Mon, 1 Mar 2021 20:34:01 +0000 (14:34 -0600)]
[idl_parser] Track included files by hash (#6434)
* [idl_gen] Delete ts::GenPrefixedImport()
I don't know what this is for, but it's the only piece of code external
to idl_parser.cpp that expects the key of Parser::included_files_ to be
a path. And it appears to be unused.
* [idl_parser] Track included files by hash
Parser::included_files_ is a map whose main purpose is to keep track of
which files have already been parsed in order to protect against
multiple inclusion. Its key is the path that the file was found at
during parsing (or, if it's an in-memory file, just its name).
This commit changes the key to be the 64 bit FNV-1a hash of the file's
name (just the name, not the complete path) xor'd with the hash of the
file's contents (unless it's an in-memory file, then we only hash the
name.)
This allows multiple include protection to function even in the face of
unique per-file include paths (fixes #6425).
* Ran tests/generate_code.sh
CI told me to do it.
* Gracefullt handle case where source_filename == nullptr
I just learned source_filename might also be null. In that case, we
should exclude it from the hash instead of hashing a zero length
string, just like we exclude source when it is null.
Presumably nameless files will never be included (they can't, can they?)
so this doesn't really matter, but I think it's prettier anyways.
Kamil Rojewski [Thu, 25 Feb 2021 22:57:10 +0000 (23:57 +0100)]
fix for noUncheckedIndexedAccess in ts (#6474)
mustiikhalil [Thu, 25 Feb 2021 22:38:12 +0000 (01:38 +0300)]
Working on a python example plus fixing python grpc code (#6456)
Refactored python grpc code gen
Adds example server & client + fixes ci
Fixes generated code
Making sure we encode the reply string as utf8
Adds Readme details to clarify issue regarding encoding when python is sending/receiving
Colin [Wed, 24 Feb 2021 18:00:18 +0000 (13:00 -0500)]
[rust] Remove debug code (#6475)
* Remove debug code
This was added for testing in the recent genericize PR for flexbuffer Reader.
* Added alloc tests -> MapReader::{is_empty, index_key, len}
* Added , accessible through Deref to deprecation warning
Derek Bailey [Tue, 23 Feb 2021 19:30:07 +0000 (11:30 -0800)]
Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" (#6488)
This reverts commit
cbbbaa61b34c31f17773c2fef354c31664e9562e.
Björn Harrtell [Tue, 23 Feb 2021 17:34:20 +0000 (18:34 +0100)]
[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)
* WIP: Fix returned truncated ArraySegment<byte> if elementSize is not byte
* Fix
* Regenerated test code
mustiikhalil [Tue, 23 Feb 2021 05:51:39 +0000 (08:51 +0300)]
[CI] Adds Code Generation tests on Github Actions (#6482)
Moves check-grpc-generation to scripts
Millian Poquet [Mon, 22 Feb 2021 18:23:38 +0000 (19:23 +0100)]
[CMake] generate pkg-config flatbuffers.pc file (#6455)
This commit enables CMake to generate a flatbuffers.pc file on install.
pkg-config eases the utilization of software libraries by enabling the
developers of a library to define how the library should be used.
It can be used as a tool by build systems to find and manage dependencies,
this is notably the default Meson behavior and optionally used by CMake.
mustiikhalil [Sat, 20 Feb 2021 20:07:48 +0000 (23:07 +0300)]
[Swift] Moves grpc example to grpc/examples (#6479)
Updates generated Code
Removes grpc generation code from tests dir
Small fix to generate.sh
mustiikhalil [Sat, 20 Feb 2021 17:31:00 +0000 (20:31 +0300)]
[TS] Moves grpc code to examples folder (#6476)
Adds readme
mustiikhalil [Fri, 19 Feb 2021 20:16:38 +0000 (23:16 +0300)]
Fixes grammer (#6477)
Updates docs
Richard A Hofer [Fri, 19 Feb 2021 20:13:50 +0000 (15:13 -0500)]
Fix sample_binary.py to use latest EndVector without a size. (#6478)
Kamil Rojewski [Fri, 19 Feb 2021 20:05:02 +0000 (21:05 +0100)]
updated JS docs to reflect current status (#6436)
mustiikhalil [Fri, 19 Feb 2021 09:47:59 +0000 (12:47 +0300)]
[Go] Working on a go example plus fixing go grpc code (#6448)
Implemented server.go and half implemented client.go
Finishes implementation for greeter go example
Update grpc code for monster.fbs
Adds a couple of cpp methods
Adhere to gofmt standards
Adds a readme for issues with grpc
mustiikhalil [Fri, 19 Feb 2021 09:47:28 +0000 (12:47 +0300)]
[Swift] adds support for default vectors and strings (#6461)
Small fix
Adhere to the new protocol names
Arnaud LE CAM [Fri, 19 Feb 2021 03:51:41 +0000 (04:51 +0100)]
Update Building.md (#6473)
`cmake . -D FLATBUFFERS_CXX_FLAGS="Wno-error"` returns an error (file 'Wno-error' not found)
Thanabodee Charoenpiriyakij [Fri, 19 Feb 2021 02:38:25 +0000 (09:38 +0700)]
GetUOffsetT must get value by GetUint32 not GetInt32 (#6072)
Liu Liu [Wed, 17 Feb 2021 06:34:39 +0000 (22:34 -0800)]
Fix a typo in Swift codegen (#6470)
* Fix a typo in Swift codegen
* Fix code formatting.
Colin [Tue, 16 Feb 2021 13:04:48 +0000 (08:04 -0500)]
[rust] Genericize flexbuffer reader (#6450)
* feature/rust-tokio-bytes added feature name for tokio-bytes
* Added flexbuffer implementation, TODO: typecast to avoid recurse
* Converted codebase to utilize FlexBuffer implementation, need to resolve deserialization issues
* Added todo for lifetime issue, may use &'de [u8] for deserializer instead of current method
* Added proper &[u8] implementation
* Removed unused struct
* Added experimental fix to get_slice
* Added experimental fix to get_slice
* Avoided lifetime issues via ref structs, need to check if this hurts peformance
* Updated deserializer implementation to allow for borrowed data from Reader struct
* Fixed bug with str
* Removed unnecessary generic parameter
* Added unsafe to avoid lifetime complaints, current tests pass, need to review alternatives to unsafe
* Opinionated: Removed bytes crate as this implementation could be done in a separate crate
* Cleaned up flatbuffer
* Fixed sample / example
* Resolved PR feedback, need to resolve issues with tests
* Cleaned up FlexBuffer trait to be an auto impl
* Removed TODO
* Reverted Deserializer to only support &'de [u8]
* Cleaned up / renamed function for clarification
* Renamed FlexBuffer -> InternalBuffer for clarification on it's purpose
* Fixed issue with key bytes
* resolved issues with broken tests, confirming this is a breaking change
* Removed FIXME that's solved by splitting String and Key variants
* Implemented associated types approach
* Fixed backward slice logic
* Fixed MapReader compile error
* Added from_buffer for deserialization, removed function since it's only needed for deserialization
* Removed dead code
* Cleaned up buffer, removed AsRef in favor of Deref
* Renamed Buffer::as_str -> Buffer::buffer_str
* Minor cleanup
* Updated documentation, need to fix tests
* Removed unnecessary &
* Removed unused lifetime
* removed unnecessary as_ref
* Minor optimization wrap-up
* resolved issue with Clone
* Added test to verify no deep-copy
* Added for optimization
* Updated to use empty fn instead of default
* Updated comments / test name - plus the 0.3.0 version bump
* comment
mustiikhalil [Tue, 16 Feb 2021 11:55:47 +0000 (14:55 +0300)]
[Swift] Renaming protocols (#6469)
* Renaming protocols
* Updates Generated code
* format code
mustiikhalil [Sun, 14 Feb 2021 07:09:11 +0000 (10:09 +0300)]
Update swift docs (#6460)
Casper [Fri, 12 Feb 2021 14:41:10 +0000 (09:41 -0500)]
Default strings and vectors: Parser + Rust support (#6421)
* Fix tests.cpp
* Parser support for vector/string defaults
* tests and default empty vectors
* addressed comments
* Default strings and vectors for Rust
* Tested Rust more_defaults
* git-clang-format
* add more_defaults_test
* fixed vector default
* removed commented out code
* more unreachable
Co-authored-by: Casper Neo <cneo@google.com>
mustiikhalil [Thu, 11 Feb 2021 18:16:57 +0000 (21:16 +0300)]
[CMake] Renames BUILD files (#6457)
* Renamed build to build.bazel to stop xcode from complaining about it
* Renamed all build to build.bazel
* Fixes small ci issue
Vladimir Glavnyy [Wed, 10 Feb 2021 19:49:34 +0000 (02:49 +0700)]
[Build, cmake] Add -Werror override option (#6429)
* [Build, cmake] Add -Werror override option
This commit adds FLATBUFFERS_CXX_FLAGS cmake option.
This option allows override the -Werror flag (or any other flags).
Related issues: #6337, #5930
* Remove CMAKE_CXX_FLAGS replace option
blueshift155 [Wed, 10 Feb 2021 19:48:24 +0000 (01:18 +0530)]
[C++]Fix extra char generation for byte type during json schema generation (#6276)
* Fix extra char generation for the byte type
* Fix unit tests for JSON
mustiikhalil [Wed, 10 Feb 2021 19:46:45 +0000 (22:46 +0300)]
Updating working code (#6441)
Fixes issues with namespaces in grpc ts
Renamed welcome -> models
tira-misu [Wed, 10 Feb 2021 19:45:34 +0000 (20:45 +0100)]
JSON schema - tailing double quotes for maximum (#6452)
* Fix C/C++ Create<Type>Direct with sorted vectors
If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".
* Changes due to code review
* Improve code readability
* Add generate of JSON schema to string to lib
* option indent_step is supported
* Remove unused variables
* Fix break in test
* Fix style to be consistent with rest of the code
* Fix double quotes for (u)int8 in json schema
* Fix reference file for JSON schema test
* Fix reference file for JSON schema test
Vladimir Glavnyy [Wed, 10 Feb 2021 19:37:16 +0000 (02:37 +0700)]
[idl_parser] Validate `force_align` on all possible paths (#6430)
* [idl_parser] Validate `force_align` on all possible paths
- added validation of `force_align` for `Vector`.
- added assertion to `flatbuffers::PreAlign` method
These changes should resolve following oss-fuzz issues:
-
6275816289861632
-
5713529908887552
-
4761242994606080
* size_t problem on Mac
* Fix review notes
Casper [Sun, 7 Feb 2021 21:51:33 +0000 (16:51 -0500)]
Implement Rust object API defaults (#6444)
* Implment Rust object API defaults
* satisfy return analysis
* git clang format
Co-authored-by: Casper Neo <cneo@google.com>