built
built copied to clipboard
Automatically rebuild if Cargo.toml or git changes
Of all the things that are recorded by built, Cargo.toml and git can change without triggering a rebuild the next time cargo build
is run. If those options are enabled, built should emit cargo:rerun-if-changed=<file>
for the Cargo.toml and any files in .git. That way cargo can automatically determine if the build.sh script needs to rerun or not.
I ran into this issue trying to do a manual release (we're working on CI) of an internal project and had to manually change the build.rs file to get cargo to rerun built and get a new git hash.
Thanks for the report.
That would mean we had to scan the git-root for all the files and cause cargo to fingerprint them?!
Or just HEAD and whatever contains the tags. I'll try to get a pull request together for this.