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

Delete .git directory from git_repository external repositories when using strip_prefix #18271

Closed

Conversation

cameron-martin
Copy link
Contributor

Leaving the .git directory in an external repository makes the rule not reproducible since this directory contains timestamps of when the fetch occurred. When strip_prefix is not specified, this directory is correctly cleaned up but not when strip_prefix is specified, since the .git directory lives in .tmp_git_root.

Note that we cannot delete the whole .tmp_git_root directory, since the items in the root are symlinks to here.

Fixes #18152.

…using strip_prefix

Leaving the `.git` directory in an external repository makes the rule not reproducible, since this directory contains timestamps of when the fetch occurred. When strip_prefix is not specified, this directory is correctly cleaned up but not when strip_prefix is specified, since the `.git` directory lives in `.tmp_git_root`.

Note that we cannot delete the whole `.tmp_git_root` directory, since the items in the root are symlinks to here.

Fixes bazelbuild#18152.
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Apr 29, 2023
cameron-martin added a commit to cameron-martin/rules_rust that referenced this pull request Apr 29, 2023
This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.
cameron-martin added a commit to cameron-martin/rules_rust that referenced this pull request May 1, 2023
This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.
@sgowroji sgowroji added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label May 2, 2023
@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels May 2, 2023
@copybara-service copybara-service bot closed this in 2977ba6 May 3, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label May 3, 2023
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
…using strip_prefix

Leaving the `.git` directory in an external repository makes the rule not reproducible since this directory contains timestamps of when the fetch occurred. When strip_prefix is not specified, this directory is correctly cleaned up but not when strip_prefix is specified, since the `.git` directory lives in `.tmp_git_root`.

Note that we cannot delete the whole `.tmp_git_root` directory, since the items in the root are symlinks to here.

Fixes bazelbuild#18152.

Closes bazelbuild#18271.

PiperOrigin-RevId: 528962539
Change-Id: I03b0ee6e6b5464af2d28eb6dc05fb6e6f33afaa3
cameron-martin added a commit to cameron-martin/rules_rust that referenced this pull request Jun 22, 2023
This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.
UebelAndre pushed a commit to bazelbuild/rules_rust that referenced this pull request Jun 23, 2023
* Exclude .tmp_git_root from globs

This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes #1927.

* Regenerate vendored crates
freeformstu pushed a commit to freeformstu/rules_rust that referenced this pull request Jun 24, 2023
* Exclude .tmp_git_root from globs

This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.

* Regenerate vendored crates
Silcet pushed a commit to Silcet/rules_rust that referenced this pull request Jul 10, 2023
* Exclude .tmp_git_root from globs

This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.

* Regenerate vendored crates
Silcet pushed a commit to Silcet/rules_rust that referenced this pull request Jul 10, 2023
* Exclude .tmp_git_root from globs

This directory contains the original git repo when the crate is from git. Including this directory currently makes these rules re-run whenever the repository rule re-runs, although this is fixed by bazelbuild/bazel#18271. Even after this fix, excluding this directory avoids depending on unnecessary files.

Fixes bazelbuild#1927.

* Regenerate vendored crates
@cameron-martin cameron-martin deleted the clean-up-git-repos branch February 1, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git_repository is not reproducible
3 participants