platform/upstream/flatbuffers.git
16 months ago[spec] Update the Requires section 86/292486/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.094839 accepted/tizen/unified/20230601.163012 tizen_8.0_m2_release
Sangjung Woo [Tue, 9 May 2023 02:47:23 +0000 (11:47 +0900)]
[spec] Update the Requires section

This patch fixes the wrong Requires section of the flatbuffers-python package.

Change-Id: Ie01232ca99b0e943421d951ff8fd4fbc727ce016
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
21 months ago[Version] Bump up to v2.0.6 sandbox/anyj0527/v2.0.6 accepted/tizen/unified/20221226.065959
Yongjoo Ahn [Fri, 2 Dec 2022 07:38:56 +0000 (16:38 +0900)]
[Version] Bump up to v2.0.6

- Upgrade the version to v2.0.6

Change-Id: Ifc586ca06fbbe4c203d7d3346c3c8a27352cf209
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
21 months ago[Python] Add flatbuffers python packaging
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>
21 months agoBump to flatbuffers 2.0.0
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>
21 months ago[Dist/Debian] Include .pc file in the dev-kit package
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>
21 months ago[Dist/Tizen] Revise the rpm spec file to include .pc in the dev package
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>
21 months ago[PkgConfig] Add a template for .pc file generation
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>
21 months ago[Dist/Debian] Fix unmet dependency on libgcc-s1 in the PPA package
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>
21 months agoBump to flatbuffers 1.12.0
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>
21 months agoAdd -fno-lto for creating static library
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>
21 months ago[Dist/Debian] Initial debianization for v1.11.0
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>
21 months agoRe-ported build-error workaround from 1.6.0
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>
21 months ago[Dist/Tizen] Add rpm spec and manifest files to support GBS
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>
2 years agoChange Rust generated file defaults (#7101)
Casper [Tue, 15 Feb 2022 16:48:42 +0000 (11:48 -0500)]
Change Rust generated file defaults (#7101)

* Change Rust generated file defaults

After #6731, flatc changed its default behavior
for generating rust code to fix some importing issues.
This was a breaking change which invlidated the patch release,
`flatc 2.0.5` (#7081). This PR reverses the default so we can
release a patch update. However, does break Rust users who work at
HEAD.

* Bump flatc patch version (2.0.6)

Co-authored-by: Casper Neo <cneo@google.com>
2 years agoFixed FlexBuffers verifier fuzzer timing out
Wouter van Oortmerssen [Mon, 14 Feb 2022 20:01:52 +0000 (12:01 -0800)]
Fixed FlexBuffers verifier fuzzer timing out

Change-Id: I3a408da08676e522069adf83730d6bcc2b5493b3

2 years agoFixed Parser not checking size of union types vector
Wouter van Oortmerssen [Mon, 14 Feb 2022 19:48:46 +0000 (11:48 -0800)]
Fixed Parser not checking size of union types vector

Change-Id: Ibcfc49a9c9376372bd15da2ed3a7f7a298863ccc

2 years agoFixed FlexBuffers ToString unquoted non-ident keys
Wouter van Oortmerssen [Mon, 14 Feb 2022 19:28:31 +0000 (11:28 -0800)]
Fixed FlexBuffers ToString unquoted non-ident keys

Change-Id: I0a17ee292c9eebbb1e9b2530c07d37d63b4dda24

2 years agoRemove @ExperimentalUnsignedTypes annotation from kotlin code generator. (#7092)
Aaron Riekenberg [Mon, 14 Feb 2022 04:29:36 +0000 (22:29 -0600)]
Remove @ExperimentalUnsignedTypes annotation from kotlin code generator. (#7092)

2 years agoSwift FlatBufferBuilder.sizedByteArray to ByteBuffer.toArray() (#7093)
Matt Grippaldi [Fri, 11 Feb 2022 21:26:16 +0000 (16:26 -0500)]
Swift FlatBufferBuilder.sizedByteArray to ByteBuffer.toArray() (#7093)

* Moved code from FlatBufferBuilder.sizedByteArray to ByteBuffer.toArray() in Swift

* ByteBuffer.toArray() to  ByteBuffer.underlyingBytes

2 years ago[TS] Refactor away circular ref (#7099)
Björn Harrtell [Fri, 11 Feb 2022 17:40:09 +0000 (18:40 +0100)]
[TS] Refactor away circular ref (#7099)

2 years agoAdd reflection support for python (#7026)
qazwsxedcrfvtg14 [Thu, 10 Feb 2022 19:10:47 +0000 (03:10 +0800)]
Add reflection support for python (#7026)

We already have the reflection.fbs file and the flatbuffers
python language support.

Adding this feature would give the python developers the
ability to parse the flatbuffers schema and write some tools.

Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years agoAdd CreateVector overload to accept array like (#7095)
Derek Bailey [Thu, 10 Feb 2022 06:16:46 +0000 (22:16 -0800)]
Add CreateVector overload to accept array like (#7095)

2 years agoexplicitly defined std::allocator (#7094)
Derek Bailey [Wed, 9 Feb 2022 23:09:52 +0000 (15:09 -0800)]
explicitly defined std::allocator (#7094)

2 years ago[JS] Add ".js" suffix to all import statements to generate a browser compatible mjs...
Timo Sturm [Tue, 8 Feb 2022 20:21:20 +0000 (21:21 +0100)]
[JS] Add ".js" suffix to all import statements to generate a browser compatible mjs version. (#7086)

2 years agoAdd Parsing Completed function for Rust (#7084)
Derek Bailey [Tue, 8 Feb 2022 15:40:55 +0000 (07:40 -0800)]
Add Parsing Completed function for Rust (#7084)

2 years agorust: Bump thiserror version and remove git dependency (#7080)
Marcin Witkowski [Fri, 4 Feb 2022 21:02:02 +0000 (22:02 +0100)]
rust: Bump thiserror version and remove git dependency (#7080)

2 years agoreplace framework include of flatbuffers (#7079)
Derek Bailey [Fri, 4 Feb 2022 01:40:15 +0000 (17:40 -0800)]
replace framework include of flatbuffers (#7079)

2 years agofix go_test implement error (#7012)
godcong [Thu, 3 Feb 2022 16:43:28 +0000 (00:43 +0800)]
fix go_test implement error (#7012)

* fix(grpc): fix go_test implement error

* fix(grpc): fix go_test implement error

2 years agofixed comparator for native_inline (#7076)
Derek Bailey [Thu, 3 Feb 2022 07:44:43 +0000 (23:44 -0800)]
fixed comparator for native_inline (#7076)

* fixed comparator for native_inline

* added native_inline data

* updated more tests for the new field

* more fixes

2 years agoskip generating reflection.fbs in generate_scripts (#7077)
Derek Bailey [Thu, 3 Feb 2022 06:42:26 +0000 (22:42 -0800)]
skip generating reflection.fbs in generate_scripts (#7077)

2 years agoupdate C++ generator to emit scoped enums in vector of unions (#7075)
Derek Bailey [Thu, 3 Feb 2022 06:29:21 +0000 (22:29 -0800)]
update C++ generator to emit scoped enums in vector of unions (#7075)

2 years agoreplaced removed xml tag
Derek Bailey [Wed, 2 Feb 2022 23:15:43 +0000 (15:15 -0800)]
replaced removed xml tag

2 years agoremoved BSD-3-Clause license and Zlib licenses (#7073)
Derek Bailey [Wed, 2 Feb 2022 21:12:01 +0000 (13:12 -0800)]
removed BSD-3-Clause license and Zlib licenses (#7073)

2 years agoFixed default value of bool in struct for Swift (#7072)
nicked [Wed, 2 Feb 2022 20:39:19 +0000 (21:39 +0100)]
Fixed default value of bool in struct for Swift (#7072)

2 years agoone last dart omit local (#7070)
Derek Bailey [Wed, 2 Feb 2022 06:25:52 +0000 (22:25 -0800)]
one last dart omit local (#7070)

2 years agomore omit type annotations for dart local variables (#7069)
Derek Bailey [Wed, 2 Feb 2022 05:48:36 +0000 (21:48 -0800)]
more omit type annotations for dart local variables (#7069)

2 years agoomit type annotations for dart local variables (#7067)
Derek Bailey [Wed, 2 Feb 2022 05:24:04 +0000 (21:24 -0800)]
omit type annotations for dart local variables (#7067)

* omit type annotations for dart local variables

* fixed some errors

2 years agoadd xmlns to .Net (#7066)
Derek Bailey [Wed, 2 Feb 2022 04:57:13 +0000 (20:57 -0800)]
add xmlns to .Net (#7066)

2 years agoUpdates swift gen licence for grpc code (#7063)
mustiikhalil [Tue, 1 Feb 2022 22:23:38 +0000 (01:23 +0300)]
Updates swift gen licence for grpc code (#7063)

2 years agoFixed long cast to int in flexbufferbuilder.java (#7059)
Derek Bailey [Tue, 1 Feb 2022 20:58:10 +0000 (12:58 -0800)]
Fixed long cast to int in flexbufferbuilder.java (#7059)

2 years agoclang format on codebase (#7058)
Derek Bailey [Tue, 1 Feb 2022 19:23:18 +0000 (11:23 -0800)]
clang format on codebase (#7058)

2 years agoattempt to remove appveyor (#7056)
Derek Bailey [Tue, 1 Feb 2022 05:52:15 +0000 (21:52 -0800)]
attempt to remove appveyor (#7056)

2 years agoProvide a short help text and default in error case (#6992)
Derek Bailey [Tue, 1 Feb 2022 05:24:48 +0000 (21:24 -0800)]
Provide a short help text and default in error case (#6992)

* Provide a short help text and default in error case

* clean up short options a bit

2 years agoUse FindPython3 (#7055)
Derek Bailey [Tue, 1 Feb 2022 04:47:12 +0000 (20:47 -0800)]
Use FindPython3 (#7055)

2 years agoremove BIICODE
Derek Bailey [Tue, 1 Feb 2022 03:01:55 +0000 (19:01 -0800)]
remove BIICODE

2 years agoUpdate readme.md
Derek Bailey [Tue, 1 Feb 2022 01:00:24 +0000 (17:00 -0800)]
Update readme.md

Remove travis badge
Added Github action badge
Add dbaileychess twitter

2 years agoFixes a bug where bools arent being nil when marked optional (#7051)
mustiikhalil [Mon, 31 Jan 2022 15:12:57 +0000 (18:12 +0300)]
Fixes a bug where bools arent being nil when marked optional (#7051)

2 years agoImplement Serialize on generated rust types (#7022)
Max Burke [Mon, 31 Jan 2022 00:29:18 +0000 (16:29 -0800)]
Implement Serialize on generated rust types (#7022)

* fix for rust build

* Rust: Implement Serialize on generated types

For debugging convenience it is really handy to be able to dump out
types as another format (ie: json). For example, if we are logging a
type to a structured logging system, or even printing it out in a
structured way to the console.

Right now we handle this by shelling out to `flatc` which is not ideal;
by implementing Serialize on the generated types we can use any of the
Serializer-implementing packages for our structured debug output.

* clang-format

* Make the flatbuffers Rust crate only have an optional dependency on the `serde` packages.

* fix warning

* fix rust test build

* Oh yeah this needs to be initialized

* fix toml syntax

* code review feedback

* rebuild test data

2 years agoCmake 3.16 de-facto minimum version (#7049)
Derek Bailey [Sun, 30 Jan 2022 20:56:16 +0000 (12:56 -0800)]
Cmake 3.16 de-facto minimum version (#7049)

2 years agoConvert flatbuffers_version_string to inline function (#7046)
Derek Bailey [Sun, 30 Jan 2022 03:42:56 +0000 (19:42 -0800)]
Convert flatbuffers_version_string to inline function (#7046)

* Skip conditional for python executable

* replaced flatbuffers_version_string with inline function

* use const char* instead of string

2 years ago[C++] Support C++ object copies and moves (#5988)
Jean-François Roy [Sat, 29 Jan 2022 22:24:24 +0000 (14:24 -0800)]
[C++] Support C++ object copies and moves (#5988)

Augment the C++ generator to emit a C++ copy constructor and a by-value
copy assignment operator. This is enabled by default when the C++
standard is C++11 or later. These additional functions are only emitted
for objects that need it, typically tables containing other tables.

These new functions are declared in the object table type and are
defined as inline functions after table declarations.

When these new functions are declared, a user-defined
explicitly-defaulted default constructor and move constructor are also
emitted.

The copy assignment operator uses the copy-and-swap idiom to provide
strong exception safety, at the expense of keeping 2 full table copies
in memory temporarily.

fixes #5783

2 years ago[ts] Builder incorrectly serializing empty strings (#7047)
Max Burke [Sat, 29 Jan 2022 22:23:57 +0000 (14:23 -0800)]
[ts] Builder incorrectly serializing empty strings (#7047)

* [ts] Builder incorrectly serializing empty strings

The builder was returning an offset of zero for empty strings. This is
leading to flatbuffers which fail verification in other languages, such
as Rust.

* tests expect 0 offset for null or undefined strings

2 years agoInclude a SizePrefixed..HasIdentifier for c++. (#6871)
Justin T Conroy [Sat, 29 Jan 2022 04:52:32 +0000 (22:52 -0600)]
Include a SizePrefixed..HasIdentifier for c++. (#6871)

* Include a SizePrefixed..HasIdentifier for c++.

* Add updated generated code.

2 years agoUse `${PYTHON_EXECUTABLE}` instead of `py` in cmake (#7042)
Derek Bailey [Fri, 28 Jan 2022 23:00:57 +0000 (15:00 -0800)]
Use `${PYTHON_EXECUTABLE}` instead of `py` in cmake (#7042)

* Emit include for bfbs-gen-embed

* Use python3 explicitly

* bump min python version to 3.6

* Sort find_package for python

* try casting Path to string

* cast WindowsPath to string to please CI

* stringify the wrong thing

* another stringify path

2 years ago'flattest': Add --test_path option (#7041)
Derek Bailey [Thu, 27 Jan 2022 22:21:01 +0000 (14:21 -0800)]
'flattest': Add --test_path option (#7041)

2 years agoAdded support for clang-cl on windows (CMake) (#7038)
MS [Thu, 27 Jan 2022 18:48:01 +0000 (10:48 -0800)]
Added support for clang-cl on windows (CMake) (#7038)

* Moved the CMake check for Clang *after* the one for MSVC, as clang-cl
  matches both Clang and MSVC.
* Removed /MP definition - controlled by CMake
* Added CPP define for _CRT_SECURE_NO_WARNINGS so clang can see it
  (it seems it doesnt pick up the pragma in util.cpp)

2 years agoFix/cmake build grpc (#7028)
LouisP [Wed, 26 Jan 2022 04:57:31 +0000 (05:57 +0100)]
Fix/cmake build grpc (#7028)

* BuildFlatbuffers.cmake: add verbose on build

* BuildFlatbuffers.cmake: properly add *.fb.* files with --grpc argument

When "--grpc" argument is provided as an extra flag, resulting grpc files
should be added as part of the interface library.
This prevent adding .fb.cc files manually to the build.

V2: fix dependency on grpc files

2 years agoAdd FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare (#7023)
BogDan Vatra [Wed, 26 Jan 2022 04:51:00 +0000 (06:51 +0200)]
Add FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare (#7023)

2 years agoFix comment with line orders - Rust should be last. (#7037)
Jon Simantov [Wed, 26 Jan 2022 00:43:08 +0000 (19:43 -0500)]
Fix comment with line orders - Rust should be last. (#7037)

Fix for #6867.

2 years agoUse actions/checkout@v2, which fixes security vulnerability. (#7036)
Jon Simantov [Wed, 26 Jan 2022 00:19:05 +0000 (19:19 -0500)]
Use actions/checkout@v2, which fixes security vulnerability. (#7036)

Fix for issue #6999.

2 years agoAdd --warnings-as-errors to flatc compiler. (#7034)
Jon Simantov [Tue, 25 Jan 2022 22:01:16 +0000 (17:01 -0500)]
Add --warnings-as-errors to flatc compiler. (#7034)

* Add --warnings-as-errors to flatc compiler.

With this option set, flatc will return an error on parsing if
any warnings occurred.

* Add unit test for opts.warnings_as_errors.

* Change explicit option setting to default.

2 years agoEmit include for bfbs-gen-embed (#7031)
Derek Bailey [Tue, 25 Jan 2022 18:43:16 +0000 (10:43 -0800)]
Emit include for bfbs-gen-embed (#7031)

2 years agoUpgraded GRPC version to 1.42.0 (#7033)
Derek Bailey [Tue, 25 Jan 2022 17:59:29 +0000 (09:59 -0800)]
Upgraded GRPC version to 1.42.0 (#7033)

2 years agochore: dart 2.0.5 release changes (#6983)
Ivan Dlugos [Thu, 20 Jan 2022 21:30:03 +0000 (22:30 +0100)]
chore: dart 2.0.5 release changes (#6983)

2 years agorust: Allow for usage in no_std environment (#6989)
Marcin Witkowski [Thu, 20 Jan 2022 16:49:02 +0000 (17:49 +0100)]
rust: Allow for usage in no_std environment (#6989)

2 years agoMake flatbuffer builder deterministic (#6993)
Danila Kutenin [Fri, 14 Jan 2022 23:37:27 +0000 (23:37 +0000)]
Make flatbuffer builder deterministic (#6993)

2 years agoAdded verifier alignment checking to table fields (#7018)
Wouter van Oortmerssen [Fri, 14 Jan 2022 22:39:15 +0000 (14:39 -0800)]
Added verifier alignment checking to table fields (#7018)

2 years agoBuildFlatBuffers.cmake: fix arguments not passed properly to flatc (#7013)
LouisP [Fri, 14 Jan 2022 22:38:04 +0000 (23:38 +0100)]
BuildFlatBuffers.cmake: fix arguments not passed properly to flatc (#7013)

Fix regression introduced by commit e9d45324012ed04af97cbe99bab0e6afe475e95d

2 years agoAdd initial C# vector of unions support to the documentation. (#6880)
Richard A Hofer [Fri, 14 Jan 2022 06:15:35 +0000 (01:15 -0500)]
Add initial C# vector of unions support to the documentation. (#6880)

* Add initial C# vector of unions support to the documentation.

* Add notes about missing documentation for vector of unions.

2 years ago[TS/JS] BigInt implementation (#6998)
Alex E [Fri, 7 Jan 2022 02:35:37 +0000 (21:35 -0500)]
[TS/JS] BigInt implementation (#6998)

* BigInt implementation

* Unit test reading long from existing bytebuffer

* Code review

2 years agoAvoid implicit conversion from float to double. (#7003)
Advait Jain [Fri, 24 Dec 2021 02:31:30 +0000 (18:31 -0800)]
Avoid implicit conversion from float to double. (#7003)

https://github.com/tensorflow/tflite-micro makes use of flatbuffers with
a variety of DSP toolchains.

Without the change from this PR, we can get a double-promotion warning
with some of these DSP toolchains:
```
flatbuffers/include/flatbuffers/util.h:104:11: error: implicit conversion increases floating-point precision: 'std::numeric_limits<float>::_Ty' (aka 'float') to 'double' [-Werror,-Wdouble-promotion]
  T eps = std::numeric_limits<float>::epsilon();
    ~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

2 years agoRearrange #include directives to pass to compilation with a particular DSP toolchain...
Shlomi Regev [Wed, 22 Dec 2021 16:40:38 +0000 (08:40 -0800)]
Rearrange #include directives to pass to compilation with a particular DSP toolchain (#7000)

iomanip isn't available for our DSP. Luckily, we compile with FLATBUFFERS_PREFER_PRINTF, so moved the #include directive there.
ctype.h has to be included explicilty for tolower() and toupper().

2 years agoReverting grpc generated file suffix (#6995)
Panagiotis Gourgaris [Sun, 19 Dec 2021 02:23:28 +0000 (04:23 +0200)]
Reverting grpc generated file suffix (#6995)

* Reverting grpc generated file suffix

* - Setting the greeter sample as it was
- Reverting the include of the generated message in grpc.cc file

2 years agoDisable parsing of nested_flatbuffers as bytes by default
Wouter van Oortmerssen [Wed, 15 Dec 2021 18:41:29 +0000 (10:41 -0800)]
Disable parsing of nested_flatbuffers as bytes by default

Parsing as bytes produces buffers that are unsafe to access unless passed thru a verifier,
whereas users could reasonably assume that any JSON parsed without errors is safe to access.
Users that still have legacy JSON files with such bytes in it will get a helpful error point them
to the option to turn on to have it work again.

2 years agoEnable OSS-Fuzz on CI
Wouter van Oortmerssen [Tue, 14 Dec 2021 20:10:43 +0000 (12:10 -0800)]
Enable OSS-Fuzz on CI

2 years agoUpdated FlexBuffers fuzzer
Wouter van Oortmerssen [Tue, 14 Dec 2021 19:57:42 +0000 (11:57 -0800)]
Updated FlexBuffers fuzzer

2 years agoAdded alignment checking to FlexBuffers verifier
Wouter van Oortmerssen [Tue, 14 Dec 2021 19:20:15 +0000 (11:20 -0800)]
Added alignment checking to FlexBuffers verifier

2 years agoFlexBuffers verifier additionally checks for nesting
Wouter van Oortmerssen [Tue, 14 Dec 2021 19:01:23 +0000 (11:01 -0800)]
FlexBuffers verifier additionally checks for nesting

2 years agoMade FlexBuffers reuse tracker track types
Wouter van Oortmerssen [Tue, 14 Dec 2021 18:00:56 +0000 (10:00 -0800)]
Made FlexBuffers reuse tracker track types

2 years agoPrevent shadow with _{{FIELD_NAME}} (#6991)
Derek Bailey [Tue, 14 Dec 2021 05:27:36 +0000 (21:27 -0800)]
Prevent shadow with _{{FIELD_NAME}} (#6991)

2 years agoFlexBuffers fuzzer fixes
Wouter van Oortmerssen [Mon, 13 Dec 2021 23:45:21 +0000 (15:45 -0800)]
FlexBuffers fuzzer fixes

- String dedup wasn't handling internal nulls correctly.
- Verifier wasn't recursing for certain types.
- Vector self-reference could create inf recursion.

2 years agoRefractor Flatc Options (#6987)
Derek Bailey [Mon, 13 Dec 2021 21:56:47 +0000 (13:56 -0800)]
Refractor Flatc Options (#6987)

* Moved error/warnings to bottom of std error

* Refactor flatc options

* pass program name to flatc

* extra -- in one option

* merge of upstream

2 years ago[CMake] Add option for disable universal on OSX (#6990)
Vadim-Valdis Yudaev [Mon, 13 Dec 2021 21:32:58 +0000 (23:32 +0200)]
[CMake] Add option for disable universal on OSX (#6990)

See https://github.com/google/flatbuffers/issues/6988

2 years agoValidate C# json/object-api options (#6985)
Derek Bailey [Mon, 13 Dec 2021 19:52:01 +0000 (11:52 -0800)]
Validate C# json/object-api options (#6985)

2 years agoAdd .NET test to github workflows (#6982)
Derek Bailey [Mon, 13 Dec 2021 19:51:27 +0000 (11:51 -0800)]
Add .NET test to github workflows (#6982)

2 years ago[CMake]: Fix version in pkgconfig file (#6986)
Biswapriyo Nath [Fri, 10 Dec 2021 23:40:21 +0000 (05:10 +0530)]
[CMake]: Fix version in pkgconfig file (#6986)

This change checks if the current source directory is a git repository.
If this is not checked the git command picks the commit hash from
parent directory. e.g. when tarball is extracted in a packaging repository.

2 years agore-enabled FlexBuffer JSON in fuzzer
Wouter van Oortmerssen [Fri, 10 Dec 2021 23:22:06 +0000 (15:22 -0800)]
re-enabled FlexBuffer JSON in fuzzer

2 years agoVerifier for FlexBuffers (#6977)
Wouter van Oortmerssen [Fri, 10 Dec 2021 22:59:08 +0000 (14:59 -0800)]
Verifier for FlexBuffers (#6977)

* Verifier for FlexBuffers

* Verifier improvements & fuzzer

2 years ago[CMake]: Fix python command for mingw environment (#6984)
Biswapriyo Nath [Fri, 10 Dec 2021 19:28:24 +0000 (00:58 +0530)]
[CMake]: Fix python command for mingw environment (#6984)

In mingw build environment, this fixes the build error:
'py' is not recognized as an internal or external command
The 'py' launcher is available for MSVC python only. More
https://docs.python.org/3/using/windows.html#from-the-command-line

2 years agoEnable --gen-onefile in Python (#6953)
lu-wang-g [Thu, 9 Dec 2021 23:47:09 +0000 (15:47 -0800)]
Enable --gen-onefile in Python (#6953)

* Enable --gen-onefile in Python

Made it possible to generate all python code in one file. Modified
py_test.py so that it can switch between the multi-file code and
the one-file code.

Updated PythonTest.sh and py_test.py so that the multi-file code
and the one-file code can be tested based on the same test code.

* Sync with google/flatbuffers

* Add --gen-onefile to generate_code.py

2 years agoMake idl_parser deterministic (#6976)
Danila Kutenin [Thu, 9 Dec 2021 21:07:29 +0000 (21:07 +0000)]
Make idl_parser deterministic (#6976)

* Make idl_parser deterministic

Some golden tests even exercise this [logic](https://github.com/google/flatbuffers/blob/df2df21ec1be2468106fed10c1533eacc1cf0d2e/tests/prototest/test.golden#L8). Let's make the parser fully stable not depending on the implementation of std::sort

* Retry the ci

2 years agoBumping to Version 2.0.5 (#6967)
Derek Bailey [Thu, 9 Dec 2021 18:31:57 +0000 (10:31 -0800)]
Bumping to Version 2.0.5 (#6967)

2 years agoFix typo in variable name (#6973)
David Sanders [Thu, 9 Dec 2021 18:30:15 +0000 (10:30 -0800)]
Fix typo in variable name (#6973)

2 years agoremove Appveyor's Vs2010 and 13 builds (#6969)
Derek Bailey [Mon, 6 Dec 2021 22:18:22 +0000 (14:18 -0800)]
remove Appveyor's Vs2010 and 13 builds (#6969)

2 years ago[TS] Fix reserved words as arguments (#6955) (#6956)
tira-misu [Mon, 6 Dec 2021 22:16:04 +0000 (23:16 +0100)]
[TS] Fix reserved words as arguments (#6955) (#6956)

* 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

* [TS] Fix reserved words as arguments (#6955)

2 years agoUpdate stale bot version and provide away to exempt issues with the not-stale label...
Derek Bailey [Fri, 3 Dec 2021 21:51:05 +0000 (13:51 -0800)]
Update stale bot version and provide away to exempt issues with the not-stale label (#6968)

2 years agomissing generated files (#6966)
Derek Bailey [Fri, 3 Dec 2021 19:23:58 +0000 (11:23 -0800)]
missing generated files (#6966)

These shouldn't be used, so short circuiting CI.

2 years agoLua Generator using IR. (#6940)
Derek Bailey [Fri, 3 Dec 2021 05:29:19 +0000 (21:29 -0800)]
Lua Generator using IR. (#6940)

* initial hack to get new Lua generator into flatc

* Starting to output enum defs for Lua

* Continue to work on table generation for Lua

* Finished basic getter access for Lua

* Added ability to get object by index

* Finished struct builder

* aliased reflection to r

* finish table builder generation

* register requiring files

* better generated header info

* Tying up loose ends

* Updated reflection to handle struct padding

* Addd type sizes to reflection

* Fixed some vector indirect issues

* Lua tests passed

* Misc cleanup

* ci fixes 1

* ci fixes 2

* renaming

* up size of type sizes

* manually ran clang-format-11 -i src/idl_parser.cpp

* fixed some windows casting

* remove stupid auto import

* more static_casting

* remove std

* update other build environments

* remove scoped enums

* replaced std::to_string with NumToString

* more win fixes

* more win fixes

* replaced old lua with new

* removed auto import

* review responses

* more style fixes

* refactor bfbs_gen_len to use code +=

* added consts

* fix lambda capture for windows

* remove unused return type

2 years agoFixedTypedVector: add const to ElementType() and size() (#6965)
Markus Junginger [Fri, 3 Dec 2021 04:32:51 +0000 (05:32 +0100)]
FixedTypedVector: add const to ElementType() and size() (#6965)

2 years agoHave grpc include file with correct filename-suffix given to flatc (#6954)
Panagiotis Gourgaris [Thu, 2 Dec 2021 17:49:12 +0000 (19:49 +0200)]
Have grpc include file with correct filename-suffix given to flatc (#6954)

When generating code with --grpc,  --cpp and using filename-suffix, the generated grpc files where not including the correct header that had the filename-suffix. As a suffix, they used the default "_generated".
Free functions for these were used to get the suffix. FlatBufFile had such methods, but also needed to be into its base File and use these.
- grpc generated files include the correct message header.
- grpc generated files also have the suffix
- grpc generated cc file does not include initial message header