Skip to content

Commit 35630ef

Browse files
authored
chore: use separate target dirs for pre-commit (#330)
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.
1 parent 1e70b08 commit 35630ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

contrib/run_clippy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"--workspace",
1010
"--all-features",
1111
"--all-targets",
12+
"--target-dir", "target/clippy",
1213
]
1314

1415
# Exclude dash-fuzz on Windows (honggfuzz doesn't support Windows)

contrib/verify_ffi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def build_ffi_crates(repo_root: Path) -> bool:
1313
"""Build all FFI crates to regenerate headers."""
1414
print(" Building FFI crates...")
1515
result = subprocess.run(
16-
["cargo", "build", "--quiet"] + [f"-p={crate}" for crate in FFI_CRATES],
16+
["cargo", "build", "--quiet", "--target-dir", "target/verify-ffi"]
17+
+ [f"-p={crate}" for crate in FFI_CRATES],
1718
cwd=repo_root,
1819
capture_output=True,
1920
text=True

0 commit comments

Comments
 (0)