Skip to content

ci: the merge gate compiles the C fixtures against the generated header - #9146

Queued
kixelated wants to merge 3 commits into
mainfrom
quest/m0/ci/c-fixtures-gate
Queued

kixelated wants to merge 3 commits into
mainfrom
quest/m0/ci/c-fixtures-gate

Conversation

@kixelated

@kixelated kixelated commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The merge gate now compiles libmoq's C fixtures (rs/libmoq/c-tests/*.c) and the C doc samples against the generated moq.h whenever the Rust selection includes libmoq. A PR that changes a libmoq C signature therefore fails the gate if a fixture still uses the old shape, instead of the break first turning up in Nightly.

  • sh/rs/c-tests.sh --syntax: runs cargo check -p libmoq (build.rs writes the header, so there is no codegen and no staticlib), asks cargo where the header landed, then runs the doc-sample checks it already had and cc -fsyntax-only -Werror=implicit-function-declaration on each fixture. It skips the link, the run, and the CMake probes.
  • sh/rs/select.sh: the lint action runs just rs c-tests --syntax when libmoq is selected. That covers libmoq itself, any crate libmoq depends on, and ALL. It also adds sh/rs/c-tests.sh, doc/lib/c/, and doc/lib/samples.sh as libmoq seeds.
  • sh/dispatch.sh: the rs module's scope adds doc/lib/c/ and doc/lib/samples.sh, and its tools add cc. Under CI_STRICT, a missing compiler now errors up front instead of failing partway through.
  • rs/justfile: c-tests passes its arguments through.
  • Deletes quest/m0/ci/c-fixtures-gate.md.

test/smoke/clients/c/subscribe.c stays out of this, as the quest planned: it builds against the published package on purpose. The full link-and-run just rs c-tests still runs in Nightly and in OBS.

Decisions

These were taken without the maintainer, and a review can undo any of them:

  • I put the check in the rs module's lint phase, keyed on the crate selection. A separate dispatch module scoped to rs/libmoq/ was the other option. Keying on the selection also catches a change in a dependency that alters the generated header, and it reuses the target directory the lint's cargo doc has already warmed.
  • I added the doc samples to the gate as well, because --syntax already compiles them against the same header, so they come for free.
  • I added cc to the rs module's required tools. A Rust build already needs a C linker, so local runs lose nothing in practice.

Validation

  • bash sh/rs/c-tests.sh --syntax on this branch passes. On a warm cache it takes about 1s of CPU (Finished ... in 0.32s, plus the compiler).
  • I reverted abort-unwanted.c:211 to the 3-argument moq_consume_catalog call from the 11-17 Nightly break. The script then fails with error: too few arguments to function 'moq_consume_catalog'; expected 4, have 3.
  • I ran just rs lint-changed on a diff of sh/rs/c-tests.sh. It selected libmoq, ran the libmoq lint, and ended with the new syntax check, all passing.
  • just check passed on this branch. It ran every module (54 passed, none skipped) because sh/dispatch.sh changed, and the workspace lint ran the new syntax check.
  • python3 sh/rs/select.test.py passes (26 tests). The new test_gate_compiles_c_callers_against_libmoq checks which paths trigger the check, that it runs once and only in lint, and that an unrelated crate (moq-auth) does not trigger it.

Gate cost: about a second when libmoq is selected (cargo check -p libmoq reuses the lint's build, then 5 -fsyntax-only compiles). Nothing changes when libmoq isn't selected.

Impact

Public API: none. Wire: none.

Caused by

Follow-ups

None.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, medium effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with medium)

Review

Rewritten by quest review after each round.

  • Head: 9f560d1

  • Base: origin/main at a245f60

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1f157-f222-7192-97f7-684ffdd44b5d, round 1

  • Score: 9/10, The syntax-only check integrates into change selection and preserves the full fixture runner, with no actionable defects found by source inspection; builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 3 commits November 18, 2026 17:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is selected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The merge gate compiles the C fixtures against the generated header ci: the merge gate compiles the C fixtures against the generated header Nov 19, 2026
@kixelated
kixelated marked this pull request as ready for review November 19, 2026 01:16
@kixelated
kixelated enabled auto-merge November 19, 2026 01:17

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: Sound. The check is tied to the crate selection rather than to a separate path-scoped module. So a dependency change that reshapes the cbindgen header also triggers it, and the full link-and-run path stays in Nightly.

Reviewed changes

I reviewed all 3 commits. That covers the new --syntax mode, where it hooks into the gate, and the scope and test updates.

  • sh/rs/c-tests.sh --syntax: Runs cargo check instead of cargo build --features openh264, so it never builds the staticlib. It finds the header through the build-script-executed out_dir, which cargo check also reports. It reuses the doc-sample checks, then runs -fsyntax-only on each fixture and exits before the link, run, and CMake probes.
  • sh/rs/select.sh: Only the lint action runs it, and only when libmoq is selected. The new seeds map sh/rs/c-tests.sh, doc/lib/c/*, and doc/lib/samples.sh to libmoq. The Windows and macOS platform action doesn't reach this branch, so no non-Unix cc is involved.
  • sh/dispatch.sh: The rs scope picks up the C doc inputs, and the tools list adds cc, so CI_STRICT fails up front when no compiler is installed.
  • rs/justfile: c-tests now passes its arguments through via [positional-arguments].
  • sh/rs/select.test.py: The existing send-depth test now leaves out the new call, since moq-net, kio, and Cargo.lock now select libmoq. The new test checks the trigger paths, that the check runs only in lint, and that moq-auth doesn't trigger it.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 19, 2026
Any commits made after this event will not be merged.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The C test script now supports a syntax-only mode that checks C documentation samples and fixture sources against the generated header. The existing build, link, and execution path remains available without that option. Rust lint selection now includes relevant libmoq C inputs and invokes the syntax-only check. Selection tests cover the new routing behavior. The document describing a proposed C-fixture merge gate was removed.

Merge Risk: Minimal · up to 9f560

This change adds a fast syntax-only C compatibility check to lint when libmoq is selected. The full link-and-run check stays in Nightly and OBS. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the merge gate now compiles the libmoq C fixtures against the generated header. The raw summary confirms a new --syntax mode in sh/rs/c-tests.sh, wired into the rs lin…
Description check Passed The description is detailed and directly matches the changeset. It covers the new --syntax mode in sh/rs/c-tests.sh, the select.sh lint hook, the dispatch.sh scope and cc tool addition, the justfile a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the merge gate now compiles the libmoq C fixtures against the generated header. The raw summary confirms a new --syntax mode in sh/rs/c-tests.sh, wired into the rs lint selection. The title is specific and accurate, though 'ci:' prefix plus 71 characters is acceptable.

Full details: Description check

Explanation

The description is detailed and directly matches the changeset. It covers the new --syntax mode in sh/rs/c-tests.sh, the select.sh lint hook, the dispatch.sh scope and cc tool addition, the justfile argument forwarding, and the deletion of quest/m0/ci/c-fixtures-gate.md. It also gives validation steps and rationale.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bcbd050-7577-4696-b01b-336256877bdc
Commits

Reviewing files that changed from the base of the PR and between a245f60 and 9f560d1.

Files selected for processing: 6

  • quest/m0/ci/c-fixtures-gate.md
  • rs/justfile
  • sh/dispatch.sh
  • sh/rs/c-tests.sh
  • sh/rs/select.sh
  • sh/rs/select.test.py
Files with no reviewable changes: 1

  • quest/m0/ci/c-fixtures-gate.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

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