aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2017-01-05 20:35:54 +0000
committerGravatar John Cater <jcater@google.com>2017-01-05 21:11:06 +0000
commitc9d1abd32d0cbc76d4dcbb958896cc2b2d690ef5 (patch)
tree27768f9f16b9ec484c0338bad4c7e00e4396929a /src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
parentb64349e91debe8abb8a218c6e8888dc9b42fdea3 (diff)
Provide Skylark imports, even if the package has some errors.
Since we evaluate the BUILD file despite errors (e.g. parse errors), we should provide the .bzl dependencies to the BUILD file. This change removes some confusing/irrelevant error messages. -- PiperOrigin-RevId: 143696291 MOS_MIGRATED_REVID=143696291
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java38
1 files changed, 7 insertions, 31 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 4573a511e9..4514c8fd6b 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
@@ -581,32 +581,6 @@ public class PackageFunction implements SkyFunction {
return buildFileValue;
}
- @Nullable
- private SkylarkImportResult discoverSkylarkImports(
- Path buildFilePath,
- PackageIdentifier packageId,
- AstAfterPreprocessing astAfterPreprocessing,
- Environment env)
- throws PackageFunctionException, InterruptedException {
- SkylarkImportResult importResult;
- if (astAfterPreprocessing.containsAstParsingErrors) {
- importResult =
- new SkylarkImportResult(
- ImmutableMap.<String, Extension>of(),
- ImmutableList.<Label>of());
- } else {
- importResult =
- fetchImportsFromBuildFile(
- buildFilePath,
- packageId,
- astAfterPreprocessing.ast,
- env,
- skylarkImportLookupFunctionForInlining);
- }
-
- return importResult;
- }
-
/**
* Fetch the skylark loads for this BUILD file. If any of them haven't been computed yet,
* returns null.
@@ -1210,11 +1184,13 @@ public class PackageFunction implements SkyFunction {
Set<SkyKey> globDepsRequestedDuringPreprocessing = astCacheEntry.globDepKeys;
SkylarkImportResult importResult;
try {
- importResult = discoverSkylarkImports(
- buildFilePath,
- packageId,
- astAfterPreprocessing,
- env);
+ importResult =
+ fetchImportsFromBuildFile(
+ buildFilePath,
+ packageId,
+ astAfterPreprocessing.ast,
+ env,
+ skylarkImportLookupFunctionForInlining);
} catch (PackageFunctionException | InterruptedException e) {
astCache.invalidate(packageId);
throw e;