fix(ec): drop comments the ECCodes generator cannot parse - #533
Merged
Conversation
The Flatpak job regenerates ECCodes.h from ECCodes.abstract rather than using the committed header, and amule-project#530's comments in that file made the generated header unparseable — "invalid preprocessing directive #=" and a truncated ECOpCodes enum, failing every Flatpak build on master. Two separate ways those comments broke it: - The generator only skips a line as a comment when it matches "^#", i.e. with no leading whitespace. The comments inside the tag section were indented to line up with the entries, so they fell through to the data path, lost their leading tab and had every word turned into a field. - It also flattens the file into a CMake list by replacing newlines with ";" (abstracts/CMakeLists.txt), so a semicolon inside a comment splits the line and the fragment after it no longer starts with "#" — which is where the mangled ECOpCodes entry came from. Documentation for these codes already lives in the hand-maintained ECCodes.h, so the fix is simply to keep the abstract to entries. Verified by generating a header from the abstract before and after: master's produces 8 mangled lines and 11 compile errors, this produces none, with all seven new codes present.
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.
The Flatpak job regenerates
ECCodes.hfromECCodes.abstractrather than using the committed header, and #530's comments in that file made the generated header unparseable —invalid preprocessing directive #=and a truncatedECOpCodesenum — failing every Flatpak build on master (run).Two separate ways those comments broke it:
^#, i.e. with no leading whitespace. The comments inside the tag section were indented to line up with the entries, so they fell through to the data path, lost their leading tab, and had every word turned into a field.;(abstracts/CMakeLists.txt), so a semicolon inside a comment splits the line and the fragment after it no longer starts with#. That's where the mangledECOpCodesentry came from.Documentation for these codes already lives in the hand-maintained
ECCodes.h, so the fix is simply to keep the abstract to entries.Verified by generating a header from the abstract before and after: master's produces 8 mangled lines and 11 compile errors, this produces none, with all seven new codes present and correct.