Compare commits

..

14 Commits

Author SHA1 Message Date
Derek Bailey
0312061985 FlatBuffers Version 25.1.24 2025-01-24 16:36:11 -08:00
Taiju Tsuiki
9f94ceedbc [C++] Avoid adding semicolon after a statement (#8488)
Co-authored-by: Derek Bailey <derekbailey@google.com>
2025-01-24 11:00:18 -08:00
Marcel
bcd2b9d039 Add Bazel docs (#8510) 2025-01-24 10:57:52 -08:00
Marcel
82fefbf252 Remove Bazel WORKSPACE setup. (#8509) 2025-01-24 18:16:10 +00:00
Sebastian Barfurth
65e49faf76 Bump the versions of all aspect Bazel dependencies (#8508)
* bump all aspect dependency versions to latest

* add workspace file to test bazel repo
2025-01-24 10:09:22 -08:00
Marcel
50be3cfe8c Test external modules explicitly in CI (#8507)
This setup is much simpler than calling Bazel from within Bazel
and making sure files and flags are set up correctly.

Co-authored-by: Derek Bailey <derekbailey@google.com>
2025-01-23 23:04:06 +00:00
Marcel
026c243dc5 Add support for Bazel 7 and 8 in Bazel CI (#8505)
* Add missing file to filegroup for bazel integration tests

Fixup after a9257b6963.

* Align versions in bazel_respository_test_dir with root

* Update XCode version to 15.2

This is the oldest available version.

* Add WORKSPACE.bzlmod

* Add support for Bazel 7

* Add support for Bazel 8 in CI
2025-01-23 14:59:14 -08:00
Marcel
a9257b6963 Fix npm bzlmod (#8506)
* Restrict visibility of exported file

* Align npm_translate_lock attrs

* Remove defs_bzl_filename attr

* Align root_package with pnpm-lock.yaml location

Use a symlink to avoid copying the file.
2025-01-23 21:01:31 +00:00
Marcel
fceafd438d Improve Bazel CI (#8502)
* Update Buildkite Bazel CI

Restructure presubmit.yml to support matrix.

* Remove testing Ubuntu 18.04

The available LLVM 6.0 is too old to support std::filesystem.

* Add testing in Ubuntu 22.04

* Use Bazel version 6.5.0 in integration test
2025-01-23 12:10:27 -08:00
Marcel
33a15d63cf Fix reflection.fbs import path (#8499)
We need to copy the .fbs files into the package used for .bfbs files.
This is necessary as flatc doesn't provide support to specify the full
output file name for an .fbs file in a different folder.
I tried OUTPUT_FILE env var but this doesn't seem to be honored by
flatc.
2025-01-23 19:43:23 +00:00
Marcel
ad6d6638f3 Fix Bzlmod (#8503)
* Fix Bzlmod npm repo name

* Fix Bazel integration tests with Bzlmod
2025-01-23 08:52:48 -08:00
Derek Bailey
69ac6a712d Add bazel ci (#8497) 2025-01-22 13:41:45 -08:00
Marcel
4b69b27d43 Also use rules_bazel_bazel_integration_test dependency with Bzlmod (#8498)
* Also use rules_bazel_bazel_integration_test dependency with Bzlmod

* Update versions
2025-01-22 08:22:53 -08:00
Derek Bailey
9318c6c981 Update Evolution doc 2025-01-21 21:28:32 -08:00
213 changed files with 460 additions and 781 deletions

View File

@@ -1,22 +1,13 @@
---
buildifier: latest
bazel: 6.4.0
platforms:
ubuntu1804:
environment:
CC: clang
SWIFT_VERSION: "5.8"
SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION"
PATH: "$PATH:$SWIFT_HOME/usr/bin"
shell_commands:
- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
- "mkdir $SWIFT_HOME"
- "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu1804/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu18.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME"
build_targets:
- "//..."
test_targets:
- "//..."
ubuntu2004:
matrix:
bazel:
- 7.x
- 8.x
tasks:
verify_ubuntu2004:
platform: ubuntu2004
bazel: ${{ bazel }}
environment:
CC: clang
SWIFT_VERSION: "5.8"
@@ -30,8 +21,38 @@ platforms:
- "//..."
test_targets:
- "//..."
macos:
xcode_version: "14.3"
verify_ubuntu2204:
platform: ubuntu2204
bazel: ${{ bazel }}
environment:
CC: clang
SWIFT_VERSION: "5.8"
SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION"
PATH: "$PATH:$SWIFT_HOME/usr/bin"
shell_commands:
- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
- "mkdir $SWIFT_HOME"
- "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME"
build_targets:
- "//..."
test_targets:
- "//..."
test_module_cpp:
platform: ubuntu2204
bazel: ${{ bazel }}
working_directory: tests/bazel_repository_test_dir
build_targets:
- "//..."
test_module_ts:
platform: ubuntu2204
bazel: ${{ bazel }}
working_directory: tests/ts/bazel_repository_test_dir
test_targets:
- "//..."
verify_macos:
platform: macos
bazel: ${{ bazel }}
xcode_version: "15.2"
build_targets:
- "//:flatbuffers"
- "//:flatc"

View File

@@ -1 +1,5 @@
ts/node_modules
# Test workspaces
tests/bazel_repository_test_dir
tests/ts/bazel_repository_test_dir

View File

@@ -9,4 +9,10 @@ common --action_env=JAVA_HOME=../bazel_tools/jdk
# Workaround "Error: need --enable_runfiles on Windows for to support rules_js"
common:windows --enable_runfiles
# Swift is not required on Windows
common:windows --deleted_packages=swift
common:windows --deleted_packages=swift
# Ignore warnings in external dependencies
build --per_file_copt=external/.*@-Wno-everything --host_per_file_copt=external/.*@-Wno-everything
# Honor the setting of `skipLibCheck` in the tsconfig.json file.
common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
# Use "tsc" as the transpiler when ts_project has no `transpiler` set.
common --@aspect_rules_ts//ts:default_to_tsc_transpiler

View File

@@ -575,6 +575,21 @@ jobs:
working-directory: tests/nim
run: python3 testnim.py
bazel:
name: Bazel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: bazel build
run: >
bazel build
//:flatc
//:flatbuffers
- name: bazel test
run: >
bazel test
//tests:flatbuffers_test
release-digests:
if: startsWith(github.ref, 'refs/tags/')
needs: [build-linux, build-windows, build-mac-intel, build-mac-universal]

View File

@@ -32,7 +32,6 @@ filegroup(
".npmrc",
"BUILD.bazel",
"MODULE.bazel",
"WORKSPACE",
"build_defs.bzl",
"package.json",
"pnpm-lock.yaml",

View File

@@ -4,6 +4,12 @@ All major or breaking changes will be documented in this file, as well as any
new features that should be highlighted. Minor fixes or improvements are not
necessarily listed.
## [25.1.24] (January 24 2024)(https://github.com/google/flatbuffers/releases/tag/v25.1.24))
* Mostly related to bazel build support.
* Min bazel supported is now 7 or higher, as WORKSPACE files are removed (#8509)
* Minor C++ codegen fix removing extra semicolon (#8488)
## [25.1.21] (January 21 2025)(https://github.com/google/flatbuffers/releases/tag/v25.1.21)
* Rust Full Reflection (#8102)

View File

@@ -1,6 +1,6 @@
set(VERSION_MAJOR 25)
set(VERSION_MINOR 1)
set(VERSION_PATCH 21)
set(VERSION_PATCH 24)
set(VERSION_COMMIT 0)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FlatBuffers'
s.version = '25.1.21'
s.version = '25.1.24'
s.summary = 'FlatBuffers: Memory Efficient Serialization Library'
s.description = "FlatBuffers is a cross platform serialization library architected for

View File

@@ -1,72 +1,73 @@
module(
name = "flatbuffers",
version = "24.3.25",
version = "25.1.24",
compatibility_level = 1,
repo_name = "com_github_google_flatbuffers",
)
bazel_dep(
name = "aspect_bazel_lib",
version = "1.40.0",
version = "2.11.0",
)
bazel_dep(
name = "aspect_rules_esbuild",
version = "0.15.0",
version = "0.21.0",
)
bazel_dep(
name = "aspect_rules_js",
version = "1.34.1",
version = "2.1.3",
)
bazel_dep(
name = "aspect_rules_ts",
version = "1.4.5",
version = "3.4.0",
)
bazel_dep(
name = "grpc",
version = "1.48.1",
version = "1.69.0",
repo_name = "com_github_grpc_grpc",
)
bazel_dep(
name = "platforms",
version = "0.0.7",
version = "0.0.10",
)
bazel_dep(
name = "rules_cc",
version = "0.0.9",
version = "0.0.16",
)
bazel_dep(
name = "rules_go",
version = "0.41.0",
version = "0.50.1",
repo_name = "io_bazel_rules_go",
)
bazel_dep(
name = "rules_nodejs",
version = "5.8.3",
version = "6.3.3",
)
bazel_dep(
name = "rules_swift",
version = "1.2.0",
version = "1.18.0",
repo_name = "build_bazel_rules_swift",
)
bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
)
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
name = "flatbuffers_npm",
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
pnpm_lock = "//ts:pnpm-lock.yaml",
# Override the Bazel package where pnpm-lock.yaml is located and link
# to the specified package instead.
root_package = "ts",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
use_repo(npm, "flatbuffers_npm")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_linux_amd64")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")
non_module_dependencies = use_extension("//:extensions.bzl", "non_module_dependencies", dev_dependency = True)
use_repo(
non_module_dependencies,
"bazel_linux_x86_64",
)

212
WORKSPACE
View File

@@ -1,212 +0,0 @@
workspace(name = "com_github_google_flatbuffers")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "platforms",
sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
],
)
# Import our own version of skylib before other rule sets (e.g. rules_swift)
# has a chance to import an old version.
http_archive(
name = "bazel_skylib",
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
http_archive(
name = "build_bazel_rules_apple",
sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7",
url = "https://github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz",
)
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
http_archive(
name = "build_bazel_rules_swift",
sha256 = "a2fd565e527f83fb3f9eb07eb9737240e668c9242d3bc318712efa54a7deda97",
url = "https://github.com/bazelbuild/rules_swift/releases/download/0.27.0/rules_swift.0.27.0.tar.gz",
)
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:extras.bzl",
"swift_rules_extra_dependencies",
)
swift_rules_extra_dependencies()
http_archive(
name = "io_bazel_rules_go",
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
go_rules_dependencies()
##### Protobuf
_PROTOBUF_VERSION = "3.15.2"
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-" + _PROTOBUF_VERSION,
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v" + _PROTOBUF_VERSION + ".tar.gz",
],
)
#### Building boring ssl
# Fetching boringssl within the flatbuffers repository, to patch the issue
# of not being able to upgrade to Xcode 14.3 due to buildkite throwing errors
# which was patched in the following below.
# https://github.com/google/flatbuffers/commit/67eb95de9281087ccbba9aafd6e8ab1958d12045
# The patch was copied from the following comment on the same issue within tensorflow
# and fixed to adapt the already existing patch for boringssl.
# https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147
http_archive(
name = "boringssl",
patch_args = ["-p1"],
patches = ["//grpc:boringssl.patch"],
# Use github mirror instead of https://boringssl.googlesource.com/boringssl
# to obtain a boringssl archive with consistent sha256
sha256 = "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40",
strip_prefix = "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
"https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
],
)
##### GRPC
_GRPC_VERSION = "1.49.0" # https://github.com/grpc/grpc/releases/tag/v1.48.0
http_archive(
name = "com_github_grpc_grpc",
patch_args = ["-p1"],
patches = ["//grpc:build_grpc_with_cxx14.patch"],
sha256 = "15715e1847cc9e42014f02c727dbcb48e39dbdb90f79ad3d66fe4361709ff935",
strip_prefix = "grpc-" + _GRPC_VERSION,
urls = ["https://github.com/grpc/grpc/archive/refs/tags/v" + _GRPC_VERSION + ".tar.gz"],
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
# rules_go from https://github.com/bazelbuild/rules_go/releases/tag/v0.34.0
http_archive(
name = "aspect_rules_js",
sha256 = "76a04ef2120ee00231d85d1ff012ede23963733339ad8db81f590791a031f643",
strip_prefix = "rules_js-1.34.1",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.34.1/rules_js-v1.34.1.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@aspect_rules_js//npm:npm_import.bzl", "pnpm_repository")
pnpm_repository(name = "pnpm")
http_archive(
name = "aspect_rules_ts",
sha256 = "4c3f34fff9f96ffc9c26635d8235a32a23a6797324486c7d23c1dfa477e8b451",
strip_prefix = "rules_ts-1.4.5",
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.5/rules_ts-v1.4.5.tar.gz",
)
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(
# Since rules_ts doesn't always have the newest integrity hashes, we
# compute it manually here.
# $ curl --silent https://registry.npmjs.org/typescript/5.3.3 | jq ._integrity
ts_integrity = "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
ts_version_from = "//:package.json",
)
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
load("@com_github_google_flatbuffers//ts:repositories.bzl", "flatbuffers_npm")
flatbuffers_npm(
name = "flatbuffers_npm",
)
load("@flatbuffers_npm//:repositories.bzl", "npm_repositories")
npm_repositories()
http_archive(
name = "aspect_rules_esbuild",
sha256 = "098e38e5ee868c14a6484ba263b79e57d48afacfc361ba30137c757a9c4716d6",
strip_prefix = "rules_esbuild-0.15.0",
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.15.0/rules_esbuild-v0.15.0.tar.gz",
)
# Register a toolchain containing esbuild npm package and native bindings
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains")
esbuild_register_toolchains(
name = "esbuild",
esbuild_version = LATEST_ESBUILD_VERSION,
)
http_archive(
name = "rules_bazel_integration_test",
sha256 = "3e24bc0fba88177cd0ae87c1e37bf7de5d5af8e812f00817a58498b1a8368fca",
urls = [
"https://github.com/bazel-contrib/rules_bazel_integration_test/releases/download/v0.31.0/rules_bazel_integration_test.v0.31.0.tar.gz",
],
)
load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")
bazel_integration_test_rules_dependencies()
load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")
bazel_starlib_dependencies()
load("@rules_bazel_integration_test//bazel_integration_test:defs.bzl", "bazel_binaries")
bazel_binaries(versions = ["6.3.2"])

View File

@@ -57,7 +57,7 @@ class Animal : Table() {
return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal())
fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -7,19 +7,13 @@ Rules for building C++ flatbuffers with Bazel.
load("@rules_cc//cc:defs.bzl", "cc_library")
def repo_name(label):
if hasattr(label, "repo_name"): # Added in Bazel 7.1
return label.repo_name
else:
return "com_github_google_flatbuffers"
TRUE_FLATC_PATH = Label("//:flatc")
DEFAULT_INCLUDE_PATHS = [
"./",
"$(GENDIR)",
"$(BINDIR)",
"$(execpath %s).runfiles/%s" % (TRUE_FLATC_PATH, repo_name(TRUE_FLATC_PATH)),
"$(execpath %s).runfiles/%s" % (TRUE_FLATC_PATH, TRUE_FLATC_PATH.repo_name),
]
def default_include_paths(flatc_path):
@@ -27,7 +21,7 @@ def default_include_paths(flatc_path):
"./",
"$(GENDIR)",
"$(BINDIR)",
"$(execpath %s).runfiles/%s" % (flatc_path, repo_name(flatc_path)),
"$(execpath %s).runfiles/%s" % (flatc_path, flatc_path.repo_name),
]
DEFAULT_FLATC_ARGS = [
@@ -142,6 +136,8 @@ def flatbuffer_library_public(
reflection_genrule_cmd = " ".join([
"SRCS=($(SRCS));",
"for f in $${SRCS[@]:0:%s}; do" % len(srcs),
# Move the .fbs file into the current package if it is not there already
'if [[ $$(dirname $$f) != "{0}" ]]; then s="$$f"; f="{0}/$$(basename "$$f")"; mkdir -p "{0}"; mv "$$s" "$$f"; fi;'.format(native.package_relative_label(":invalid").package),
"$(location %s)" % (TRUE_FLATC_PATH),
"-b --schema",
" ".join(flatc_args),
@@ -152,9 +148,10 @@ def flatbuffer_library_public(
"done",
])
reflection_outs = [
(out_prefix + "%s.bfbs") % (s.replace(".fbs", "").split("/")[-1])
(out_prefix + "%s.bfbs") % (native.package_relative_label(s).name.removesuffix(".fbs"))
for s in srcs
]
native.genrule(
name = "%s_srcs" % reflection_name,
srcs = srcs + includes,

View File

@@ -1,5 +1,5 @@
name: flat_buffers
version: 25.1.21
version: 25.1.24
description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team.
homepage: https://github.com/google/flatbuffers
documentation: https://google.github.io/flatbuffers/index.html

View File

@@ -75,6 +75,20 @@ Once the project files are generated, build as normal for your platform.
## Building with Bazel
You can use [Bazelisk](https://github.com/bazelbuild/bazelisk) to manage your Bazel environment.
For Swift support, you also need Clang and [Swift SDK](https://download.swift.org/).
```sh
curl -sL --fail https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 -o bazelisk && chmod +x bazelisk
sudo apt install -y clang
SWIFT_VERSION="6.0.3"
curl -L https://download.swift.org/swift-${SWIFT_VERSION}-release/debian12/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-debian12.tar.gz | tar xz
CC=clang PATH=$PATH:$(pwd)/swift-${SWIFT_VERSION}-RELEASE-debian12/usr/bin bazel build //...
CC=clang PATH=$PATH:$(pwd)/swift-${SWIFT_VERSION}-RELEASE-debian12/usr/bin bazel test //...
```
If you are unsure which versions to use, check our CI config at `.bazelci/presubmit.yml`.
## Building with VCPKG
You can download and install flatbuffers using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:

View File

@@ -253,3 +253,24 @@ your schema changes have been committed, ensuring consistency with the rest of
the world. If this is not practical for you, use explicit field `id`s, which
should always generate a merge conflict if two people try to allocate the same
id.
## Checking Conformity
To check that schema are properly evolved, the [`flatc`](flatc.md) compiler has
a [option](flatc.md#additional-options) to do just that:
```sh
--conform FILE
```
Where `FILE` is the base schema the rest of the input schemas must evolve from.
It returns `0` if they are properly evolved, otherwise returns a non-zero value
and provides errors on the reason why the schema are not properly evolved.
As an example, the following checks if `schema_v2.fbs` is properly evolved from
`schema_v1.fbs`.
```sh
flatc --conform schema_v1.fbs schema_v2.fbs
```

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
namespace flatbuffers {

View File

@@ -13,7 +13,7 @@ public struct Galaxy : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Galaxy GetRootAsGalaxy(ByteBuffer _bb) { return GetRootAsGalaxy(_bb, new Galaxy()); }
public static Galaxy GetRootAsGalaxy(ByteBuffer _bb, Galaxy obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -13,7 +13,7 @@ public struct Universe : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Universe GetRootAsUniverse(ByteBuffer _bb) { return GetRootAsUniverse(_bb, new Universe()); }
public static Universe GetRootAsUniverse(ByteBuffer _bb, Universe obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool VerifyUniverse(ByteBuffer _bb) {Google.FlatBuffers.Verifier verifier = new Google.FlatBuffers.Verifier(_bb); return verifier.VerifyBuffer("", false, UniverseVerify.Verify); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Galaxy extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Galaxy getRootAsGalaxy(ByteBuffer _bb) { return getRootAsGalaxy(_bb, new Galaxy()); }
public static Galaxy getRootAsGalaxy(ByteBuffer _bb, Galaxy obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Universe extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Universe getRootAsUniverse(ByteBuffer _bb) { return getRootAsUniverse(_bb, new Universe()); }
public static Universe getRootAsUniverse(ByteBuffer _bb, Universe obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -34,7 +34,7 @@ class Galaxy : Table() {
return if(o != 0) bb.getLong(o + bb_pos) else 0L
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsGalaxy(_bb: ByteBuffer): Galaxy = getRootAsGalaxy(_bb, Galaxy())
fun getRootAsGalaxy(_bb: ByteBuffer, obj: Galaxy): Galaxy {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -47,7 +47,7 @@ class Universe : Table() {
val o = __offset(6); return if (o != 0) __vector_len(o) else 0
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsUniverse(_bb: ByteBuffer): Universe = getRootAsUniverse(_bb, Universe())
fun getRootAsUniverse(_bb: ByteBuffer, obj: Universe): Universe {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -6,7 +6,7 @@ import FlatBuffers
public struct flatbuffers_goldens_Galaxy: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table
@@ -41,7 +41,7 @@ public struct flatbuffers_goldens_Galaxy: FlatBufferObject, Verifiable {
public struct flatbuffers_goldens_Universe: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

View File

@@ -6,7 +6,7 @@ import FlatBuffers
public struct models_HelloReply: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table
@@ -53,7 +53,7 @@ extension models_HelloReply: Encodable {
public struct models_HelloRequest: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

View File

@@ -141,7 +141,7 @@
#define FLATBUFFERS_VERSION_MAJOR 25
#define FLATBUFFERS_VERSION_MINOR 1
#define FLATBUFFERS_VERSION_REVISION 21
#define FLATBUFFERS_VERSION_REVISION 24
#define FLATBUFFERS_STRING_EXPAND(X) #X
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
namespace flatbuffers {

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
namespace reflection {

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>25.1.21</version>
<version>25.1.24</version>
<packaging>bundle</packaging>
<name>FlatBuffers Java API</name>
<description>

View File

@@ -46,7 +46,7 @@ public class Constants {
Changes to the Java implementation need to be sure to change
the version here and in the code generator on every possible
incompatible change */
public static void FLATBUFFERS_25_1_21() {}
public static void FLATBUFFERS_25_1_24() {}
}
/// @endcond

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Enum extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Enum getRootAsEnum(ByteBuffer _bb) { return getRootAsEnum(_bb, new Enum()); }
public static Enum getRootAsEnum(ByteBuffer _bb, Enum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class EnumVal extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static EnumVal getRootAsEnumVal(ByteBuffer _bb) { return getRootAsEnumVal(_bb, new EnumVal()); }
public static EnumVal getRootAsEnumVal(ByteBuffer _bb, EnumVal obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Field extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Field getRootAsField(ByteBuffer _bb) { return getRootAsField(_bb, new Field()); }
public static Field getRootAsField(ByteBuffer _bb, Field obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class KeyValue extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static KeyValue getRootAsKeyValue(ByteBuffer _bb) { return getRootAsKeyValue(_bb, new KeyValue()); }
public static KeyValue getRootAsKeyValue(ByteBuffer _bb, KeyValue obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Object extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Object getRootAsObject(ByteBuffer _bb) { return getRootAsObject(_bb, new Object()); }
public static Object getRootAsObject(ByteBuffer _bb, Object obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class RPCCall extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static RPCCall getRootAsRPCCall(ByteBuffer _bb) { return getRootAsRPCCall(_bb, new RPCCall()); }
public static RPCCall getRootAsRPCCall(ByteBuffer _bb, RPCCall obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Schema extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Schema getRootAsSchema(ByteBuffer _bb) { return getRootAsSchema(_bb, new Schema()); }
public static Schema getRootAsSchema(ByteBuffer _bb, Schema obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean SchemaBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "BFBS"); }

View File

@@ -26,7 +26,7 @@ import java.nio.ByteOrder;
*/
@SuppressWarnings("unused")
public final class SchemaFile extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static SchemaFile getRootAsSchemaFile(ByteBuffer _bb) { return getRootAsSchemaFile(_bb, new SchemaFile()); }
public static SchemaFile getRootAsSchemaFile(ByteBuffer _bb, SchemaFile obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Service extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Service getRootAsService(ByteBuffer _bb) { return getRootAsService(_bb, new Service()); }
public static Service getRootAsService(ByteBuffer _bb, Service obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Type extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Type getRootAsType(ByteBuffer _bb) { return getRootAsType(_bb, new Type()); }
public static Type getRootAsType(ByteBuffer _bb, Type obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -32,6 +32,6 @@ namespace Google.FlatBuffers
Changes to the C# implementation need to be sure to change
the version here and in the code generator on every possible
incompatible change */
public static void FLATBUFFERS_25_1_21() {}
public static void FLATBUFFERS_25_1_24() {}
}
}

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<Description>A cross-platform memory efficient serialization library</Description>
<PackageVersion>25.1.21</PackageVersion>
<PackageVersion>25.1.24</PackageVersion>
<Authors>Google LLC</Authors>
<PackageProjectUrl>https://github.com/google/flatbuffers</PackageProjectUrl>
<RepositoryUrl>https://github.com/google/flatbuffers</RepositoryUrl>

View File

@@ -1,6 +1,6 @@
{
"name": "flatbuffers",
"version": "25.1.21",
"version": "25.1.24",
"description": "Memory Efficient Serialization Library",
"files": [
"js/**/*.js",

View File

@@ -14,4 +14,4 @@
# Placeholder, to be updated during the release process
# by the setup.py
__version__ = u"25.1.21"
__version__ = u"25.1.24"

View File

@@ -16,7 +16,7 @@ from setuptools import setup
setup(
name='flatbuffers',
version='25.1.21',
version='25.1.24',
license='Apache 2.0',
author='Derek Bailey',
author_email='derekbailey@google.com',

View File

@@ -7,6 +7,12 @@ filegroup(
visibility = ["//visibility:public"],
)
# flatbuffer_ts_library() only supports .fbs file but not filegroups
exports_files(
srcs = ["reflection.fbs"],
visibility = ["//reflection/ts:__pkg__"],
)
filegroup(
name = "reflection_fbs_schema",
srcs = ["reflection.fbs"],

View File

@@ -1,15 +1,8 @@
load("//:typescript.bzl", "flatbuffer_ts_library")
genrule(
name = "copy_schema_to_folder",
srcs = ["//reflection:reflection_fbs_schema"],
outs = ["reflection.fbs"],
cmd = "cp $< $@",
)
flatbuffer_ts_library(
name = "reflection_ts_fbs",
srcs = [":reflection.fbs"],
srcs = ["//reflection:reflection.fbs"],
gen_reflections = True,
visibility = ["//visibility:public"],
)

View File

@@ -1,6 +1,6 @@
[package]
name = "flatbuffers"
version = "25.1.21"
version = "25.1.24"
edition = "2018"
authors = ["Robert Winslow <hello@rwinslow.com>", "FlatBuffers Maintainers"]
license = "Apache-2.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "flexbuffers"
version = "25.1.21"
version = "25.1.24"
authors = ["Casper Neo <cneo@google.com>", "FlatBuffers Maintainers"]
edition = "2018"
license = "Apache-2.0"

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
namespace MyGame {
@@ -607,7 +607,7 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi
{ auto _e = name(); if (_e) _o->name = _e->str(); }
{ auto _e = inventory(); if (_e) { _o->inventory.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->inventory.begin()); } }
{ auto _e = color(); _o->color = _e; }
{ auto _e = weapons(); if (_e) { _o->weapons.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->weapons[_i]) { _e->Get(_i)->UnPackTo(_o->weapons[_i].get(), _resolver); } else { _o->weapons[_i] = std::unique_ptr<MyGame::Sample::WeaponT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->weapons.resize(0); } }
{ auto _e = weapons(); if (_e) { _o->weapons.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->weapons[_i]) { _e->Get(_i)->UnPackTo(_o->weapons[_i].get(), _resolver); } else { _o->weapons[_i] = std::unique_ptr<MyGame::Sample::WeaponT>(_e->Get(_i)->UnPack(_resolver)); } } } else { _o->weapons.resize(0); } }
{ auto _e = equipped_type(); _o->equipped.type = _e; }
{ auto _e = equipped(); if (_e) _o->equipped.value = MyGame::Sample::EquipmentUnion::UnPack(_e, equipped_type(), _resolver); }
{ auto _e = path(); if (_e) { _o->path.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->path[_i] = *_e->Get(_i); } } else { _o->path.resize(0); } }

View File

@@ -36,7 +36,7 @@ public enum MyGame_Sample_Equipment: UInt8, UnionEnum {
public struct MyGame_Sample_Vec3: NativeStruct, Verifiable, FlatbuffersInitializable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
private var _x: Float32
private var _y: Float32
@@ -72,7 +72,7 @@ public struct MyGame_Sample_Vec3: NativeStruct, Verifiable, FlatbuffersInitializ
public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Struct
@@ -88,7 +88,7 @@ public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {
public struct MyGame_Sample_Monster: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table
@@ -200,7 +200,7 @@ public struct MyGame_Sample_Monster: FlatBufferObject, Verifiable {
public struct MyGame_Sample_Weapon: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_25_1_21() }
static func validateVersion() { FlatBuffersVersion_25_1_24() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

View File

@@ -13,6 +13,8 @@
# 7. `goldens/generated_code.py`
# 8. `make -j`
# 9. Make sure the tests pass: `./flattests`
# 10. Do a search for the old version string in the code base. It should only
# appear in the changelog.
# Requires the xmlstarlet command.
# Install via: apt install xmlstarlet
@@ -113,3 +115,8 @@ grep -rl 'FLATBUFFERS_\d*' * --exclude=release.sh | xargs -i@ \
sed -i \
-e "s/\(FLATBUFFERS_\)[0-9]\{2\}.*()/\1$version_underscore()/g" \
@
echo "Updating MODULES.bazel..."
sed -i \
"3s/version = \".*\"/version = \"$version\"/" \
MODULE.bazel

View File

@@ -3309,7 +3309,7 @@ class CppGenerator : public BaseGenerator {
"static_cast<::flatbuffers::hash_value_t>(" + indexing + "));";
if (PtrType(&field) == "naked") {
code += " else ";
code += "_o->" + name + "[_i]" + access + " = nullptr";
code += "_o->" + name + "[_i]" + access + " = nullptr; ";
} else {
// code += " else ";
// code += "_o->" + name + "[_i]" + access + " = " +
@@ -3327,9 +3327,10 @@ class CppGenerator : public BaseGenerator {
code += "_o->" + name + "[_i]" + access + " = ";
code += GenUnpackVal(field.value.type.VectorType(), indexing, true,
field);
if (is_pointer) { code += "; }"; }
code += "; ";
if (is_pointer) { code += "} "; }
}
code += "; } } else { " + vector_field + ".resize(0); }";
code += "} } else { " + vector_field + ".resize(0); }";
}
break;
}

View File

@@ -850,7 +850,7 @@ class CSharpGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " FlatBufferConstants.";
code += "FLATBUFFERS_25_1_21(); ";
code += "FLATBUFFERS_25_1_24(); ";
code += "}\n";
// Generate a special accessor for the table that when used as the root

View File

@@ -701,7 +701,7 @@ class JavaGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " Constants.";
code += "FLATBUFFERS_25_1_21(); ";
code += "FLATBUFFERS_25_1_24(); ";
code += "}\n";
// Generate a special accessor for the table that when used as the root

View File

@@ -524,7 +524,7 @@ class KotlinGenerator : public BaseGenerator {
// runtime.
GenerateFunOneLine(
writer, "validateVersion", "", "",
[&]() { writer += "Constants.FLATBUFFERS_25_1_21()"; },
[&]() { writer += "Constants.FLATBUFFERS_25_1_24()"; },
options.gen_jvmstatic);
GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options);

View File

@@ -1845,7 +1845,7 @@ class SwiftGenerator : public BaseGenerator {
}
std::string ValidateFunc() {
return "static func validateVersion() { FlatBuffersVersion_25_1_21() }";
return "static func validateVersion() { FlatBuffersVersion_25_1_24() }";
}
std::string GenType(const Type &type,

View File

@@ -111,4 +111,4 @@ extension UInt64: Scalar, Verifiable {
public typealias NumericValue = UInt64
}
public func FlatBuffersVersion_25_1_21() {}
public func FlatBuffersVersion_25_1_24() {}

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
namespace v1 {

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
namespace v2 {

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 21,
FLATBUFFERS_VERSION_REVISION == 24,
"Non-compatible flatbuffers version included");
// For access to the binary schema that produced this file.
@@ -499,7 +499,7 @@ inline void RootTable::UnPackTo(RootTableT *_o, const ::flatbuffers::resolver_fu
{ auto _e = nested_root(); if (_e) { _o->nested_root.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->nested_root.begin()); } }
{ auto _e = far_struct_vector(); if (_e) { _o->far_struct_vector.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->far_struct_vector[_i] = *_e->Get(_i); } } else { _o->far_struct_vector.resize(0); } }
{ auto _e = big_struct_vector(); if (_e) { _o->big_struct_vector.resize(_e->size()); for (::flatbuffers::uoffset64_t _i = 0; _i < _e->size(); _i++) { _o->big_struct_vector[_i] = *_e->Get(_i); } } else { _o->big_struct_vector.resize(0); } }
{ auto _e = many_vectors(); if (_e) { _o->many_vectors.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->many_vectors[_i]) { _e->Get(_i)->UnPackTo(_o->many_vectors[_i].get(), _resolver); } else { _o->many_vectors[_i] = std::unique_ptr<WrapperTableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->many_vectors.resize(0); } }
{ auto _e = many_vectors(); if (_e) { _o->many_vectors.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->many_vectors[_i]) { _e->Get(_i)->UnPackTo(_o->many_vectors[_i].get(), _resolver); } else { _o->many_vectors[_i] = std::unique_ptr<WrapperTableT>(_e->Get(_i)->UnPack(_resolver)); } } } else { _o->many_vectors.resize(0); } }
{ auto _e = forced_aligned_vector(); if (_e) { _o->forced_aligned_vector.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->forced_aligned_vector.begin()); } }
}

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
]#

View File

@@ -1,7 +1,6 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("//:build_defs.bzl", "DEFAULT_FLATC_ARGS", "flatbuffer_cc_library")
load(":defs.bzl", "flatbuffers_as_external_repo_test")
package(default_visibility = ["//visibility:private"])
@@ -269,8 +268,3 @@ flatbuffer_cc_library(
name = "alignment_test_cc_fbs",
srcs = ["alignment_test.fbs"],
)
flatbuffers_as_external_repo_test(
name = "bazel_repository_test",
directory = "bazel_repository_test_dir",
)

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class LongFloatEntry extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb) { return getRootAsLongFloatEntry(_bb, new LongFloatEntry()); }
public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb, LongFloatEntry obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -44,7 +44,7 @@ class LongFloatEntry : Table() {
return (val_1 - val_2).sign
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsLongFloatEntry(_bb: ByteBuffer): LongFloatEntry = getRootAsLongFloatEntry(_bb, LongFloatEntry())
fun getRootAsLongFloatEntry(_bb: ByteBuffer, obj: LongFloatEntry): LongFloatEntry {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class LongFloatMap extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb) { return getRootAsLongFloatMap(_bb, new LongFloatMap()); }
public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb, LongFloatMap obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -58,7 +58,7 @@ class LongFloatMap : Table() {
}
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap())
fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -13,7 +13,7 @@ public struct KeywordsInTable : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -13,7 +13,7 @@ public struct Table2 : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Table2 GetRootAsTable2(ByteBuffer _bb) { return GetRootAsTable2(_bb, new Table2()); }
public static Table2 GetRootAsTable2(ByteBuffer _bb, Table2 obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
]#

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -13,7 +13,7 @@ public struct ArrayTable : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb) { return GetRootAsArrayTable(_bb, new ArrayTable()); }
public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "ARRT"); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class ArrayTable extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static ArrayTable getRootAsArrayTable(ByteBuffer _bb) { return getRootAsArrayTable(_bb, new ArrayTable()); }
public static ArrayTable getRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "ARRT"); }

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -14,7 +14,7 @@ public struct Monster : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool MonsterBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONS"); }

View File

@@ -24,7 +24,7 @@ import java.nio.ByteOrder;
*/
@SuppressWarnings("unused")
public final class Monster extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); }

View File

@@ -1002,7 +1002,7 @@ class Monster : Table() {
return compareStrings(__offset(10, o1, _bb), __offset(10, o2, _bb), _bb)
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsMonster(_bb: ByteBuffer): Monster = getRootAsMonster(_bb, Monster())
fun getRootAsMonster(_bb: ByteBuffer, obj: Monster): Monster {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -13,7 +13,7 @@ public struct Referrable : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb) { return GetRootAsReferrable(_bb, new Referrable()); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Referrable extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Referrable getRootAsReferrable(ByteBuffer _bb) { return getRootAsReferrable(_bb, new Referrable()); }
public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -48,7 +48,7 @@ class Referrable : Table() {
return (val_1 - val_2).sign
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsReferrable(_bb: ByteBuffer): Referrable = getRootAsReferrable(_bb, Referrable())
fun getRootAsReferrable(_bb: ByteBuffer, obj: Referrable): Referrable {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -13,7 +13,7 @@ public struct Stat : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_25_1_24(); }
public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
@SuppressWarnings("unused")
public final class Stat extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_21(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_25_1_24(); }
public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); }
public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -73,7 +73,7 @@ class Stat : Table() {
return (val_1 - val_2).sign
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_25_1_21()
fun validateVersion() = Constants.FLATBUFFERS_25_1_24()
fun getRootAsStat(_bb: ByteBuffer): Stat = getRootAsStat(_bb, Stat())
fun getRootAsStat(_bb: ByteBuffer, obj: Stat): Stat {
_bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by :
Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 25.1.21
flatc version: 25.1.24
Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)

Some files were not shown because too many files have changed in this diff Show More