diff options
author | Lukacs Berki <lberki@google.com> | 2016-08-30 14:02:37 +0000 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2016-08-31 08:10:36 +0000 |
commit | 3d65eb97d2244e8709b338beef3807edefa57ff5 (patch) | |
tree | c5acd0218dd8320d28ca7933aadc1e4c37bf29f3 /src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java | |
parent | 44ba39b77a0f20cc6a763ebdc328dfeb4fe82f34 (diff) |
Do not load the transitive closure of the Android SDK on every build.
This makes the sanity check dependent on the configuration fragments returning proper roots, but it's not that bad because it already depends on them returning the proper set of implicit labels and #getImplicitLabels() will go away soon anyway.
--
MOS_MIGRATED_REVID=131705535
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java index 62bee585b6..075811797b 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java @@ -79,7 +79,7 @@ public final class ConfigurationFragmentFunction implements SkyFunction { if (env.valuesMissing()) { return null; } - sanityCheck(fragment, buildOptions, packageProvider); + sanityCheck(fragment, packageProvider); if (env.valuesMissing()) { return null; } @@ -101,7 +101,6 @@ public final class ConfigurationFragmentFunction implements SkyFunction { */ private static void sanityCheck( Fragment fragment, - BuildOptions buildOptions, PackageProviderForConfigurations packageProvider) throws InvalidConfigurationException, InterruptedException { if (fragment == null) { @@ -114,14 +113,13 @@ public final class ConfigurationFragmentFunction implements SkyFunction { // Sanity check that the implicit labels are all in the transitive closure of explicit ones. // This also registers all targets in the cache entry and validates them on subsequent requests. Set<Label> reachableLabels = new HashSet<>(); - for (Map.Entry<String, Label> entry : buildOptions.getAllLabels().entries()) { - Label label = entry.getValue(); + for (Label root : fragment.getSanityCheckRoots()) { try { - collectAllTransitiveLabels(packageProvider, reachableLabels, label); + collectAllTransitiveLabels(packageProvider, reachableLabels, root); } catch (NoSuchThingException e) { packageProvider.getEventHandler().handle(Event.error(e.getMessage())); throw new InvalidConfigurationException( - String.format("Failed to load required %s target: '%s'", entry.getKey(), label)); + String.format("Failed to load transitive closure of '%s': %s", root, e.getMessage())); } } if (packageProvider.valuesMissing()) { |