Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vergen-git2 incorrectly emits rerun-if-changed=.git/ #374

Closed
gpanders opened this issue Sep 10, 2024 · 0 comments · Fixed by #375
Closed

vergen-git2 incorrectly emits rerun-if-changed=.git/ #374

gpanders opened this issue Sep 10, 2024 · 0 comments · Fixed by #375

Comments

@gpanders
Copy link
Contributor

vergen is emitting cargo:rerun-if-changed=.git/ which is causing our build script to be executed whenever any file under the .git directory changes. This is causing excessive rebuilds.

According to the docs, vergen should be emitting rerun-if-changed=.git/HEAD and rerun-if-changed=.git/<ref>, where <ref> is the name of the ref that HEAD resolves to. In my case, instead of .git/<ref> I see only .git/.

This appears to be due to this line in add_rerun_if_changed

cargo_rerun_if_changed.push(format!("{}", ref_path.display()));

This should instead be path.display(): ref_path points to the .git directory itself.

gpanders added a commit to gpanders/vergen that referenced this issue Sep 10, 2024
gpanders added a commit to gpanders/vergen that referenced this issue Sep 12, 2024
CraZySacX pushed a commit to gpanders/vergen that referenced this issue Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant