aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/repository
diff options
context:
space:
mode:
authorGravatar nharmata <nharmata@google.com>2018-03-23 08:31:17 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-23 08:32:32 -0700
commit24e2d4dab0abb95333a1c57b70cd7f48a50195d3 (patch)
tree8de24e30b6249efbab5406a3f3079b8f7ade4ca7 /src/main/java/com/google/devtools/build/lib/rules/repository
parent8e9f4a8591d65c7972aea3957c57601570e0a39b (diff)
Fix test flakiness due to the filesystem mutations done during the 'fetch' work done by BazelPackageBuilderHelperForTesting#sanityCheckBazelPackageLoader.
We fix this flakiness by _not_ having RepositoryDelegatorFunction unconditionally 'fetch' local repos. We then have to make a change to BazelPackageLoader test to reinstate these mutations, since it was only working before due to the unconditional filesystem mutations done here :p RELNOTES: None PiperOrigin-RevId: 190222830
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/repository')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
index a4b6c9a16b..f8f1c26af2 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
@@ -145,10 +145,10 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
}
String ruleKey = computeRuleKey(rule, ruleSpecificData);
Map<String, String> markerData = new TreeMap<>();
- if (handler.isLocal(rule)) {
- // Local repositories are always fetched because the operation is generally fast and they do
- // not depend on non-local data, so it does not make much sense to try to cache from across
- // server instances.
+ if (isFetch.get() && handler.isLocal(rule)) {
+ // Local repositories are fetched regardless of the marker file because the operation is
+ // generally fast and they do not depend on non-local data, so it does not make much sense to
+ // try to cache from across server instances.
setupRepositoryRoot(repoRoot);
RepositoryDirectoryValue.Builder localRepo =
handler.fetch(rule, repoRoot, directories, env, markerData);