fix(hash_cache): only take user execute bits into account#96
Merged
sitaktif merged 1 commit intobazel-contrib:mainfrom Dec 4, 2024
Merged
fix(hash_cache): only take user execute bits into account#96sitaktif merged 1 commit intobazel-contrib:mainfrom
sitaktif merged 1 commit intobazel-contrib:mainfrom
Conversation
There are some cases where files are initially created with some permissions (e.g. 775) but are then created by git with different permissions (e.g. 755) when cloning, checking out a branch or creating a worktree. Such differences don't matter to git nor to Bazel; consequently, they should not change the hash of a source file in target-determinator. The execution bit for ther user (e.g. 744 vs 644) does matter, though, and should be part of the hash.
050b2d7 to
699e68e
Compare
gibfahn
approved these changes
Dec 1, 2024
illicitonion
approved these changes
Dec 4, 2024
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
This seems generally reasonable, and remember hitting this bug one time before! Thanks for fixing!
Closed
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.
There are some cases where files are initially created with some permissions (e.g. 775) but are then created by git with different permissions (e.g. 755) when cloning, checking out a branch or creating a worktree. Such differences don't matter to git nor to Bazel; consequently, they should not change the hash of a source file in target-determinator.
The execute bit for ther user (e.g. 744 vs 644) does matter, though, and should be part of the hash.
--
This fixes an issue where TD would spuriously mark targets as changed when they depend on a file that has e.g. 664 permission, and the umask is 022 (the default), when TD uses a git subtree to hash the
beforestate.