Skip to content

fix(codegen): declare the record argument parser the C collection runtime calls - #2167

Queued
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
fix/codegen-parse-rec-declaration
Queued

devin-ai-integration[bot] wants to merge 1 commit into
developfrom
fix/codegen-parse-rec-declaration

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

tests/codegen (TestCompiledCalcsAgreeWithInterpreter, TestCompiledStepBudgetMatchesInterpreter) started failing on ubuntu-latest = ubuntu-26.04 with cc failed … Rec::InSeq.c:2628: implicit declaration of function 'sysml_parse_rec'. Root cause: cRecSeqRuntime instantiates the collection template over records, whose sysml_parse_seq_rec calls sysml_parse_rec, and nothing ever emitted that function — older gcc only warned, gcc 15 (C23 defaults) refuses. The emitter now declares it, as sysml_parse_fn already is for function values (a record cannot be given as a command-line argument, so it reports and exits 2).

So this cannot come back on any compiler, codegen.CFlags carries -Werror=implicit-function-declaration -Werror=int-conversion (gcc 15's defaults, accepted by every gcc and clang), and TestCRecordSequencesBuildUnderStrictDeclarations compiles a calc holding a record sequence (HoldsMany, added to the record model) under CFlags; it fails on develop with the gcc-15 message and passes here.

Follow-up to the ubuntu-24.04 pin (#2165): with this the generated C builds on 26.04 as well.

How it was verified

  • go test -count=1 ./internal/translate/codegen ./tests/codegen green under the new CFlags (tests/codegen 292 s); the new test fails with the fix reverted (implicit declaration of function 'sysml_parse_rec').
  • go build ./..., go vet, gofmt -l . clean; python3 scripts/changelog.py check.

Checklist

  • make test and make lint pass locally (the codegen packages above; CI runs the rest)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (none covers the C runtime's parsers)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (none moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/a8e2a2c0d31143598a07d32facbf02fa
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/a8e2a2c0d31143598a07d32facbf02fa?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings

Devin Review

…time calls

cRecSeqRuntime instantiated the sequence template over records, whose parse_seq calls sysml_parse_rec, which nothing emitted; gcc 15 makes the implicit declaration an error. CFlags now carries -Werror=implicit-function-declaration and -Werror=int-conversion so every compiler reports such an omission, and a test builds a record-sequence calc under them.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration
devin-ai-integration Bot added this pull request to the merge queue Nov 12, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant