aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-05-23 12:33:07 +0000
committerGravatar Yue Gan <yueg@google.com>2016-05-23 13:10:26 +0000
commit074b957d4c818236dab089429c6bc041509f58d4 (patch)
treec95827221987e6f5b8e3a22fae7fe125100daafd /src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
parentfd0307a2cc7019b360f77033a7f7465e103a61af (diff)
Use setLoadingOrWorkspacePhase instead of setLoadingPhase where relevant,
commit 3fedf9e618cbce3dbdd00559b2de0bb8e2d43171 introduced the distinction between the loading phase and the workspace phase. This check broke the use of native.existing_rule(s) in skylark remote repository, added a regression test for it. Fixes #1277 -- MOS_MIGRATED_REVID=122988569
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
index 6dc557797c..f86931571c 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
@@ -1158,7 +1158,7 @@ public final class PackageFactory {
public Runtime.NoneType invoke(Map<String, Object> kwargs,
FuncallExpression ast, Environment env)
throws EvalException, InterruptedException {
- env.checkLoadingPhase(ruleClass, ast.getLocation());
+ env.checkLoadingOrWorkspacePhase(ruleClass, ast.getLocation());
try {
addRule(ruleFactory, ruleClass, getContext(env, ast), kwargs, ast, env);
} catch (RuleFactory.InvalidRuleException | Package.NameConflictException e) {