Improve slightly the error message for files not found.
Before:
Unable to load file '//test:b.bzl': file doesn't exist or isn't a file
After:
Unable to load file '//test:b.bzl': file doesn't exist
#6004
RELNOTES: None.
PiperOrigin-RevId: 217512790
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupValue.java
index e42ba4e..7f38607 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupValue.java
@@ -101,9 +101,14 @@
String.format("Unable to load package for '%s': %s", fileLabel, reason));
}
+ static ASTFileLookupValue forMissingFile(Label fileLabel) {
+ return new ASTLookupNoFile(
+ String.format("Unable to load file '%s': file doesn't exist", fileLabel));
+ }
+
static ASTFileLookupValue forBadFile(Label fileLabel) {
return new ASTLookupNoFile(
- String.format("Unable to load file '%s': file doesn't exist or isn't a file", fileLabel));
+ String.format("Unable to load file '%s': it isn't a regular file", fileLabel));
}
public static ASTFileLookupValue withFile(BuildFileAST ast) {