aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2015-10-08 18:43:31 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-10-09 14:40:09 +0000
commit46f95c927cc22c61f9a082604faa69d86c7d4af0 (patch)
tree080ea1ff42d98289212ec3793a9bb1434a04cf65
parentab0b0c50dca4f0251b4513159f14ff67ebc71f5d (diff)
Remove useless explicit 'stat' call on the BUILD file in directories encountered during legacy globbing (note that we end up doing this stat anyway in the 'locator.getBuildFileForPackage' call). The old motivation for this is obsolete; we have incremental correctness from Skyframe.
-- MOS_MIGRATED_REVID=104982764
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/GlobCache.java20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java b/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java
index 460e20b08d..e62446ad0a 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java
@@ -25,7 +25,6 @@ import com.google.devtools.build.lib.cmdline.PackageIdentifier;
import com.google.devtools.build.lib.concurrent.ThreadSafety;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.vfs.Path;
-import com.google.devtools.build.lib.vfs.Symlinks;
import com.google.devtools.build.lib.vfs.UnixGlob;
import java.io.IOException;
@@ -114,28 +113,9 @@ public class GlobCache {
if (directory.equals(packageDirectory)) {
return true;
}
-
PackageIdentifier subPackageId = PackageIdentifier.create(
packageId.getRepository(),
packageId.getPackageFragment().getRelative(directory.relativeTo(packageDirectory)));
- UnixGlob.FilesystemCalls syscalls = GlobCache.this.syscalls.get();
- if (syscalls != UnixGlob.DEFAULT_SYSCALLS) {
- // This is needed because in case the BUILD file exists, we do not call readdir() on its
- // directory. However, the package needs to be re-evaluated if the BUILD file is removed.
- // Therefore, we add this BUILD file to our dependencies by statting it through the
- // recording syscall object so that the BUILD file itself is added to the dependencies of
- // this package.
- //
- // The stat() call issued by locator.getBuildFileForPackage() does not quite cut it
- // because 1. it is cached so there may not be a stat() call at all and 2. even if there
- // is, it does not go through the proxy in GlobCache.this.syscalls.
- //
- // Note that this does not cause any significant slowdown; the BUILD file cache will have
- // already evaluated the very same stat, so we don't pay any I/O cost, only a cache
- // lookup.
- syscalls.statNullable(directory.getChild("BUILD"), Symlinks.FOLLOW);
- }
-
return locator.getBuildFileForPackage(subPackageId) == null;
}
};