aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2016-02-09 16:31:06 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-02-10 10:22:30 +0000
commit3e34a11b59549fb80a9e9ff7923ce4ac7b141f20 (patch)
tree6423642bc2828fdde8939faaa4618bdb84ff0e19 /src/main/java/com/google/devtools/build/lib/skyframe
parentbf3dc4c33dcd0113437036490b618e41387f1a5b (diff)
Properly report loading errors during configuration creation.
This only applies to interleaved loading and analysis - the production code is fine. Add tests for the RedirectChaser, the fdoOptimize code path, the XcodeConfig, and the Jvm loader. Unfortunately, the configuration factory we internally create by default contains a mock Jvm loader implementation. Since that is one Yak too many right now, I'm adding a temporary method to the AnalysisMock. I added the tests to BuildViewTest for now; technically, they ought to go into the language-specific test cases, but that would require more refactoring as those don't currently run with interleaved loading and analysis. -- MOS_MIGRATED_REVID=114221476
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ConfigurationFragmentFunction.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java9
2 files changed, 13 insertions, 2 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 ac541411cd..0242f3a79c 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
@@ -24,6 +24,7 @@ import com.google.devtools.build.lib.analysis.config.InvalidConfigurationExcepti
import com.google.devtools.build.lib.analysis.config.PackageProviderForConfigurations;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
+import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.packages.NoSuchPackageException;
import com.google.devtools.build.lib.packages.NoSuchTargetException;
import com.google.devtools.build.lib.packages.Package;
@@ -106,6 +107,11 @@ public class ConfigurationFragmentFunction implements SkyFunction {
}
@Override
+ public EventHandler getEventHandler() {
+ return packageProvider.getEventHandler();
+ }
+
+ @Override
public Target getTarget(Label label) throws NoSuchPackageException, NoSuchTargetException {
return packageProvider.getTarget(label);
}
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java
index 05dc2b3332..604ef07b0c 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java
@@ -21,6 +21,7 @@ import com.google.devtools.build.lib.analysis.config.PackageProviderForConfigura
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
+import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.packages.NoSuchPackageException;
import com.google.devtools.build.lib.packages.NoSuchTargetException;
import com.google.devtools.build.lib.packages.Package;
@@ -49,6 +50,11 @@ class SkyframePackageLoaderWithValueEnvironment implements PackageProviderForCon
this.ruleClassProvider = ruleClassProvider;
}
+ @Override
+ public EventHandler getEventHandler() {
+ return env.getListener();
+ }
+
private Package getPackage(final PackageIdentifier pkgIdentifier)
throws NoSuchPackageException {
SkyKey key = PackageValue.key(pkgIdentifier);
@@ -60,8 +66,7 @@ class SkyframePackageLoaderWithValueEnvironment implements PackageProviderForCon
}
@Override
- public Target getTarget(Label label) throws NoSuchPackageException,
- NoSuchTargetException {
+ public Target getTarget(Label label) throws NoSuchPackageException, NoSuchTargetException {
Package pkg = getPackage(label.getPackageIdentifier());
return pkg == null ? null : pkg.getTarget(label.getName());
}