fix: stabilize CXX API generator on MacOS, make parser indempotent for nested enums#57536
Open
artus9033 wants to merge 3 commits into
Open
fix: stabilize CXX API generator on MacOS, make parser indempotent for nested enums#57536artus9033 wants to merge 3 commits into
artus9033 wants to merge 3 commits into
Conversation
cipolleschi
requested changes
Jul 14, 2026
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing the parser. I left a comment on one of the changes.
Comment on lines
+472
to
+473
| "ConcreteComponentDescriptor" in typedef_definition | ||
| or "ConcreteViewShadowNode" in typedef_definition |
Contributor
There was a problem hiding this comment.
I'm not a fan of this ad hoc handling.. Is this actually happening for only these two cases? OR can we generalize the behavior somehow.
Contributor
Author
There was a problem hiding this comment.
I only reproduced an edge case for these 2 cases. I've tried finding a broader approach pattern and it unfortunately modifies existing contents to use using where there used to be typedef. At least, I couldn't find a broader approach / other cases breaking the parser.
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.
Summary:
Fixes C++ API snapshot generation failures for nested enums and macOS/Linux output drift due to platform-dependent behavior, in the CXX API generator.
Problems
Duplicate enums: Doxygen parses codegen
EventEmitters.htwice (direct codegen input + again via.mmincludes). The parser raisedRuntimeError: Identifier OnOrientationChangeOrientation already exists in scope ModalHostViewEventEmitteronReactApple*views.Inconsistent behaviour on MacOS vs Linux:
ConcreteComponentDescriptor,ConcreteViewShadowNode), macOS Doxygen emits hybrid XML definitions (typedef Type Name = Type) while Linux CI emitsusing Name = Type. The parser keyed offdefinition.startswith("typedef"), so identical source produced different.apioutput per platform.CASE_SENSE_NAMES = SYSTEMfollows the host OS default (case-insensitive on macOS, case-sensitive on Linux), causing inconsistent symbol resolution.Resolution
.doxygen.config.templatefiles: setCASE_SENSE_NAMES = YESfor deterministic name matching across macOS and Linux.snapshot.py:create_enum()returns an existing enum scope instead of raising when the enum is already registered.builders.py:create_enum_scope()to skip enums that already exist;get_typedef_member()to normalize Doxygen’stypedef ... = ...form tousingso the output format is unified.Changelog:
[INTERNAL] [FIXED] - Fix C++ API snapshot generation crash on duplicate codegen enums
[INTERNAL] [FIXED] - Fix platform-dependent inconsistent CXX API generator output
Test Plan:
yarn cxx-api-buildcompletes on macOS (tested locally)yarn cxx-api-validatepasses (tested locally on MacOS & on the Linux CI)validate-cxx-api-snapshotspasses on Linux (tested on CI)