aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java
diff options
context:
space:
mode:
authorGravatar Miguel Alcon Pinto <malcon@google.com>2015-04-10 19:04:49 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-04-13 11:46:46 +0000
commitbdfdd0905e57ece41bd9f4751a3ed529511cd217 (patch)
tree8b90d4c970c737f51a7a0b5c25aab9c49ed58831 /src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java
parent4a8da557b5878db1bcf66da32f48a0f97ca37e7a (diff)
Don't take into account symlinks when computing intrabuild file modifications. While there could be bogus targets that modify symlinks, Bazel has output symlinks that point to source code.
-- MOS_MIGRATED_REVID=90827597
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java b/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java
index d1592141b2..a4524d1c25 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java
@@ -216,7 +216,8 @@ class FilesystemValueChecker {
try {
FileValue newData = ActionMetadataHandler.fileValueFromArtifact(artifact, stat, tsgm);
if (!newData.equals(lastKnownData)) {
- updateIntraBuildModifiedCounter(stat != null ? stat.getLastChangeTime() : -1);
+ updateIntraBuildModifiedCounter(stat != null ? stat.getLastChangeTime() : -1,
+ lastKnownData.isSymlink(), newData.isSymlink());
modifiedOutputFilesCounter.getAndIncrement();
dirtyKeys.add(key);
}
@@ -230,8 +231,11 @@ class FilesystemValueChecker {
};
}
- private void updateIntraBuildModifiedCounter(long time) throws IOException {
- if (lastExecutionTimeRange != null && lastExecutionTimeRange.contains(time)) {
+ private void updateIntraBuildModifiedCounter(long time, boolean oldWasSymlink,
+ boolean newIsSymlink) throws IOException {
+ if (lastExecutionTimeRange != null
+ && lastExecutionTimeRange.contains(time)
+ && !(oldWasSymlink && newIsSymlink)) {
modifiedOutputFilesIntraBuildCounter.incrementAndGet();
}
}
@@ -276,7 +280,7 @@ class FilesystemValueChecker {
if (!fileValue.equals(lastKnownData)) {
updateIntraBuildModifiedCounter(fileValue.exists()
? fileValue.realRootedPath().asPath().getLastModifiedTime()
- : -1);
+ : -1, lastKnownData.isSymlink(), fileValue.isSymlink());
modifiedOutputFilesCounter.getAndIncrement();
isDirty = true;
}