3404 Commits

Author SHA1 Message Date
Cameron Mulhern
646a8bc96a Improves Rust code generation (#8564)
* Fixes checks for serde features in flexbuffers crate

* Removes unused MapReaderIndexer use statement

* Fixes warning about nightly cfg usage

Enabling a cfg attribute through cargo::rustc-cfg in build.rs should be coupled with a cargo::rust-check-cfg value so that the compiler knows about the custom cfg. See: https://doc.rust-lang.org/rustc/check-cfg/cargo-specifics.html#cargorustc-check-cfg-for-buildrsbuild-script.

* Migrates usage of deprecated float constants

This update fixes a compiler warning from use of the old constants.

Constants like EPSILON are now directly on the float primitives (e.g. f32::EPSILON) rather than in the f32 module (std::f32::EPSILON).

The new constants have existed since 1.43.0, which appears to be below the MSRV for the flatbuffers crate.

* Fixes incorrect key in flatbuffers Cargo.toml

The old code was using package.rust, which triggered a warning about an unused key:

warning: flatbuffers/rust/flatbuffers/Cargo.toml: unused manifest key: package.rust

The correct key for specifying MSRV is rust-version. See: https://doc.rust-lang.org/cargo/reference/rust-version.html#rust-version.

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-12-02 18:06:24 -08:00
Felix
0e3471d6a7 WIP error messages (#8764)
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-12-02 17:52:30 -08:00
Felix
b07589a0f9 CI: Fix typo in version (#8817) 2025-12-02 16:14:43 -05:00
mustiikhalil
2062c33cd4 Add support for Flexbuffers in wasm (#8815) 2025-12-02 16:18:24 +01:00
Felix
adb7add87e Modernize GitHub CI actions (#8812)
* CI: Modernize actions/checkout

* CI: Modernize actions/stale

* CI: Modernize softprops/action-gh-release

* CI: Modernize microsoft/setup-msbuild

* CI: Modernize gradle/actions/setup-gradle

* CI: Modernize actions/setup-dotnet

* CI: Modernize actions/setup-java

* CI: Modernize jiro4989/setup-nim-action

* CI: Update to latest image seems to be fixed

The readme list swift now for 24.04

* CI: Update to latest actions/labeler tag instead of sha
2025-12-02 10:11:55 -05:00
mustiikhalil
29f99937c4 Migrating to swift wasm on for github actions (#8814)
Migrate to use the native SDK for Wasm that's built for swift
2025-12-02 02:13:22 +01:00
Jacob Abrams
597e76a268 Optimize Offset/Pad/Prep: use cached head and slicing, reduce casting (#8808) 2025-12-01 19:00:20 -05:00
Wakahisa
a577050817 [Java] Use Table's fully qualified path (#8729)
* [Java] Use Table's fully qualified path

When a table's name is called `Table`, the Java bindings generated result in an error due to there being  2 Tables. This fixes the issue by fully qualifyng the flatbuffers Table import.

* Update codegen

* Update generated Java code

---------

Co-authored-by: Neville Dipale <neville@urbanlogiq.com>
2025-12-01 11:28:50 -05:00
razvanalex
31ab0bf6c8 [Go] Write required string fields into the buffer when using Object API (#8402)
* [Go] Write required string fields into the buffer when using Object API

In C++, CreateX allows to write the default "" value of a required
string, when the string is not explicitly set. Object API Pack method
uses this implementation of CreateX.

However, in go, despite whether the field is optional or required, it is
always checked against empty string allowing to create messages that
fail to pass the verifier. This commits partially reverts #7719 when the
string field is required.

* Add test for serializing required string fields using Object API

* Update generated code

The Monster schema contains a key string field. For historical
convenience reasons, string keys are assumed required.
2025-12-01 09:50:03 -05:00
Jeroen Demeyer
e4775aa3fe [Go] add BenchmarkBuildAllocations (#8287) 2025-11-30 22:12:12 -05:00
whiteye
97d26ab4ae fix CScript string.compare (#8547)
* fix CScript string.compare

Because the default compare sorting rules of c# string are different from those of cpp, the binary file exported by flatc -b cannot use LookupByKey

* run generate_code.py

---------
2025-11-30 22:06:41 -05:00
James Robinson
7dd38fa23a Fix platform ifdefs for locale independent str functions (#8678)
Android libraries include <android/api-level.h> which defines the __ANDROID_API__ symbol even when targeting non-Android platforms and not using Android's libc. This updates the FLATBUFFERS_LOCALE_INDEPENDENT ifdef to check for __ANDROID__ before checking the Android API level.

Removes an extra check from the __Fuchsia__ branch. Fuchsia's libc does not support locales or the locale independent entry points.

Updates the Android API check to check for an API level >= 26 instead of 21. This matches the Android header file's availability macros and Bionic documentation:

https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md
2025-11-30 21:38:37 -05:00
Jacob Abrams
7350c3668f Optimize Builder startup: lazy sharedStrings and fast vtable init (#8807) 2025-11-30 23:33:34 +00:00
Felix
49d2db93a7 [Python] Fix generating __init__.py for invalid path (#8810)
This tried to generate from a directories "MyGame/Sample/"
for a empty path_ in M, MyGame & MyGame/Sample.
Which is incorrect since we want to start with the first
kPathSeparator `/` and not position 1.
2025-11-30 23:30:55 +00:00
Uilian Ries
807b43c0d7 Remove legacy Conan recipe and update documentation (#8712)
* Remove legacy Conan recipe

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Document how to install flatbuffers with Conan

Signed-off-by: Uilian Ries <uilianries@gmail.com>

---------

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Justin Davis <jtdavis777@gmail.com>
2025-11-30 11:35:02 +00:00
peter-soos
4b823b1b98 [Python] Fix inconsistent creator function naming in generated code (#8791) (#8792) 2025-11-29 16:48:53 -05:00
mustiikhalil
4c47f4c11e Revert back to using swift-actions (#8806)
Reverting to swift-actions since they seem to have fixed the issue with GPG keys
2025-11-27 21:56:20 -05:00
coder7695
2b107e20c5 [fuzzer] Adds code generation target. (#8795)
* adds code generation fuzzer target.

* add buffer verification

* add table verification in codegen fuzzer

---------

Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
2025-11-27 15:52:28 +00:00
Jacob Bandes-Storch
84f4b83d3e TypeScript: read vtable entries as uint16 (#8435)
Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
2025-11-27 10:55:34 +00:00
dependabot[bot]
185e41fac4 Bump js-yaml in the npm_and_yarn group across 1 directory (#8779)
Bumps the npm_and_yarn group with 1 update in the / directory: [js-yaml](https://github.com/nodeca/js-yaml).


Updates `js-yaml` from 4.1.0 to 4.1.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
2025-11-27 11:50:31 +01:00
Grzegorz Owsiany
8b02fe6178 [C++] Fix vtable deduplication for 64-bit buffers >2GB (#8591)
Fixes #8590
2025-11-26 21:12:24 -05:00
Sutou Kouhei
6e0dad8c5f Use macos-15-intel not macos-latest-large for Intel macOS (#8777)
We can't use macos-latest-large in non paid GitHub account but we can
use macos-15-intel in public repositories. If we use macos-15-intel,
we can run CI jobs for Intel macOS in fork repositories.
2025-11-26 19:31:24 -05:00
obones
e3e355d498 feat: library definition for PlatformIO (#8261)
* feat: library definition for PlatformIO

* Update library.json version with release.sh

---------

Co-authored-by: Flávio Zanoni <flaviozg888@gmail.com>
2025-11-26 19:18:13 -05:00
Jakob Kordež
8e901ce17c Fix dart object api test (#8751) 2025-11-26 17:36:08 -05:00
Yuanyuan Chen
7808ae5c88 More robust <span> check (#8631) 2025-11-26 17:33:06 -05:00
Wakahisa
20068cfa05 [Java] Add notify to Java keywords (#8724)
Fixes #8723

Co-authored-by: Neville Dipale <neville@urbanlogiq.com>
Co-authored-by: Max Burke <max@urbanlogiq.com>
2025-11-26 07:59:18 -08:00
Wakahisa
afd07bdec5 [Java] Generate Longs from uint enums (#8727)
Co-authored-by: Neville Dipale <neville@urbanlogiq.com>
Co-authored-by: Max Burke <max@urbanlogiq.com>
2025-11-26 07:58:25 -08:00
Hjalti Leifsson
2951d5383a chore: fix quick start typos (#8520)
* chore: fix another typo

* chore: undo overzealous IDE changes
2025-11-25 16:24:23 -05:00
Glenn Fiedler
ba563de877 add assert to fix GCC warning on Ubuntu 24.04 LTS (#8804) 2025-11-25 14:08:51 -05:00
Fawdlstty
46a2f3f2c2 [dart] fix bug which generated wrong code (#8780) 2025-11-24 10:54:43 -05:00
Ivan Dlugos
7675121eab Add Dart changelog entry for v25.9.23 (#8785)
Documents changes included in the Dart package v25.9.23 release,
which was published to pub.dev.
2025-11-24 09:18:23 -05:00
Benjamin Kietzman
ea2b5148e5 Fix issue #8389: any nonzero byte is truthy (#8690) 2025-11-24 07:26:39 -05:00
Fergus Henderson
20548ff3b6 Size verifier fix 2 (#8740)
* Fixes to make SizeVerifier work.

In particular change all the places in the Flatbuffers library
and generated code that were using `Verifier` to instead use
`VerifierTemplate<TrackBufferSize>` and wrap them all inside
`template <bool TrackBufferSize = false>`.

Also add unit tests for SizeVerifier.

* Format using `sh scripts/clang-format-git.sh`

* Use `B` rather than `TrackBufferSize` for the name of the template parameter.

* Update generated files.
2025-11-24 07:11:32 -05:00
Jacob Abrams
7ea8db05d8 [Python] Add unit test for github issue 8653 (#8786) 2025-11-24 06:41:50 -05:00
Justin Davis
c7b6b66ccb fix: remove a single type hint to retain 2.7.x compatibility (#8799)
Co-authored-by: Hjalti Leifsson <hjaltileifsson@gmail.com>
2025-11-23 12:00:21 -08:00
Justin Davis
ac8b124496 don't crash on a lua file with no root table (#8770)
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-17 22:31:32 +00:00
Justin Davis
88b033b964 add proposed fixes from #8731 (#8771)
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-17 13:46:41 -08:00
Justin Davis
e68355cb22 [C++] Add Vector64 specialization for std::vector<bool> (#8757)
* add vector64 specialization for vector<bool>

* fix generated code

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-17 13:44:28 -08:00
Justin Davis
e3ee24830e Fix Issue #8653 - Python vtables not considering object size (#8683)
* have vtables consider size

* simplification from comment

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-17 13:43:28 -08:00
Felix
2a8f4568e0 Replace usage of make_unique with unique_ptr for cpp11 (#8763) 2025-11-17 13:42:06 -08:00
mustiikhalil
cbf0850828 [Swift] Inline arrays (#8755)
Implements InlineArrays which allow us to use Flatbuffers arrays within
Structs natively, and also implements FlatbufferVectors as a secondary API
when using mutable Structs

Fixes mutations within fixed sizes arrays

Adds tests and remove inout and mutating from generated objects in favor of borrowing

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-15 00:33:16 +01:00
mustiikhalil
7150dfb5c4 [Swift] Bump minimum supported version of swift to 5.10 (#8758) 2025-11-14 15:07:49 -08:00
mustiikhalil
fa87eccd1a Update swift supported features (#8769) 2025-11-14 15:07:25 -08:00
mustiikhalil
a62f45fed8 Improves the performance of the string imp (#8772)
Improves the performance of the implementation in Swift
by using withCString instead of the contigiousString
2025-11-14 15:06:52 -08:00
cosmith-nvidia
599847236c Support native_type for tables when using the C++ object API. (#8668)
* Support native_type for tables when using the C++ object API.

If native_type is specified on a table:
- No object API struct type is generated.
- The object API refers to the table by its native_type.
- UnPack and Create<TableName> methods are declared but not defined; as they
  must be user-provided.

* Add tests for native_type on tables.

* Add documentation for native_type on tables.
2025-11-05 07:50:10 -08:00
cosmith-nvidia
4173b84d4b Fix --gen-compare to not generate comparators for native types. (#8681)
Per the definition of --gen-compare: only generate comparators for object API
generated structs. Types annoated with native_type must define their own
comparators if `--gen-compare` is enabled.

Also enables --gen-compare for native_type_test and fixes the test by adding a
comparator for the Native::Vector3D type.
2025-11-05 00:43:00 +00:00
mustiikhalil
5fe90a9160 [Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift

Implements FlatbuffersVector which confirms to RandomAccessCollection,
this would give us semi-native sugary syntax to all the arrays in swift port.

This work will also be the foundation of using arrays in swift

* Fix failing tests for Swift
2025-11-04 23:53:59 +00:00
cosmith-nvidia
78a3d59a65 Swap the dependency of CreateX and X::Pack object API functions. (#8754)
Previously: X::Pack forwarded to CreateX.

Now: CreateX will forward to X::Pack.

This is a step toward enabling using native types for tables when using the
object API. When defining a native table, the user will be able to define a
custom X::Pack method (which is more consistent with the existing native_type
functionality for structs). By reversing the order of the dependencies, CreateX
can continue to be auto-generated and will use the custom X::Pack method when
overriden for native_type tables.
2025-11-04 15:42:16 -08:00
are-you-tilted-already
5ed02dc04a Prevent make_span from working with vectors and arrays of pointers (#8735)
* Prevent `make_span` from working with vectors and arrays of pointers

* support `make_structs_span` for little-endian

* fix build: add the required parentheses

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-11-04 13:47:44 -08:00
Jakob Kordež
592dc50037 Refactor lazy list unpacking (#8746)
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-10-31 13:41:59 -07:00