flatbuffers: Add opt-in buffer identification mechanism#174
Draft
OliverHeilwagen wants to merge 1 commit intoeclipse-score:mainfrom
Draft
flatbuffers: Add opt-in buffer identification mechanism#174OliverHeilwagen wants to merge 1 commit intoeclipse-score:mainfrom
OliverHeilwagen wants to merge 1 commit intoeclipse-score:mainfrom
Conversation
|
The created documentation from the pull request is available at: docu-html |
OliverHeilwagen
commented
May 5, 2026
| doc = "Injects major/minor version fields into a JSON file for use with serialize_versioned_buffer.", | ||
| ) | ||
|
|
||
| def serialize_versioned_buffer( |
Contributor
Author
There was a problem hiding this comment.
@4og @paulquiring
I introduced the following rules separately so we can have the major/minor version as mandatory rule parameter:
- serialize_versioned_buffer
- serialize_multiple_versioned_buffer
I am not so happy with the longer name but kept it for now to avoid breaking changes.
Since we are still early with the flatbuffers rollout we could do a breaking change of the rule name and have the following ones that should remain stable:
- serialize_buffer
- serialize_buffers (breaking former: serialize_multiple_buffers)
- serialize_versioned_buffer
- serialize_versioned_buffers
The buffer version have dedicated data and output parameters.
The buffers version have data_dict parameter (dictionary key: json data, value: output name).
Please let me know if you have any preferences.
69ee405 to
14332c1
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)
14332c1 to
44269a7
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
Todo: