Repository navigation
fix(ffi): fail moq's export on the recursion depth lint - #212
Conversation
Quest-Claim: 8cd28a5919af4a1d
At the current moq pin the lint no longer fires. Deny it in the export build so a pin bump that brings it back fails instead of warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 4f2212f
No actionable bugs found. Denying this specific lint on the generated export's build is a focused guard, without raising recursion limits or changing generated ABI behavior. The export uses local path dependencies, and Nightly's existing just ffi moq step reaches this build. Keeping the analysis/census invocation unchanged avoids broadening the compiler-flag change beyond the intended gate.
Verification: static inspection of the diff, export recipe, generated dependency setup, pinned nightly, and CI invocation. No export build, reduced-recursion-limit reproduction, tests, or compiler-depth measurements run; the PR's reported results were not independently reproduced.
(Written by review (OpenAI))
Problem
#144 saw the
recursion_depth_exceeding_limitfuture-compat lint fire duringjust ffi moq, onSendchecks in moq-net, moq-tokio, and the stand-inmoq_ffi. A later nightly turns it into a hard error.Findings
Reproduced at the old pin (
c764ace): it fired in moq-net (ietf/publisher/tracks.rsasync block), moq-tokio (client.rsspawningisolate(time::run(driver)).instrument(..)), and in rust2-ffi's ownSendquery onmoq_mux::import::Containerwhile analyzing the stand-in.At the pin #196 moved to (
30f25c0), a cleanjust ffi moqemits no instance. The deepest check per crate, found by lowering each crate'srecursion_limit(default 128) until the lint fires:tokio::spawn(isolate(time::run(driver)).instrument(..)):Sendietf/publisher/tracks.rsasync block:MaybeBoxedExtmoq)rt::Object::<track::Subscriber>::borrow:Subscriber: Syncmoq_mux::import::Container: SendThe glue is not deeper than moq's own code: its deepest check is moq-net's type nesting (
Subscriber>track::Cursor>group::Consumer>resume::Recover> ...), plus about one level. Nothing here to fix in rust2-ffi.moq-tokio's own driver spawn sits one level under the limit: a small addition to moq's driver future brings the lint back. That is moq's code; see Follow-ups.
Approach
Deny the lint on the export's build in
just ffi moq, which compiles moq's crates and the glue. Verified: with moq's crates atrecursion_limit = 120, the recipe fails witherror: overflow evaluating ... Sendin moq-tokio; at the default it passes.Impact
Alternatives
Sendquery. Dropped:RUSTFLAGSthere invalidates the check cachejust ffi censusshares, rebuilding it right after in nightly CI. The glue'srt::Objectbounds repeat the sameSend/Syncchecks on every exported object, so the export build covers them.recursion_limit: not needed, nothing exceeds it.Follow-ups
dyn Future + Sendbeforeisolate/instrumentwould cut the chain. A moq-side change, not filed: decide whether to record it in moq's tree now or let this deny flag it at the next pin bump.Checks
just ffi moqat30f25c0: ok, no lint. Atc764ace: lint reproduced.just check,just test: ok.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code