flatbuffers: Add opt-in buffer identification mechanism#174
Open
OliverHeilwagen wants to merge 4 commits into
Open
flatbuffers: Add opt-in buffer identification mechanism#174OliverHeilwagen wants to merge 4 commits into
OliverHeilwagen wants to merge 4 commits into
Conversation
|
The created documentation from the pull request is available at: docu-html |
OliverHeilwagen
commented
May 5, 2026
69ee405 to
14332c1
Compare
14332c1 to
44269a7
Compare
44269a7 to
f68dbf7
Compare
f68dbf7 to
d51fc10
Compare
OliverHeilwagen
commented
Jun 3, 2026
OliverHeilwagen
commented
Jun 3, 2026
paulquiring
reviewed
Jun 10, 2026
paulquiring
reviewed
Jun 10, 2026
paulquiring
reviewed
Jun 10, 2026
paulquiring
reviewed
Jun 10, 2026
paulquiring
reviewed
Jun 10, 2026
paulquiring
reviewed
Jun 10, 2026
OliverHeilwagen
commented
Jun 18, 2026
Member
|
@OliverHeilwagen, can you please update the branch in you fork to the latest baselibs main? |
f403a19 to
15b6cbb
Compare
paulquiring
approved these changes
Jun 19, 2026
OliverHeilwagen
commented
Jun 24, 2026
| ## Configure the python toolchain | ||
|
|
||
| bazel_dep(name = "rules_python", version = "1.8.3", dev_dependency = True) | ||
| bazel_dep(name = "rules_python", version = "1.8.3") |
Contributor
Author
There was a problem hiding this comment.
@4og
This was found by the black-box testing.
It is necessary for the inject_buffer_version (py_binary) which will only be build for the host environment.
The alternative to just export the python file and expect a python installation on the host, is from my point of view not valid.
Atm i don't have concerns with switching rules_python to non dev, it should behave like the other rules_*.
The consuming module is allowed to override the toolchain (python use_extension).
002c65b to
402d91b
Compare
402d91b to
c11756d
Compare
Introduces major/minor version injection into FlatBuffer binary configuration files at build time, enabling universal buffer identification at runtime. - New serialize_versioned_buffer and serialize_multiple_versioned_buffers Bazel macros that patch version fields into JSON before flatc serialization - New inject_buffer_version.py script and Bazel rule that injects major/minor version into a JSON data file as a build action - Added BufferVersion schema under score/flatbuffers/common as shared include for versioned schemas - Added BufferVersionEnvelope schema under score/flatbuffers/common used internally to implement GetBufferVersion and VerifyBufferVersion without hardcoded vtable offsets - Extended existing serialize_buffer, serialize_multiple_buffers, generate_cpp and generate_json_schema rules with an includes attribute to support schema include dependencies - Added Starlark rule tests covering single/multiple versioned buffers and fault injection cases (out-of-range versions, wrong version_info placement)
Introduces IVersionReader and VersionReader to read and verify version metadata from FlatBuffer binaries at runtime using the universal buffer identification convention established by the BufferVersionEnvelope schema. - New BufferVersionInfo value type holding a 4-char file identifier plus major_version and minor_version fields extracted from a conforming buffer - New IVersionReader interface with GetVersion and VerifyVersion methods, supporting kExact and kMinorMinimum match modes - New VersionReader concrete implementation backed by FlatBuffers Verifier for structural integrity checking before field access - New ErrorCode error domain covering kNullDataPointer, kVerificationFailed, kVersionInfoNotPresent, and kVersionMismatch failure cases - Updated buffer_version.fbs and buffer_version_envelope.fbs schemas to align with the new convention and added type_marker to enable misplacement check - Added integration tests covering nominal reads, exact/minimum version matching, out-of-range versions, wrong-field placement, and null inputs - Added unit tests for BufferVersionInfo, I/VersionReader, ErrorCode, idl_parser
Add example for versioned configuration and extend generate_cpp documentation. - Add flatbuffers config example demo_config_versioned, which showcases usage of a configuration with version information. - Rename base configuration example to demo_config. - Extend generate_cpp documentation to explain how included schemas are handled during the code generation. - Extend library flatbufferutils by buffer_version_generated_bare to enable access to common buffer_version_generated.h used for common version identification.
Introduces major/minor version injection into FlatBuffer binary configuration files at build time, enabling universal buffer identification at runtime. - Move score/flatbuffers/examples to examples/integration/flatbuffers - Change rules_python to a normal dependency
c11756d to
2a9bf95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #128