chore: few changes to speed up local compilation
What does this MR do and why?
A few things were quietly making local builds slower than they needed to be. This MR attempts to fix them.
Build scripts were re-running on every invocation
Cargo has a rule: if a build script emits no cargo:rerun-if-changed directives, it re-runs unconditionally on every build. Three of our build.rs files (gitaly-client, siphon-proto, gkg-server) do their real work behind #[cfg(feature = "regenerate-protos")], so in a normal build the main() is empty — no directives emitted, unconditional re-run.
fn main() {
println!("cargo:rerun-if-changed=build.rs"); // added
#[cfg(feature = "regenerate-protos")]
regenerate_protos();
}
Now Cargo only re-runs the build script when build.rs itself changes.
Two test commands instead of one
test stays as-is (full debug symbols, good for debugging failures). test:fast strips debug info and skips dsymutil — useful when you just want to know if tests pass and don't need a debugger.
# full debug, for when you need to actually dig into a failure
mise run test
# no debug info, faster links — for the green/red loop
mise run test:fast
The flags go inline via CARGO_PROFILE_TEST_* env vars, so no changes to Cargo.toml. Other profile settings (incremental, codegen-units, debug-assertions) inherit from the dev profile as normal.
diff:branch task
Generates a diff against any origin branch and writes it to git_diff_full.txt. Useful for pasting into an AI context window.
mise run diff:branch # diffs against origin/main
mise run diff:branch develop # diffs against origin/develop
Files in .gitdiffignore are excluded from the diff (currently Cargo.lock and package-lock.json). Add to that file to exclude more.
Related Issues
Testing
All existing tests pass.
Performance Analysis
- This merge request does not introduce any performance regression. If a performance regression is expected, explain why.