Skip to content

flatbuffers: Add opt-in buffer identification mechanism#174

Draft
OliverHeilwagen wants to merge 1 commit intoeclipse-score:mainfrom
etas-contrib:flatbuffers_common_buffer_identification
Draft

flatbuffers: Add opt-in buffer identification mechanism#174
OliverHeilwagen wants to merge 1 commit intoeclipse-score:mainfrom
etas-contrib:flatbuffers_common_buffer_identification

Conversation

@OliverHeilwagen
Copy link
Copy Markdown
Contributor

@OliverHeilwagen OliverHeilwagen commented May 5, 2026

resolves #128

Todo:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

The created documentation from the pull request is available at: docu-html

doc = "Injects major/minor version fields into a JSON file for use with serialize_versioned_buffer.",
)

def serialize_versioned_buffer(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@OliverHeilwagen OliverHeilwagen changed the title flatbuffers: Add starlark rules for versioned buffer serialization flatbuffers: Add opt-in buffer identification mechanism May 5, 2026
@OliverHeilwagen OliverHeilwagen force-pushed the flatbuffers_common_buffer_identification branch from 69ee405 to 14332c1 Compare May 5, 2026 16:03
@OliverHeilwagen OliverHeilwagen temporarily deployed to workflow-approval May 5, 2026 16:03 — with GitHub Actions Inactive
@OliverHeilwagen OliverHeilwagen temporarily deployed to workflow-approval May 5, 2026 16:03 — with GitHub Actions Inactive
@OliverHeilwagen OliverHeilwagen self-assigned this May 6, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Define common mechanism for opt-in buffer identification

1 participant