fix(shared): remove glob from rerun condition in build.rs#393
Merged
0xB10C merged 1 commit intopeer-observer:masterfrom Mar 27, 2026
Merged
Conversation
Collaborator
TIL! Thanks for looking into this! I had noticed this, but didn't dive deeper. |
Collaborator
|
Tested this! Reduced the re-build time when re-building the whole project from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The build command for crates that depend on the local
sharedcrate always triggered the build ofshared, even if nothing was modified. The issue came from the usage ofrerun_if_changed, which was given the../protobuf/*path. It doesn't support globs, and it treated*like a file name. And, when a path is not found, cargo just triggers the build every time.This also improves the runtime of github workflows.
This is very easy to test:
cargo buildtwice in a row, on a crate that depends onshared.protobuf/(exampleprotobuf/README.md), and runcargo buildagainsharedgets recompiledBefore:
After:
Documentation reference: https://docs.rs/cargo-build/latest/cargo_build/fn.rerun_if_changed.html