fix: avoid rebuilding snarkOS binary every single time#3613
fix: avoid rebuilding snarkOS binary every single time#3613vicsn merged 1 commit intoProvableHQ:stagingfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the unnecessary "cargo:rerun-if-changed=." directive from build.rs to avoid rebuilding the snarkOS binary every time, thereby improving build performance.
- Removed the "cargo:rerun-if-changed=." line, eliminating needless rebuild triggers.
- Streamlined the build script to rely on Cargo's default change detection for code changes.
|
I think this should be merged, as it would speed up the development process noticeably. That function in the build script does not actually change any source file and should not cause a recompile. However, Also, with the fix, does a second run of |
Motivation
When you issue
cargo runor evencargo testwith no code changes at all,cargowould still re-build the snarkOS binary (and this can take a long time) on every single invocation. The cause for this iscargo:rerun-if-changed=., this line is not needed at all, andcargowill still notice when the code changes and rebuild as needed. With this line removed, you will no longer have a rebuild on every run. Thecargo:rerun-if-changed=directive should only be used on extra things, like json schema's or generated code.Test Plan
manually tested (and only build.rs changes)