Repository navigation
perf(xtask): build ripr once and invoke the binary directly in fixtures and dogfood (#2110) - #2176
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Summary by CodeRabbit
WalkthroughThe xtask workflow builds the ChangesBinary execution workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)xtask/src/main.rsast-grep timed out on this file Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a596c4e78e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- ripr_fixture_binary hardcodes target/debug and ignores CARGO_TARGET_DIR. Fix direction: use the existing ripr_debug_binary() helper (which already honors CARGO_TARGET_DIR per AGENTS.md L288-L290) before making the path absolute, then validate with
CARGO_TARGET_DIR=/tmp/ripr-target cargo xtask fixtures boundary_gap. - ripr_fixture_binary hard-codes target/debug and ignores CARGO_TARGET_DIR. Routed-rust CI sets CARGO_TARGET_DIR (workflows/routed-rust.yml:120) and runs cargo xtask fixtures (line 192); a stale or non-default target dir will either trigger the lazy rebuild under the wrong path or serve a stale default-target binary. Smallest fix: route the helper through the existing target-dir resolution used elsewhere in xtask before std::path::absolute.
- ripr_fixture_binary() hardcodes target/debug and ignores CARGO_TARGET_DIR, so routed-rust CI (which sets CARGO_TARGET_DIR) will see a missing binary even after the lazy fallback build. Reuse the existing ripr_debug_binary() CARGO_TARGET_DIR logic before absolutizing the path.
- ripr_fixture_binary must honor CARGO_TARGET_DIR (use existing ripr_debug_binary() helper) before absolutizing; otherwise the per-invocation build in fixtures_impl/dogfood_impl also writes to the wrong target and fixtures fail on self-hosted runners. Reopen codex P1.
Confirmed findings
- ripr_fixture_binary hardcodes target/debug and ignores CARGO_TARGET_DIR, breaking fixtures in routed-rust CI which sets CARGO_TARGET_DIR.
- CARGO_TARGET_DIR mismatch: routed-rust.yml sets CARGO_TARGET_DIR but ripr_fixture_binary() hardcodes target/debug/ripr. Reopened P1 from prior thread.
- artifact-verifier failed with exit code Some(2) on a source-ub diff — receipt should be re-run or explained; for tests-red-green the substantive artifact-verifier concerns are out of scope but the failure should be acknowledged in the gate.
- fixtures_impl, dogfood_impl, and ripr_fixture_binary each invoke
cargo build -p riprindependently. For the smallest complete fix, funnel all three through the new helper so target-dir resolution, EXE_SUFFIX, and lazy rebuild live in exactly one place; today the lazy path duplicates the eager-path build command.
Verification questions
- Confirm no test asserts the new direct-binary path differs from prior
cargo run -p ripr; only end-to-end exit-0 of cargo xtask fixtures/dogfood goldens and cargo test -p xtask reported. - Confirm prior thread already raised the CARGO_TARGET_DIR concern; current diff does not reopen it — diff adds ripr_fixture_binary without target-dir awareness, so concern is live, not resolved.
- Confirm fixtures_impl and dogfood_impl each invoke cargo build -p ripr unconditionally before the lazy per-scenario fallback; redundant double-build when scenarios also trigger fallback path.
Verification questions
Refuted
[review body truncated; see review artifacts]
[review body truncated; see review artifacts]
…es and dogfood (#2110) Every fixture and dogfood scenario paid a cargo run spawn plus link check. fixtures_impl and dogfood_impl now build the debug binary once per invocation and run_fixture_check invokes the worktree-absolute binary directly (EXE_SUFFIX-aware; the lazy path builds only when it is missing, so a stale binary is never served after a source change).
Review (P1): the routed CI jobs set CARGO_TARGET_DIR, so cargo build writes the binary there — a hardcoded target/debug path would resolve a missing or stale binary. The path now comes from CARGO_TARGET_DIR with target as the default, verified by running fixtures with CARGO_TARGET_DIR pointed at a fresh directory.
5fa9785 to
b47abee
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@xtask/src/main.rs`:
- Around line 81482-81483: Remove the duplicate #[test] attribute from the
affected test declaration, leaving exactly one #[test] attribute so the test
remains registered without triggering duplicate macro attribute warnings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 87b533d2-6085-4ceb-aa7c-18e49f76dc82
📒 Files selected for processing (1)
xtask/src/main.rs
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
EffortlessMetrics/ripr(auto-detected)EffortlessMetrics/perl-lsp(auto-detected)EffortlessMetrics/unsafe-review(auto-detected)EffortlessMetrics/ub-review(auto-detected)
) Review round: the fixture binary helper duplicated target-dir logic that ripr_debug_binary() already owns, and the conflict-resolution edit left a duplicated #[test] attribute. ripr_fixture_binary now reuses ripr_debug_binary (factored with a pure ripr_debug_binary_in so the target-dir behavior is testable without unsafe env mutation), and the duplicate attribute is removed.
…3097) (#3109) * fix(xtask): route eval-sweep through the shared ripr binary resolver (#3097) eval-sweep resolved the ripr binary with a private hardcoded target/debug path and its own build helper, so under a custom CARGO_TARGET_DIR it looked for a binary cargo never wrote there. Production delta: eval_sweep obtains the binary only through ripr_fixture_binary(), inheriting CARGO_TARGET_DIR handling (#2176) and the memoized unconditional build (#3054). The private ripr_binary_path() and build_ripr() are deleted, and the resolution stays behind the will_run short-circuit so a manifest with no runnable checkouts remains build-free. Sweep semantics, manifest format, and recorded measures are unchanged. Evidence: new binary_resolution_honors_cargo_target_dir test pins the delegated resolver contract against the pure target-dir parameter; verified behaviorally with CARGO_TARGET_DIR pointed at a scratch dir, where the sweep built, resolved, and spawned the scratch binary. * fix(xtask): share the --repo selection and pin the resolver delegation seam (#3097) Review repair on the #3109 candidate: - will_run now iterates selected_repos, the same --repo-filtered iterator the run loop consumes, so a checkout belonging to an excluded repo can no longer trigger a build by itself (coderabbit). - The resolver delegation is extracted into sweep_binary_in, a seam the tests drive with a probe resolver: a runnable sweep resolves through it, a checkout-less sweep never touches it, and a build failure propagates. This replaces the previous test, which pinned only the shared resolver's CARGO_TARGET_DIR behavior and could not catch eval_sweep re-growing a private path helper (codex, coderabbit). cargo test -p xtask (1568), clippy -D warnings, fmt, precommit green. --------- Co-authored-by: Test <test@example.com>
* fix(xtask): find the dogfood packet-index binary under CARGO_TARGET_DIR The report-packet-index dogfood family built ripr with `cargo build` and then looked for it at a hardcoded `target/debug/ripr`. With CARGO_TARGET_DIR set, cargo writes the binary elsewhere, so every one of the seven cases failed with "build reported success but target/debug/ripr is absent" and 60 follow-on group/count errors. Route the lookup through the existing `ripr_debug_binary()` helper, which already honors CARGO_TARGET_DIR (#2176) and is pinned by `ripr_debug_binary_honors_cargo_target_dir`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(xtask): resolve the built ripr under CARGO_TARGET_DIR in evidence-promotion and eval-sweep Review follow-up on the dogfood fix: my census of hardcoded `target/debug/ripr` lookups was cut short by a `head`, so two more runners that `cargo build -p ripr` and then look for the binary at a fixed path were missed. evidence_promotion's pinned-external runner and eval_sweep's `ripr_binary_path` now use `ripr_debug_binary()` too. The remaining `target` joins in xtask are cwd-relative report directories, the release packager's `target/<triple>/release` copy, and a test-only worktree resolver. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Implements #2110 option 2: every fixture and dogfood scenario paid a
cargo run -p riprspawn plus link check (~20 dogfood scenarios + the full fixture suite per run).fixtures_implanddogfood_implbuild the debug binary once per invocation (cargo build -p ripr— incremental, cheap when fresh).run_fixture_checkinvokes the worktree-absolute binary directly (EXE_SUFFIX-aware for Windows). The absolute path avoids the stale-../-binary trap; the lazy fallback builds only when the binary is missing, so a stale binary is never served after a source change.Option 1 (a batch
check-all-fixturesCLI surface) and option 3 (parallelism) remain available on top; this removes the per-scenario cargo/link cost with the smallest change.Closes #2110
Validation
cargo xtask fixtures— exit 0cargo xtask goldens check— exit 0cargo xtask dogfood— exit 0cargo test -p xtask— 1211 passcargo clippy -p xtask --all-targets -- -D warnings— cleancargo xtask precommit— exit 0