Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Jan 2, 2026

Right now the clippy and verify-ffi steps in pre-commit are forced to rebuild all dependencies every time you switch between running tests or CLI and running pre-commit because of different configurations, which makes running clippy and verify-ffi quite slow. Having separate target dirs prevents those rebuilds by keeping the caches for the different build configurations alive.

Summary by CodeRabbit

  • Chores
    • Optimized build artifact management for internal development and verification processes by configuring dedicated target directories for build tools.

✏️ Tip: You can customize this high-level summary in your review settings.

Right now the clippy and verify-ffi steps in pre-commit are forced to rebuild all dependencies every time you switch between running tests or CLI and running pre-commit because of different configurations, which makes running clippy and verify-ffi quite slow. Having separate target dirs prevents those rebuilds by keeping the caches for the different build configurations alive.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

📝 Walkthrough

Walkthrough

Two Python build utility scripts are updated to redirect cargo build artifacts into dedicated target directories: contrib/run_clippy.py uses target/clippy and contrib/verify_ffi.py uses target/verify-ffi. The additions are isolated flag changes with no modifications to control flow or error handling.

Changes

Cohort / File(s) Summary
Build artifact isolation
contrib/run_clippy.py, contrib/verify_ffi.py
Added --target-dir argument to cargo invocations (target/clippy and target/verify-ffi respectively) to segregate build outputs from default locations

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A clippy hops to target/clippy fast,
While FFI verifies in its own cast,
No tangled artifacts, no messy sprawl—
Just tidy directories, organized and small! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: adding separate target directories for pre-commit tools (clippy and verify-ffi) to avoid redundant rebuilds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b012f7a and f2cff74.

📒 Files selected for processing (2)
  • contrib/run_clippy.py
  • contrib/verify_ffi.py
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Run `cargo build` after implementing new FFI functions to regenerate the C header automatically
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Run 'cargo fmt --check' to verify formatting, 'cargo clippy --all-targets --all-features -- -D warnings' for linting, and 'cargo check --all-features' to verify all features compile
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Run `cargo build` after implementing new FFI functions to regenerate the C header automatically

Applied to files:

  • contrib/verify_ffi.py
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Run 'cargo fmt --check' to verify formatting, 'cargo clippy --all-targets --all-features -- -D warnings' for linting, and 'cargo check --all-features' to verify all features compile

Applied to files:

  • contrib/verify_ffi.py
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/*.rs : Run `cargo clippy --workspace --all-targets -- -D warnings` for linting; avoid warnings in CI

Applied to files:

  • contrib/run_clippy.py
📚 Learning: 2025-12-30T22:00:57.000Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-30T22:00:57.000Z
Learning: Applies to **/*.rs : Run clippy with all features and all targets, treating warnings as errors

Applied to files:

  • contrib/run_clippy.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: Pre-commit (ubuntu-latest)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: SPV Components Tests
  • GitHub Check: Core Components Tests
🔇 Additional comments (2)
contrib/verify_ffi.py (1)

16-17: LGTM! Isolated target directory maintains separate build cache.

The --target-dir "target/verify-ffi" flag correctly isolates FFI verification build artifacts, complementing the clippy changes and achieving the PR's objective of avoiding cross-configuration rebuilds.

contrib/run_clippy.py (1)

12-12: LGTM! Separate target directory correctly isolates clippy artifacts.

The addition of --target-dir "target/clippy" prevents clippy's build cache from interfering with regular builds. The directory is properly covered by .gitignore (the target pattern on line 1 excludes all target subdirectories).


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@xdustinface xdustinface merged commit 35630ef into v0.42-dev Jan 2, 2026
25 checks passed
@xdustinface xdustinface deleted the chore/pre-commit-target-dirs branch January 2, 2026 15:21
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.

3 participants