diff options
author | Janak Ramakrishnan <janakr@google.com> | 2016-10-11 22:06:40 +0000 |
---|---|---|
committer | Yue Gan <yueg@google.com> | 2016-10-12 08:56:52 +0000 |
commit | 79eb4094537d369b22ac72cab4f08a3c1a5f650e (patch) | |
tree | 3f5e5a73cd2661a82b5bb0cfaa35fd723c4f8baf /src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java | |
parent | a629005a0f7b5c702067b2f47e048f11700a5092 (diff) |
When requesting all transitive traversal values recursively, request packages/targets in parallel with subdirectories.
The previous implementation was vulnerable to incomplete traversal in case of cycles: if a subdirectory had a cycle, the targets in the package would never be requested. Requesting the package first would create a different problem, where the subdirectories would never be requested if the package depended on a cycle.
Also stop uniquifying Skylark import cycles when inlining. While uniquification is nice, this was leading to us emitting an error during queries that we weren't actually emitting when not inlining. Putting the cycle into the exception error message should be enough information, and since we emit an error per exception anyway, the number of events will still be lower (although each event might be more verbose).
--
MOS_MIGRATED_REVID=135846847
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java index 8e641325cb..fb68cb2fe6 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java @@ -168,10 +168,7 @@ public class SkylarkImportLookupFunction implements SkyFunction { ImmutableList<Label> cycle = CycleUtils.splitIntoPathAndChain(Predicates.equalTo(fileLabel), alreadyVisited.keySet()) .second; - if (env.getValue(SkylarkImportUniqueCycleFunction.key(cycle)) == null) { - return null; - } - throw new SkylarkImportFailedException("Skylark import cycle"); + throw new SkylarkImportFailedException("Skylark import cycle: " + cycle); } alreadyVisited.put(fileLabel, null); skylarkImportMap = Maps.newHashMapWithExpectedSize(imports.size()); |