Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand home path in
fs.PathExists
(#3270)
* Expand home path in `fs.PathExists` A build rule like this ```python genrule( name = name, secrets = ["~/test.yaml"], ) ``` fails building with this error ``` failed to calculate hash: Attempting to record rule hash: cannot calculate hash for ~/test.yaml: file does not exist ``` The hash functions use `os.Lstat` to check for file existence, and `lstat(2)` does not seem to expand the home path itself. So this PR calls the `ExpandHomePath` before `os.Lstat` in the functions which check file presence. I've tested it by bootstrapping `please` on this branch and building the rule that initially failed. * Expand path at call site --------- Co-authored-by: Cezar El-Nazli <[email protected]>
- Loading branch information