diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2017-09-06 14:05:26 +0200 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2017-09-07 09:56:39 +0200 |
commit | 1673b5ab20f79d010340383f8df21d2968c46888 (patch) | |
tree | ab8be66e39e4605d375239b791451fb7a4a50b1a /src/main/java/com/google/devtools/build | |
parent | 8328dc9e3b0d473756ec94508744afefe4d8eaf2 (diff) |
Returns repository does not exists when referring to a bind rule...
...or any other non repository rule.
Using a bind rule as the name of the repository was returning
a strange error "could not find handler for bind rule" which was
not useful, so was replaced by a crash.
Fixes #3664
Change-Id: Id0711470e6a1ab9267e05eb273900b18d0a27d6b
PiperOrigin-RevId: 167706825
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java | 6 |
1 files changed, 3 insertions, 3 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 a14800870d..6f6573e0f1 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 @@ -27,7 +27,6 @@ import com.google.devtools.build.lib.skyframe.FileValue; import com.google.devtools.build.lib.skyframe.PrecomputedValue; import com.google.devtools.build.lib.skyframe.PrecomputedValue.Precomputed; import com.google.devtools.build.lib.skyframe.SkyFunctions; -import com.google.devtools.build.lib.syntax.EvalException; import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; @@ -122,6 +121,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction { if (rule == null) { return null; } + RepositoryFunction handler; if (rule.getRuleClassObject().isSkylark()) { handler = skylarkHandler; @@ -129,8 +129,8 @@ public final class RepositoryDelegatorFunction implements SkyFunction { handler = handlers.get(rule.getRuleClass()); } if (handler == null) { - throw new IllegalStateException( - new EvalException(rule.getLocation(), "Could not find handler for " + rule)); + // If we refer to a non repository rule then the repository does not exist. + return RepositoryDirectoryValue.NO_SUCH_REPOSITORY_VALUE; } handler.setClientEnvironment(clientEnvironment); |