Repository navigation
ci(ffi): the moq export gates exporter merges - #788
Conversation
Quest-Claim: 2c34cd962363b39b
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed the whole PR: a C-only moq export check added to just ci's ffi module.
just ffi moq-c: exports the stand-in facade, builds it in debug as a staticlib with the Kotlin and Dart glue under the same-D recursion_depth_exceeding_limit, then links and runsffi/moq/moq.cagainst it.moq-writesplit: the export step is now a private recipe shared bymoq-exportandmoq-c.moq-export's behavior is unchanged.- Gate wiring:
sh/dispatch.sh'stest_ffirunsmoq-cbeforejust ffi test, astest_tsdoes withjust ts moq. The script runs underset -euo pipefail, so a failure stops the module. - Quest bookkeeping:
quest/m0/ffi-moq-gate.mdis closed and its only cross-reference inquest/m0/ffi-test-builds.mdis removed. That quest now also notes thatmoq-cshould take the unchanged-file skip.
I checked that the nightly Windows and macOS jobs call just ffi test and moq-cpp directly, not through dispatch. So moq-c's Unix-only cc and libmoq.a link never runs there.
claude-opus-5-5 | 𝕏

Closes the quest quest/m0/ffi-moq-gate.md.
Problem
The exporter's check on its first consumer,
just ffi moq, ran only nightly (about 13m40s), so an exporter change could merge while it broke moq's export. Thetsmodule already gates onjust ts moq.Approach
just ffi moq-c: the same stand-in facade and export asjust ffi moq, built in debug as a staticlib only (cargo rustc --crate-type staticlib, which skips the cdylib link) with the Kotlin and Dart glue, under the same-D recursion_depth_exceeding_limitthe nightly denies. It then compiles, links, and runsffi/moq/moq.cagainst it.sh/dispatch.sh'stest_ffiruns it beforejust ffi test, astest_tsrunsjust ts moq.moq-writerecipe, which bothmoq-exportandmoq-cuse.ffi/moq/moq.*, the Python glue, and the release build stay nightly.Departure from the quest's plan: the plan recommended compiling the header and
moq.cwithout linking. I link and run, because a compile-only step misses breaks the gate should catch. Measured below: a renamed glue symbol passescargo checkandcc -fsyntax-onlybut fails the link. On a warm cache that costs about 10s of link plus the debug build.Gate cost
Measured on nixos, the queue runner's host, which also runs CI and other agents. Wall times are noisy; CPU (user+sys) is beside them.
just ffi check+just ffi test, warmjust ffi moq-c, warm, export unchangedjust ffi moq-c, warm, repeated at high loadjust ffi moq-c, cold target, mbx store warm (the runner after a pin bump)just ffi moq-c, true cold (no mbx hit): debug build of moq's tree ~62-72s / ~270-290s CPU, plus export and linkStep breakdown, warm: export 17-25s wall / 12-16s CPU, glue rebuild 7-44s wall / 5-43s CPU (incremental, depending on how much the export changed), link 10-16s wall / 10-15s CPU, run 0.1s. So the warm gate's ffi module grows by roughly 35-75s wall (+25-50%) and 25-65s CPU. The nightly Gate job (17 min today, 60-min timeout) gains the cold figure.
A cheaper variant,
cargo checkof the glue pluscc -fsyntax-onlyonmoq.c(export 17s + 0.7s + 0.1s warm), would save the link and the debug codegen, about 10-40s, but it misses link and runtime breaks (see Validation).Validation
just ffi moq-cat main's moq pinffcb7cdprintsok.just cipasses before and after merging main (kixel-ai/rust2#736); its ffi module ranmoq-c.moq_buf_freedformoq_buf_free:moq-cfails at link,undefined reference to 'moq_buf_free'.cargo checkandcc -fsyntax-onlyboth pass this._eqreturns the negation:moq-cfails at run time,moq/moq.c:310,:421,:545.Impact
just ffi moq-c, documented inffi/README.md's Tests.quest/m0/ffi-test-builds.mdnotes thatmoq-cshould take its unchanged-file skip: the export rewrites the glue each run, which forces the rebuild above.Alternatives
Follow-ups
None.
Caused by
No single PR: the nightly-only check is as old as
just ffi moq.Models
Size: M
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 707145f
Base: origin/main at a7db266
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1d7bd-4259-75b2-945c-a5de5d22bafd, round 1Score: 9/10,
No actionable defects were found; the new C-only gate preserves the existing export path, but builds and tests were not run, as instructed.Findings: none
Summary by CodeRabbit