aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-12-15 13:48:29 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-15 13:49:50 -0800
commit931d285e6002197af1fda0d910de07148b617c98 (patch)
tree635ecfb58381918ac77b7e90ddd027f62f5bd3e0 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
parent39ff208b0e6ee18f4d684db458e8599f60e08dd4 (diff)
Optionally allow loaded packages to not be tracked.
If we are running with a single source root and not going to set up the execroot (since we know how to resolve all packages), we can avoid tracking loaded packages, since they're only used to set up the execroot. PiperOrigin-RevId: 179234932
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index b23f49f909..96fbd0b5e2 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -415,11 +415,15 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
new BuildViewProvider(),
ruleClassProvider,
cpuBoundSemaphore,
- removeActionsAfterEvaluation));
+ removeActionsAfterEvaluation,
+ shouldStoreTransitivePackagesInLoadingAndAnalysis()));
map.put(
SkyFunctions.ASPECT,
new AspectFunction(
- new BuildViewProvider(), ruleClassProvider, removeActionsAfterEvaluation));
+ new BuildViewProvider(),
+ ruleClassProvider,
+ removeActionsAfterEvaluation,
+ shouldStoreTransitivePackagesInLoadingAndAnalysis()));
map.put(SkyFunctions.LOAD_SKYLARK_ASPECT, new ToplevelSkylarkAspectFunction());
map.put(SkyFunctions.POST_CONFIGURED_TARGET,
new PostConfiguredTargetFunction(new BuildViewProvider(), ruleClassProvider));
@@ -703,11 +707,22 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
return true;
}
+ /**
+ * If not null, this is the only source root in the build, corresponding to the single element in
+ * a single-element package path. Such a single-source-root build need not plant the execroot
+ * symlink forest, and can trivially resolve source artifacts from exec paths. As a consequence,
+ * builds where this is not null do not need to track a package -> source root map, and so do not
+ * need to track all loaded packages.
+ */
@Nullable
protected Path getForcedSingleSourceRootIfNoExecrootSymlinkCreation() {
return null;
}
+ private boolean shouldStoreTransitivePackagesInLoadingAndAnalysis() {
+ return getForcedSingleSourceRootIfNoExecrootSymlinkCreation() == null;
+ }
+
@VisibleForTesting
protected abstract Injectable injectable();