diff options
author | Janak Ramakrishnan <janakr@google.com> | 2017-01-30 23:35:24 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2017-01-31 09:00:07 +0000 |
commit | b18f95e60330ad4f9510af822949d150c7912a2c (patch) | |
tree | c404bc53a789cfb8f8c44e2a772d9bad628e4616 /src/main/java | |
parent | b97d27f8cf61736d7af23d678514761457f6d014 (diff) |
Don't short-circuit runfiles creation in tests if the output MANIFEST file is a symlink. That may indicate that it points to the input manifest, and so comparing the manifests in this case would be useless.
--
PiperOrigin-RevId: 146048132
MOS_MIGRATED_REVID=146048132
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java index d353302b7e..a0f371c631 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java @@ -395,12 +395,15 @@ public abstract class TestStrategy implements TestActionContext { Executor executor = actionExecutionContext.getExecutor(); TestTargetExecutionSettings execSettings = testAction.getExecutionSettings(); + Path outputManifest = runfilesDir.getRelative("MANIFEST"); try { // Avoid rebuilding the runfiles directory if the manifest in it matches the input manifest, - // implying the symlinks exist and are already up to date. - if (Arrays.equals( - runfilesDir.getRelative("MANIFEST").getDigest(), - execSettings.getInputManifest().getPath().getDigest())) { + // implying the symlinks exist and are already up to date. If the output manifest is a + // symbolic link, it is likely a symbolic link to the input manifest, so we cannot trust it as + // an up-to-date check. + if (!outputManifest.isSymbolicLink() + && Arrays.equals( + outputManifest.getDigest(), execSettings.getInputManifest().getPath().getDigest())) { return; } } catch (IOException e1) { |