Skip to content

Conversation

@thejtshow
Copy link
Contributor

@thejtshow thejtshow commented Aug 8, 2025

Hello!

I was working on my wireshark dissector generator PR #8576 and noticed that a validation function was not being ran -- looking through the history, it seems that in commit 641fbe4 the validation logic was moved to a function, but that function wasn't ever set to be called. This fixes this up and re-adds this dead function back into production.

Thanks,

Justin

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Aug 8, 2025
@thejtshow
Copy link
Contributor Author

hey @aardappel could I get a quick LGTM? :D

@thejtshow
Copy link
Contributor Author

the change to the CMakeLists.txt is a duplicate of #8580 -- Happy to let that one go in and remove from this one.

@aardappel
Copy link
Collaborator

Indeed I merged #8580 first, since its nice to recognize their change.

@aardappel
Copy link
Collaborator

Looks like this changes generated code which will need to be added to the PR.

@thejtshow thejtshow force-pushed the fix/validate_options branch from e211c2f to 608cef1 Compare August 12, 2025 21:13
@thejtshow thejtshow force-pushed the fix/validate_options branch from 608cef1 to dc8799d Compare August 12, 2025 21:14
@thejtshow
Copy link
Contributor Author

I am mildly confused how a one liner in the cpp changes generated code.. I have rebased on the tip of master with my single commit.

@thejtshow
Copy link
Contributor Author

error:
  cannot generate code directly from .proto files

Traceback (most recent call last):
  File "D:\a\flatbuffers\flatbuffers\scripts\generate_code.py", line 194, in <module>

looks like some of the validation logic is no longer true/valid anymore..? I can probably try to spend some time hunting this down but will take me a bit as it will delve into parts of the code I'm not yet familiar with.

@thejtshow
Copy link
Contributor Author

alright, I just removed the --proto validation check from ValidateOptions, and got the following when I manually generate the code:

python3 scripts/generate_code.py  --flatc ./build/flatc 
Fields in struct ProtoMessage have gap between ids
Fields in struct OtherMessage have gap between ids
When you use --proto, that you should check for conformity yourself, using the existing --conform
warning:
  /<...>/flatbuffers/tests/rust_namer_test.fbs:26: 8: warning: field names should be lowercase snake_case, got: Message

@aardappel
Copy link
Collaborator

Yes, I guess these problems were apparently not checked for.
I wouldn't delete the error though.. maybe turning it into a warning for now is better, given that what it checks for is still valid.

@thejtshow thejtshow force-pushed the fix/validate_options branch from 928f447 to 21f55e2 Compare August 12, 2025 21:53
@thejtshow
Copy link
Contributor Author

changed error to warn and simplified the nesting a bit

@thejtshow thejtshow changed the title Fix: Actuall call ValidateOptions Fix: Actually call ValidateOptions Aug 12, 2025
@aardappel
Copy link
Collaborator

Ok, looks good now, thanks!

@aardappel aardappel merged commit 5218e29 into google:master Aug 12, 2025
49 of 51 checks passed
@thejtshow thejtshow deleted the fix/validate_options branch August 13, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants