Bug Description
The build-fbs recipe and the "Verify regenerated files match committed files" workflow step have two issues that together allow orphaned/leftover generated files to accumulate undetected:
- Justfile bug:
build-fbs uses system flatc instead of the bundled flatc from vendored flatbuffers
- Workflow bug: The verification step doesn't clean before regenerating, so orphaned files survive and checksums match
Current Behavior
Problem 1: Wrong flatc binary
In justfile, build-fbs uses:
FLATC="flatc" # System flatc - version may differ!
But autobahn-python bundles (currently) flatc v25.9.23 in the vendored flatbuffers package. After install-tools runs, the bundled flatc is available at ${VENV_PATH}/bin/flatc.
Problem 2: Orphaned files not detected
The workflow does:
- Compute checksums of committed files (includes orphaned files)
- Run
just build-fbs (only adds/overwrites, never deletes)
- Compare checksums (orphaned files are in BOTH, so they match!)
This allows files from older schema versions to persist indefinitely.
Evidence
Currently, there are 2 orphaned files in src/autobahn/wamp/gen/wamp/proto/:
| Orphaned File |
Current Replacement |
Issue |
Kdf.py |
KDF.py |
Old flatc naming + different enum values |
ChannelBinding.py |
TLSChannelBinding.py |
Enum renamed in schema |
These were discovered by manually running rm -rf src/autobahn/wamp/gen && just build-fbs && git diff --stat:
src/autobahn/wamp/gen/wamp/proto/ChannelBinding.py | 8 --------
src/autobahn/wamp/gen/wamp/proto/Kdf.py | 9 ---------
2 files changed, 17 deletions(-)
Root Cause
When the FlatBuffers schema evolves (enum renamed, type removed, etc.), flatc no longer generates the old files. But since build-fbs doesn't clean first by itself, the old files remain. The checksum verification passes because it compares "before regeneration" vs "after regeneration" - both contain the orphans.
Proposed Fix
- Fix
justfile build-fbs to use bundled flatc:
# Before
FLATC="flatc"
# After
FLATC="${VENV_PATH}/bin/flatc"
- Fix workflow to clean before regenerating:
# Before
- name: Build FlatBuffers binary schema & Python wrappers
run: just build-fbs
# After
- name: Build FlatBuffers binary schema & Python wrappers
run: |
just clean-fbs
just build-fbs
Expected Outcome
After implementing these fixes:
- The workflow will fail on the next run because
clean-fbs removes orphaned files, causing checksum mismatch
- This failure (!) proves the detection mechanism works
- A follow-up commit with
just clean-fbs && just build-fbs will fix the orphaned files
- Future schema changes that remove types will be detected immediately
Todo
Checklist
Bug Description
The
build-fbsrecipe and the "Verify regenerated files match committed files" workflow step have two issues that together allow orphaned/leftover generated files to accumulate undetected:build-fbsuses systemflatcinstead of the bundledflatcfrom vendored flatbuffersCurrent Behavior
Problem 1: Wrong flatc binary
In
justfile,build-fbsuses:But autobahn-python bundles (currently) flatc v25.9.23 in the vendored flatbuffers package. After install-tools runs, the bundled flatc is available at
${VENV_PATH}/bin/flatc.Problem 2: Orphaned files not detected
The workflow does:
just build-fbs(only adds/overwrites, never deletes)This allows files from older schema versions to persist indefinitely.
Evidence
Currently, there are 2 orphaned files in
src/autobahn/wamp/gen/wamp/proto/:Kdf.pyKDF.pyChannelBinding.pyTLSChannelBinding.pyThese were discovered by manually running
rm -rf src/autobahn/wamp/gen && just build-fbs && git diff --stat:Root Cause
When the FlatBuffers schema evolves (enum renamed, type removed, etc.), flatc no longer generates the old files. But since
build-fbsdoesn't clean first by itself, the old files remain. The checksum verification passes because it compares "before regeneration" vs "after regeneration" - both contain the orphans.Proposed Fix
justfile build-fbsto use bundled flatc:Expected Outcome
After implementing these fixes:
clean-fbsremoves orphaned files, causing checksum mismatchjust clean-fbs && just build-fbswill fix the orphaned filesTodo
build-fbsinjustfileto use${VENV_PATH}/bin/flatcjust clean-fbsbeforejust build-fbsjust clean-fbs && just build-fbsand then Git commit regenerated filesChecklist