Skip to content

Commit

Permalink
remote: fix unexpected IO error (not a directory)
Browse files Browse the repository at this point in the history
    Closes #7174.

    PiperOrigin-RevId: 229914032
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent 1125941 commit 3e17589
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public static Iterable<String> toExecPaths(Iterable<? extends ActionInput> artif
}

/** Returns the {@link Path} for an {@link ActionInput}. */
public static Path toInputPath(ActionInput input, Path execRoot) {
public static Path toPath(ActionInput input, Path execRoot) {
Preconditions.checkNotNull(input, "input");
Preconditions.checkNotNull(execRoot, "execRoot");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public FileArtifactValue getMetadata(ActionInput input) throws IOException {
.get(
input.getExecPathString(),
() -> {
Path path = ActionInputHelper.toInputPath(input, execRoot);
Path path = ActionInputHelper.toPath(input, execRoot);
try {
FileArtifactValue metadata = FileArtifactValue.create(path);
if (metadata.getType().isDirectory()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private TreeNode buildParentNode(
Preconditions.checkArgument(
inputsStart == inputsEnd - 1, "Encountered two inputs with the same path.");
ActionInput input = inputs.get(inputsStart);
Path leafPath = ActionInputHelper.toInputPath(input, execRoot);
Path leafPath = ActionInputHelper.toPath(input, execRoot);
if (!(input instanceof VirtualActionInput) && uploadSymlinks) {
FileStatus stat = leafPath.stat(Symlinks.NOFOLLOW);
if (stat.isSymbolicLink()) {
Expand Down Expand Up @@ -405,7 +405,7 @@ private synchronized Directory getOrComputeDirectory(TreeNode node) throws IOExc
if (uploadSymlinks) {
// We need to stat the input to check whether it is a symlink.
// getInputMetadata only gives target metadata.
Path inputPath = ActionInputHelper.toInputPath(input, execRoot);
Path inputPath = ActionInputHelper.toPath(input, execRoot);
FileStatus stat = inputPath.stat(Symlinks.NOFOLLOW);
if (stat.isSymbolicLink()) {
PathFragment target = inputPath.readSymbolicLink();
Expand Down

0 comments on commit 3e17589

Please sign in to comment.