diff options
author | 2015-09-16 11:06:47 +0000 | |
---|---|---|
committer | 2015-09-16 15:15:48 +0000 | |
commit | c52eb9c5543f23edd8d91087e33194137e5ccca2 (patch) | |
tree | c4b7bf882ba45790a2224021b1558be2831729e0 /src/main/java/com/google/devtools/build/lib/skyframe | |
parent | 4b004af62ac37aee0b5fcac1fbba672130c559ac (diff) |
Defer Label parsing from BuildFileAST to PackageFunction so that BuildFileAST doesn't have to know about the existence of Labels.
--
MOS_MIGRATED_REVID=103181342
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java index 2de3167e86..1f8d05750a 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java @@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import com.google.devtools.build.lib.cmdline.LabelSyntaxException; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.cmdline.PackageIdentifier.RepositoryName; import com.google.devtools.build.lib.events.Event; @@ -516,7 +517,14 @@ public class PackageFunction implements SkyFunction { */ private boolean fetchIncludeRepositoryDeps(Environment env, BuildFileAST ast) { boolean ok = true; - for (Label label : ast.getIncludes()) { + for (String include : ast.getIncludes()) { + Label label; + try { + label = Label.parseAbsolute(include); + } catch (LabelSyntaxException e) { + // Ignore. This will be reported when the BUILD file is actually evaluated. + continue; + } if (!label.getPackageIdentifier().getRepository().isDefault()) { // If this is the default repository, the include refers to the same repository, whose // RepositoryValue is already a dependency of this PackageValue. |