aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
diff options
context:
space:
mode:
authorGravatar kchodorow <kchodorow@google.com>2017-08-03 15:56:50 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-08-03 17:32:14 +0200
commit00e31fb39002257a1803d9650480273f42239403 (patch)
tree33eddfd276aa0c6093e491ec8754f9bea5260af9 /src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
parent0abf5fa2d64c76def5a8fa0f960b73ce0566af4d (diff)
Use the rule location when a handler isn't found
I think this code predates being able to load Skylark .bzl files from the WORKSPACE. As most non-trivial projects are using load() in the WORKSPACE, it's fairly uninformative to say "it was defined in the WORKSPACE file" for this error. This is to help debug the Tensorflow issue (#3478) but should generally be more useful than the current message. PiperOrigin-RevId: 164118176
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java5
1 files changed, 1 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 c7725a40e2..c64c44c647 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
@@ -19,7 +19,6 @@ import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.events.Event;
-import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.RuleFormatter;
import com.google.devtools.build.lib.rules.ExternalPackageUtil;
@@ -131,9 +130,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
}
if (handler == null) {
throw new RepositoryFunctionException(
- new EvalException(
- Location.fromFile(directories.getWorkspace().getRelative("WORKSPACE")),
- "Could not find handler for " + rule),
+ new EvalException(rule.getLocation(), "Could not find handler for " + rule),
Transience.PERSISTENT);
}