diff --git a/src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java b/src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java index 40749d736f925d..838d95c30d66f9 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java +++ b/src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java @@ -40,10 +40,12 @@ import com.google.devtools.build.lib.util.io.AsynchronousMessageOutputStream; import com.google.devtools.build.lib.util.io.MessageOutputStream; import com.google.devtools.build.lib.vfs.DigestHashFunction; +import com.google.devtools.build.lib.vfs.Dirent; import com.google.devtools.build.lib.vfs.FileSystem; import com.google.devtools.build.lib.vfs.IORuntimeException; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; +import com.google.devtools.build.lib.vfs.Symlinks; import com.google.devtools.build.lib.vfs.XattrProvider; import com.google.errorprone.annotations.CanIgnoreReturnValue; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; @@ -101,8 +103,9 @@ private void run() throws IOException, InterruptedException { private void visitSubdirectory(Path dir) { try { - for (Path child : dir.getDirectoryEntries()) { - if (child.isDirectory()) { + for (Dirent dirent : dir.readdir(Symlinks.FOLLOW)) { + Path child = dir.getChild(dirent.getName()); + if (dirent.getType() == Dirent.Type.DIRECTORY) { execute(() -> visitSubdirectory(child)); continue; }