Rename Skylark to Starlark in user-visible strings
https://blog.bazel.build/2018/08/17/starlark.html
RELNOTES: None.
PiperOrigin-RevId: 218669928
diff --git a/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationGenerator.java b/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationGenerator.java
index 9b09c83..f348325 100644
--- a/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationGenerator.java
+++ b/src/main/java/com/google/devtools/build/docgen/SkylarkDocumentationGenerator.java
@@ -40,7 +40,7 @@
public static void main(String[] args) {
if (checkArgs(args)) {
- System.out.println("Generating Skylark documentation...");
+ System.out.println("Generating Starlark documentation...");
try {
SkylarkDocumentationProcessor.generateDocumentation(
args[0],
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
index ad07a2d..8cab69d 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
@@ -123,14 +123,13 @@
public List<String> toolchainResolutionOverrides;
@Option(
- name = "toolchain_resolution_debug",
- defaultValue = "false",
- documentationCategory = OptionDocumentationCategory.LOGGING,
- effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
- help =
- "Print debug information while finding toolchains for a rule. This might help developers "
- + "of Bazel or Skylark rules with debugging failures due to missing toolchains."
- )
+ name = "toolchain_resolution_debug",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.LOGGING,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
+ help =
+ "Print debug information while finding toolchains for a rule. This might help developers "
+ + "of Bazel or Starlark rules with debugging failures due to missing toolchains.")
public boolean toolchainResolutionDebug;
@Option(
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttributesCollection.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttributesCollection.java
index d2054db..fbf027c 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttributesCollection.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttributesCollection.java
@@ -238,7 +238,7 @@
+ a.getName()
+ " of type "
+ type
- + " to a Skylark object");
+ + " to a Starlark object");
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkLateBoundDefault.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkLateBoundDefault.java
index d98c32a..63bd132 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkLateBoundDefault.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkLateBoundDefault.java
@@ -247,7 +247,7 @@
if (resolver == null) {
SkylarkModule moduleAnnotation = SkylarkInterfaceUtils.getSkylarkModule(fragmentClass);
if (moduleAnnotation == null) {
- throw new AssertionError("fragment class must have a valid skylark name");
+ throw new AssertionError("fragment class must have a valid Starlark name");
}
throw new InvalidConfigurationFieldException(
String.format("invalid configuration field name '%s' on fragment '%s'",
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
index c24d151..264ae49 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
@@ -592,8 +592,8 @@
throws EvalException, InterruptedException, ConversionException {
SkylarkUtils.checkLoadingPhase(env, getName(), ast.getLocation());
if (ruleClass == null) {
- throw new EvalException(ast.getLocation(),
- "Invalid rule class hasn't been exported by a Skylark file");
+ throw new EvalException(
+ ast.getLocation(), "Invalid rule class hasn't been exported by a bzl file");
}
for (Attribute attribute : ruleClass.getAttributes()) {
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryResolvedOptions.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryResolvedOptions.java
index 3ed520a..a42c5e0 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryResolvedOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryResolvedOptions.java
@@ -23,13 +23,12 @@
public class RepositoryResolvedOptions extends OptionsBase {
@Option(
- name = "experimental_repository_resolved_file",
- defaultValue = "",
- documentationCategory = OptionDocumentationCategory.LOGGING,
- effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
- help =
- "If non-empty, write a Skylark value with the resolved information of all Skylark"
- + " respository rules that were executed."
- )
+ name = "experimental_repository_resolved_file",
+ defaultValue = "",
+ documentationCategory = OptionDocumentationCategory.LOGGING,
+ effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
+ help =
+ "If non-empty, write a Skylark value with the resolved information of all Starlark"
+ + " repository rules that were executed.")
public String repositoryResolvedFile;
}
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryFunction.java
index fa7b1c5..97b2151 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryFunction.java
@@ -84,7 +84,7 @@
}
Map<String, String> resolvedHashes = resolvedHashesValue.getHashes();
- try (Mutability mutability = Mutability.create("skylark repository")) {
+ try (Mutability mutability = Mutability.create("Starlark repository")) {
com.google.devtools.build.lib.syntax.Environment buildEnv =
com.google.devtools.build.lib.syntax.Environment.builder(mutability)
.setSemantics(skylarkSemantics)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
index 6c6aad6..4774173 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
@@ -114,9 +114,9 @@
@Override
public void repr(SkylarkPrinter printer) {
if (exportedName == null) {
- printer.append("<anonymous skylark repository rule>");
+ printer.append("<anonymous starlark repository rule>");
} else {
- printer.append("<skylark repository rule " + extensionLabel + "%" + exportedName + ">");
+ printer.append("<starlark repository rule " + extensionLabel + "%" + exportedName + ">");
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AdvertisedProviderSet.java b/src/main/java/com/google/devtools/build/lib/packages/AdvertisedProviderSet.java
index 5f57150..5f74806 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AdvertisedProviderSet.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AdvertisedProviderSet.java
@@ -91,7 +91,8 @@
if (canHaveAnyProvider()) {
return "Any Provider";
}
- return String.format("allowed native providers=%s, allowed skylark providers=%s",
+ return String.format(
+ "allowed native providers=%s, allowed Starlark providers=%s",
getNativeProviders(), getSkylarkProviders());
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/BuiltinProvider.java b/src/main/java/com/google/devtools/build/lib/packages/BuiltinProvider.java
index 5e1e823..5bec61e 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/BuiltinProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/BuiltinProvider.java
@@ -96,7 +96,7 @@
*/
protected T throwUnsupportedConstructorException(Location loc) throws EvalException {
throw new EvalException(
- loc, String.format("'%s' cannot be constructed from Skylark", getPrintableName()));
+ loc, String.format("'%s' cannot be constructed from Starlark", getPrintableName()));
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/packages/NativeProvider.java b/src/main/java/com/google/devtools/build/lib/packages/NativeProvider.java
index 12f93f24..e7375ec 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/NativeProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/NativeProvider.java
@@ -131,7 +131,7 @@
protected InfoInterface createInstanceFromSkylark(Object[] args, Environment env, Location loc)
throws EvalException {
throw new EvalException(
- loc, String.format("'%s' cannot be constructed from Skylark", getPrintableName()));
+ loc, String.format("'%s' cannot be constructed from Starlark", getPrintableName()));
}
public static Pair<String, String> getSerializedRepresentationForNativeKey(NativeKey key) {
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 f23fba5..e800976 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
@@ -1024,8 +1024,7 @@
// We are explicit about types we don't understand so we minimize changes to existing callers
// if we add more types that we can represent.
throw new NotRepresentableException(
- String.format(
- "cannot represent %s (%s) in skylark", val.toString(), val.getClass().toString()));
+ String.format("cannot represent %s (%s) in Starlark", val, val.getClass()));
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index 8e9eb6c..fba2b88 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -821,7 +821,7 @@
|| type == RuleClassType.TEST
|| type == RuleClassType.PLACEHOLDER)
== (ruleDefinitionEnvironmentLabel != null),
- "Concrete Skylark rule classes can't have null labels: %s %s",
+ "Concrete Starlark rule classes can't have null labels: %s %s",
ruleDefinitionEnvironmentLabel,
type);
}
@@ -926,7 +926,7 @@
}
public Builder setSkylarkTestable() {
- Preconditions.checkState(skylark, "Cannot set skylarkTestable on a non-Skylark rule");
+ Preconditions.checkState(skylark, "Cannot set skylarkTestable on a non-Starlark rule");
skylarkTestable = true;
return this;
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/SkylarkSemanticsOptions.java b/src/main/java/com/google/devtools/build/lib/packages/SkylarkSemanticsOptions.java
index b36a636..223285b 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/SkylarkSemanticsOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/SkylarkSemanticsOptions.java
@@ -66,15 +66,9 @@
name = "experimental_analysis_testing_improvements",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.SKYLARK_SEMANTICS,
- effectTags = {
- OptionEffectTag.BUILD_FILE_SEMANTICS,
- OptionEffectTag.LOADING_AND_ANALYSIS
- },
- metadataTags = {
- OptionMetadataTag.EXPERIMENTAL
- },
- help = "If true, enables pieces of experimental Skylark API for analysis-phase testing."
- )
+ effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS, OptionEffectTag.LOADING_AND_ANALYSIS},
+ metadataTags = {OptionMetadataTag.EXPERIMENTAL},
+ help = "If true, enables pieces of experimental Starlark API for analysis-phase testing.")
public boolean experimentalAnalysisTestingImprovements;
@Option(
@@ -85,7 +79,7 @@
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.EXPERIMENTAL},
help =
- "Passes list of packages that can use the C++ Skylark API. Don't enable this flag yet, "
+ "Passes list of packages that can use the C++ Starlark API. Don't enable this flag yet, "
+ "we will be making breaking changes.")
public List<String> experimentalCcSkylarkApiEnabledPackages;
@@ -188,13 +182,12 @@
documentationCategory = OptionDocumentationCategory.SKYLARK_SEMANTICS,
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
metadataTags = {
- OptionMetadataTag.INCOMPATIBLE_CHANGE,
- OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
+ OptionMetadataTag.INCOMPATIBLE_CHANGE,
+ OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If set to true, disable the deprecated parameters 'single_file' and 'non_empty' on "
- + "skylark attribute definition methods, such as attr.label()."
- )
+ + "attribute definition methods, such as attr.label().")
public boolean incompatibleDisableDeprecatedAttrParams;
@Option(
@@ -453,7 +446,7 @@
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
- "If set to true, the native git_repository rules are disabled; only the skylark version "
+ "If set to true, the native git_repository rules are disabled; only the Starlark version "
+ "will be available")
public boolean incompatibleRemoveNativeGitRepository;
@@ -467,7 +460,7 @@
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
- "If set to true, the native http_archive rules are disabled; only the skylark version "
+ "If set to true, the native http_archive rules are disabled; only the Starlark version "
+ "will be available")
public boolean incompatibleRemoveNativeHttpArchive;
diff --git a/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java b/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java
index 93e06ec..1d84309 100644
--- a/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java
+++ b/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java
@@ -84,10 +84,10 @@
__CONSTRUCT_INCLUDE_PATHS("construct include paths"), // unused
__PARSE_AND_HINTS_RESULTS("parse and hints results"), // unused
__PROCESS_RESULTS_AND_ENQUEUE("process results and enqueue"), // unused
- SKYLARK_PARSER("Skylark Parser"),
- SKYLARK_USER_FN("Skylark user function call", -0xCC0033),
- SKYLARK_BUILTIN_FN("Skylark builtin function call", 0x990033),
- SKYLARK_USER_COMPILED_FN("Skylark compiled user function call", 0xCC0033),
+ SKYLARK_PARSER("Starlark Parser"),
+ SKYLARK_USER_FN("Starlark user function call", -0xCC0033),
+ SKYLARK_BUILTIN_FN("Starlark builtin function call", 0x990033),
+ SKYLARK_USER_COMPILED_FN("Starlark compiled user function call", 0xCC0033),
ACTION_FS_STAGING("Staging per-action file system", 0x000000),
UNKNOWN("Unknown event", 0x339966);
@@ -153,6 +153,6 @@
}
public boolean isSkylark() {
- return description.startsWith("Skylark ");
+ return description.startsWith("Starlark ");
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
index cc8a9e8..18366bf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
@@ -789,7 +789,7 @@
OptionEffectTag.EAGERNESS_TO_EXIT,
},
help =
- "If enabled, strict usage of the Skylark migration tag is enabled for android rules.")
+ "If enabled, strict usage of the Starlark migration tag is enabled for android rules.")
public boolean checkForMigrationTag;
// TODO(eaftan): enable this by default and delete it
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
index dd74eff..3821910 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
@@ -224,7 +224,7 @@
throw new EvalException(
location,
String.format(
- "the C++ Skylark API is for the time being only allowed for rules in '%s'; "
+ "the C++ Starlark API is for the time being only allowed for rules in '%s'; "
+ "but this is defined in '%s'. You can try it out by passing "
+ "--experimental_cc_skylark_api_enabled_packages=<list of packages>. Beware that "
+ "we will be making breaking changes to this API without prior warning.",
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
index b849bbb..19ea174 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -1208,7 +1208,7 @@
if (cppOptions.disableLegacyCompilationApi || cppOptions.disableLegacyFlagsCcToolchainApi) {
throw new EvalException(
null,
- "Skylark APIs accessing compilation flags has been removed. "
+ "Starlark APIs accessing compilation flags has been removed. "
+ "Use the new API on cc_common (see "
+ "--incompatible_disable_legacy_flags_cc_toolchain_api on"
+ "https://docs.bazel.build/versions/master/skylark/backward-compatibility.html"
@@ -1220,7 +1220,7 @@
if (cppOptions.disableLegacyLinkingApi || cppOptions.disableLegacyFlagsCcToolchainApi) {
throw new EvalException(
null,
- "Skylark APIs accessing linking flags has been removed. "
+ "Starlark APIs accessing linking flags has been removed. "
+ "Use the new API on cc_common (see "
+ "--incompatible_disable_legacy_flags_cc_toolchain_api on"
+ "https://docs.bazel.build/versions/master/skylark/backward-compatibility.html"
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
index c9ace41..6a04ccd 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -754,7 +754,7 @@
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.EXPERIMENTAL},
- help = "If true, C++ Skylark API exposing linking flags will be disabled.")
+ help = "If true, C++ Starlark API exposing linking flags will be disabled.")
public boolean disableLegacyLinkingApi;
@Option(
@@ -763,7 +763,7 @@
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.EXPERIMENTAL},
- help = "If true, C++ Skylark API exposing compilation flags will be disabled.")
+ help = "If true, C++ Starlark API exposing compilation flags will be disabled.")
public boolean disableLegacyCompilationApi;
@Option(
@@ -776,7 +776,7 @@
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
- "Flag for disabling the legacy cc_toolchain Skylark API for accessing legacy "
+ "Flag for disabling the legacy cc_toolchain Starlark API for accessing legacy "
+ "CROSSTOOL fields.")
public boolean disableLegacyFlagsCcToolchainApi;
@@ -874,7 +874,7 @@
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
- "If true, C++ toolchain Skylark API will not accept depset in `user_compile_flags` "
+ "If true, C++ toolchain Starlark API will not accept depset in `user_compile_flags` "
+ "param of `create_compile_variables`, and in `user_link_flags` of "
+ "`create_link_variables`. Use list instead.")
public boolean disableDepsetInUserFlags;
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java
index ece5e19..bae37e3 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java
@@ -264,7 +264,7 @@
try {
dumpSkylarkHeap(env.getBlazeWorkspace(), dumpOptions.skylarkMemory, out);
} catch (IOException e) {
- env.getReporter().error(null, "Could not dump skylark memory", e);
+ env.getReporter().error(null, "Could not dump Starlark memory", e);
}
}
@@ -444,12 +444,12 @@
AllocationTracker allocationTracker = workspace.getAllocationTracker();
if (allocationTracker == null) {
out.println(
- "Cannot dump skylark heap without running in memory tracking mode. "
+ "Cannot dump Starlark heap without running in memory tracking mode. "
+ "Please refer to the user manual for the dump commnd "
+ "for information how to turn on memory tracking.");
return;
}
- out.println("Dumping skylark heap to: " + path);
+ out.println("Dumping Starlark heap to: " + path);
allocationTracker.dumpSkylarkAllocations(path);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
index d228a36..9730d6f 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
@@ -85,14 +85,13 @@
public boolean ignoreUnsupportedSandboxing;
@Option(
- name = "sandbox_debug",
- defaultValue = "false",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
- help =
- "Let the sandbox print debug information on execution. This might help developers of "
- + "Bazel or Skylark rules with debugging failures due to missing input files, etc."
- )
+ name = "sandbox_debug",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help =
+ "Let the sandbox print debug information on execution. This might help developers of "
+ + "Bazel or Starlark rules with debugging failures due to missing input files, etc.")
public boolean sandboxDebug;
@Option(
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
index 2ab09fc..9f5a63c 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
@@ -147,8 +147,7 @@
if (!(skylarkAspect instanceof SkylarkDefinedAspect)) {
throw new AspectCreationException(
String.format(
- "%s from %s is not a skylark-defined aspect",
- skylarkValueName, extensionLabel.toString()),
+ "%s from %s is not a Starlark-defined aspect", skylarkValueName, extensionLabel),
extensionLabel);
} else {
return (SkylarkDefinedAspect) skylarkAspect;
@@ -181,7 +180,7 @@
}
if (skylarkImportLookupValue == null) {
Preconditions.checkState(
- env.valuesMissing(), "no skylark import value for %s", importFileKey);
+ env.valuesMissing(), "no Starlark import value for %s", importFileKey);
return null;
}
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 5de16d9..88fc05d 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
@@ -609,7 +609,7 @@
importLookupKey, env, importLookupKeys.size());
if (skyValue == null) {
Preconditions.checkState(
- env.valuesMissing(), "no skylark import value for %s", importLookupKey);
+ env.valuesMissing(), "no starlark import value for %s", importLookupKey);
// We continue making inline calls even if some requested values are missing, to
// maximize the number of dependent (non-inlined) SkyFunctions that are requested, thus
// avoiding a quadratic number of restarts.
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
index c8c9d24..811a704 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
@@ -177,7 +177,7 @@
public void resetCache() {
if (skylarkImportLookupValueCache != null) {
logger.info(
- "Skylark inlining cache stats from earlier build: "
+ "Starlark inlining cache stats from earlier build: "
+ skylarkImportLookupValueCache.stats());
}
skylarkImportLookupValueCache =
@@ -293,7 +293,7 @@
ImmutableList<Label> cycle =
CycleUtils.splitIntoPathAndChain(Predicates.equalTo(fileLabel), alreadyVisited.keySet())
.second;
- throw new SkylarkImportFailedException("Skylark import cycle: " + cycle);
+ throw new SkylarkImportFailedException("Starlark import cycle: " + cycle);
}
alreadyVisited.put(fileLabel, null);
skylarkImportMap = Maps.newHashMapWithExpectedSize(imports.size());
@@ -308,7 +308,7 @@
this.computeWithInlineCallsInternal(importLookupKey, strippedEnv, alreadyVisited);
if (cachedValue == null) {
Preconditions.checkState(
- env.valuesMissing(), "no skylark import value for %s", importLookupKey);
+ env.valuesMissing(), "no starlark import value for %s", importLookupKey);
// We continue making inline calls even if some requested values are missing, to maximize
// the number of dependent (non-inlined) SkyFunctions that are requested, thus avoiding a
// quadratic number of restarts.
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkModuleCycleReporter.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkModuleCycleReporter.java
index d9aab5b..afeed33 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkModuleCycleReporter.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkModuleCycleReporter.java
@@ -110,11 +110,16 @@
Label fileLabel =
(Label) Iterables.getLast(Iterables.filter(cycle, IS_AST_FILE_LOOKUP)).argument();
String repositoryName = fileLabel.getPackageIdentifier().getRepository().strippedName();
- eventHandler.handle(Event.error(null,
- "Failed to load Skylark extension '" + fileLabel.toString() + "'.\n"
- + "It usually happens when the repository is not defined prior to being used.\n"
- + "Maybe repository '" + repositoryName
- + "' was defined later in your WORKSPACE file?"));
+ eventHandler.handle(
+ Event.error(
+ null,
+ "Failed to load Starlark extension '"
+ + fileLabel
+ + "'.\n"
+ + "It usually happens when the repository is not defined prior to being used.\n"
+ + "Maybe repository '"
+ + repositoryName
+ + "' was defined later in your WORKSPACE file?"));
return true;
} else if (Iterables.any(cycle, IS_PACKAGE_LOOKUP)) {
eventHandler.handle(
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkConfigApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkConfigApi.java
index 4a455c5..eb8da0a 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkConfigApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkConfigApi.java
@@ -20,32 +20,34 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
-
/**
- * The "config" module of the Build API.
+ * The "config" module of the Build API.
*
- * This exposes methods to describe what kind of build setting (if any) a skylark rule is using
- * the {@code build_setting} attr of the {@code rule(...)} function.
+ * <p>This exposes methods to describe what kind of build setting (if any) a skylark rule is using
+ * the {@code build_setting} attr of the {@code rule(...)} function.
*/
@SkylarkModule(
name = "config",
namespace = true,
category = SkylarkModuleCategory.BUILTIN,
- doc = "Note: This API is experimental and may change at any time."
- + ""
- + "<p>This is a top-level module for creating build setting descriptors which describe "
- + "what kind of build setting (if any) a skylark rule is. "
- + ""
- + "<p>ex: the following rule is marked as a build setting by setting the "
- + "<code>build_setting</code> parameter of the <code>rule()</code> function. Specifically "
- + "it is a build setting of type <code>int</code> and is a <code>flag</code> which means "
- + "this build setting is callable on the command line.<br><pre class=language-python>"
- + " my_rule = rule(\n"
- + " implementation = _impl,\n"
- + " build_setting = config.int(flag = True),\n"
- + " ...\n"
- + " )</pre>")
-//TODO(juliexxia): Create formal documentation for skylark build configuration efforts (b/112545834)
+ doc =
+ "Note: This API is experimental and may change at any time."
+ + ""
+ + "<p>This is a top-level module for creating build setting descriptors which describe "
+ + "what kind of build setting (if any) a rule is. "
+ + ""
+ + "<p>ex: the following rule is marked as a build setting by setting the "
+ + "<code>build_setting</code> parameter of the <code>rule()</code> function. "
+ + "Specifically it is a build setting of type <code>int</code> and is a "
+ + "<code>flag</code> which means "
+ + "this build setting is callable on the command line.<br><pre class=language-python>"
+ + " my_rule = rule(\n"
+ + " implementation = _impl,\n"
+ + " build_setting = config.int(flag = True),\n"
+ + " ...\n"
+ + " )</pre>")
+// TODO(juliexxia): Create formal documentation for skylark build configuration efforts
+// (b/112545834)
public interface SkylarkConfigApi extends SkylarkValue {
static final String FLAG_ARG = "flag";
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
index 491fef8..979a447 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
@@ -229,26 +229,28 @@
public BuildConfigurationApi getHostConfiguration() throws EvalException;
@SkylarkCallable(
- name = "coverage_instrumented",
- doc = "Returns whether code coverage instrumentation should be generated when performing "
- + "compilation actions for this rule or, if <code>target</code> is provided, the rule "
- + "specified by that Target. (If a non-rule or a Skylark rule Target is provided, this "
- + "returns False.) Checks if the sources of the current rule (if no Target is provided) or "
- + "the sources of Target should be instrumented based on the --instrumentation_filter and "
- + "--instrument_test_targets config settings. "
- + "This differs from <code>coverage_enabled</code> in the <a href=\"configuration.html\">"
- + "configuration</a>, which notes whether coverage data collection is enabled for the "
- + "entire run, but not whether a specific target should be instrumented.",
- parameters = {
- @Param(
- name = "target",
- type = TransitiveInfoCollectionApi.class,
- defaultValue = "None",
- noneable = true,
- named = true,
- doc = "A Target specifying a rule. If not provided, defaults to the current rule.")
- }
- )
+ name = "coverage_instrumented",
+ doc =
+ "Returns whether code coverage instrumentation should be generated when performing "
+ + "compilation actions for this rule or, if <code>target</code> is provided, the "
+ + "rule specified by that Target. (If a non-rule or a Starlark rule Target is "
+ + "provided, this returns False.) Checks if the sources of the current rule "
+ + "(if no Target is provided) or the sources of Target should be instrumented "
+ + "based on the --instrumentation_filter and "
+ + "--instrument_test_targets config settings. "
+ + "This differs from <code>coverage_enabled</code> in the"
+ + "<a href=\"configuration.html\">configuration</a>, which notes whether coverage "
+ + "data collection is enabled for the entire run, but not whether a specific "
+ + "target should be instrumented.",
+ parameters = {
+ @Param(
+ name = "target",
+ type = TransitiveInfoCollectionApi.class,
+ defaultValue = "None",
+ noneable = true,
+ named = true,
+ doc = "A Target specifying a rule. If not provided, defaults to the current rule.")
+ })
public boolean instrumentCoverage(Object targetUnchecked) throws EvalException;
@SkylarkCallable(
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleFunctionsApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleFunctionsApi.java
index 2f2c008..247f01d 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleFunctionsApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleFunctionsApi.java
@@ -244,7 +244,7 @@
+ "<a href=\"ctx.html#created_actions\">ctx.created_actions()</a>."
+ "<br/><br/>"
+ "This should only be used for testing the analysis-time behavior of "
- + "Skylark rules. This flag may be removed in the future."),
+ + "Starlark rules. This flag may be removed in the future."),
@Param(
name = "toolchains",
type = SkylarkList.class,
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/apple/AppleCommonApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/apple/AppleCommonApi.java
index 2445405..4171d49 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/apple/AppleCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/apple/AppleCommonApi.java
@@ -30,14 +30,12 @@
import com.google.devtools.build.lib.syntax.SkylarkDict;
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
-/**
- * Interface for a module with useful functions for creating apple-related rule implementations.
- */
+/** Interface for a module with useful functions for creating apple-related rule implementations. */
@SkylarkModule(
name = "apple_common",
- doc = "Functions for skylark to access internals of the apple rule implementations."
-)
-public interface AppleCommonApi<FileApiT extends FileApi,
+ doc = "Functions for Starlark to access internals of the apple rule implementations.")
+public interface AppleCommonApi<
+ FileApiT extends FileApi,
ObjcProviderApiT extends ObjcProviderApi<?>,
XcodeConfigProviderApiT extends XcodeConfigProviderApi<?, ?>,
ApplePlatformApiT extends ApplePlatformApi> {
@@ -367,7 +365,7 @@
"Links a (potentially multi-architecture) binary targeting Apple platforms. This "
+ "method comprises a bulk of the logic of the <code>apple_binary</code> rule, and "
+ "is exposed as an API to iterate on migration of <code>apple_binary</code> to "
- + "Skylark.\n"
+ + "Starlark.\n"
+ "<p>This API is <b>highly experimental</b> and subject to change at any time. Do "
+ "not depend on the stability of this function at this time.",
parameters = {
@@ -376,7 +374,7 @@
type = SkylarkRuleContextApi.class,
named = true,
positional = false,
- doc = "The Skylark rule context."),
+ doc = "The Starlark rule context."),
},
useEnvironment = true)
// TODO(b/70937317): Iterate on, improve, and solidify this API.
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/config/ConfigSkylarkCommonApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/config/ConfigSkylarkCommonApi.java
index dcc45a2..73fee38 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/config/ConfigSkylarkCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/config/ConfigSkylarkCommonApi.java
@@ -18,13 +18,10 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
-/**
- * Helper utility containing functions regarding configurations.ss
- */
+/** Helper utility containing functions regarding configurations.ss */
@SkylarkModule(
- name = "config_common",
- doc = "Functions for Skylark to interact with Blaze's configurability APIs."
-)
+ name = "config_common",
+ doc = "Functions for Starlark to interact with Blaze's configurability APIs.")
public interface ConfigSkylarkCommonApi {
@SkylarkCallable(
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java
index 929571a..21b23fe 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java
@@ -468,7 +468,7 @@
parameters = {
@Param(
name = "ctx",
- doc = "Skylark rule context.",
+ doc = "Starlark rule context.",
positional = false,
named = true,
type = SkylarkRuleContext.class),
@@ -497,7 +497,7 @@
parameters = {
@Param(
name = "ctx",
- doc = "Skylark rule context.",
+ doc = "Starlark rule context.",
positional = false,
named = true,
type = SkylarkRuleContext.class),
@@ -581,7 +581,7 @@
// TODO(plf): Make this parameter mandatory. Change cc_embed_data.bzl first.
@Param(
name = "ctx",
- doc = "Skylark rule context.",
+ doc = "Starlark rule context.",
positional = false,
named = true,
noneable = true,
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcSkylarkInfoApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcSkylarkInfoApi.java
index 50f86e8..afefd82 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcSkylarkInfoApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcSkylarkInfoApi.java
@@ -22,6 +22,6 @@
@SkylarkModule(
name = "cc_skylark_info",
category = SkylarkModuleCategory.PROVIDER,
- doc = "Temporary provider to mark C++ Skylark rules")
+ doc = "Temporary provider to mark C++ Starlark rules")
// TODO(b/77669139): Delete this class. Use {@link CcInfo} instead.
public interface CcSkylarkInfoApi extends StructApi {}
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java
index 2ee2ea2..7bcdbd6 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java
@@ -183,7 +183,7 @@
doc =
"Path to the linker binary. \n WARNING: This method is only added to allow incremental"
+ "migration of existing users. Please do not use in new code. Will be removed soon"
- + "as part of the new Skylark API to the C++ toolchain.")
+ + "as part of the new Starlark API to the C++ toolchain.")
public String getLdExecutableForSkylark();
@SkylarkCallable(
@@ -191,7 +191,7 @@
doc =
"Path to GNU binutils 'objcopy' binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be"
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getObjCopyExecutableForSkylark();
@SkylarkCallable(
@@ -199,7 +199,7 @@
doc =
"Path to C/C++ compiler binary. \n WARNING: This method is only added to allow "
+ "incremental migration of existing users. Please do not use in new code. Will be"
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getCppExecutableForSkylark();
@SkylarkCallable(
@@ -207,7 +207,7 @@
doc =
"Path to C/C++ preprocessor binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be "
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getCpreprocessorExecutableForSkylark();
@SkylarkCallable(
@@ -215,7 +215,7 @@
doc =
"Path to GNU binutils 'nm' binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be "
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getNmExecutableForSkylark();
@SkylarkCallable(
@@ -223,7 +223,7 @@
doc =
"Path to GNU binutils 'objdump' binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be "
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getObjdumpExecutableForSkylark();
@SkylarkCallable(
@@ -231,7 +231,7 @@
doc =
"Path to GNU binutils 'ar' binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be "
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getArExecutableForSkylark();
@SkylarkCallable(
@@ -239,6 +239,6 @@
doc =
"Path to GNU binutils 'strip' binary. \n WARNING: This method is only added to allow"
+ "incremental migration of existing users. Please do not use in new code. Will be "
- + "removed soon as part of the new Skylark API to the C++ toolchain.")
+ + "removed soon as part of the new Starlark API to the C++ toolchain.")
public String getStripExecutableForSkylark();
}
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/java/JavaCommonApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/java/JavaCommonApi.java
index 802db05..3118c37 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/java/JavaCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/java/JavaCommonApi.java
@@ -32,11 +32,11 @@
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
import javax.annotation.Nullable;
-/**
- * Utilities for Java compilation support in Skylark.
- */
-@SkylarkModule(name = "java_common", doc = "Utilities for Java compilation support in Skylark.")
-public interface JavaCommonApi<FileT extends FileApi, JavaInfoT extends JavaInfoApi<FileT>,
+/** Utilities for Java compilation support in Skylark. */
+@SkylarkModule(name = "java_common", doc = "Utilities for Java compilation support in Starlark.")
+public interface JavaCommonApi<
+ FileT extends FileApi,
+ JavaInfoT extends JavaInfoApi<FileT>,
SkylarkRuleContextT extends SkylarkRuleContextApi,
TransitiveInfoCollectionT extends TransitiveInfoCollectionApi,
SkylarkActionFactoryT extends SkylarkActionFactoryApi> {
@@ -177,141 +177,126 @@
public ProviderApi getJavaProvider();
@SkylarkCallable(
- name = "compile",
- doc = "Compiles Java source files/jars from the implementation of a Skylark rule and returns a "
- + "provider that represents the results of the compilation and can be added to the set of "
- + "providers emitted by this rule.",
- parameters = {
- @Param(
- name = "ctx",
- positional = true,
- named = false,
- type = SkylarkRuleContextApi.class,
- doc = "The rule context."
- ),
- @Param(
- name = "source_jars",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = FileApi.class,
- defaultValue = "[]",
- doc = "A list of the jars to be compiled. At least one of source_jars or source_files"
- + " should be specified."
- ),
- @Param(
- name = "source_files",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = FileApi.class,
- defaultValue = "[]",
- doc = "A list of the Java source files to be compiled. At least one of source_jars or "
- + "source_files should be specified."
- ),
- @Param(
- name = "output",
- positional = false,
- named = true,
- type = FileApi.class
- ),
- @Param(
- name = "javac_opts",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = String.class,
- defaultValue = "[]",
- doc = "A list of the desired javac options. Optional."
- ),
- @Param(
- name = "deps",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = JavaInfoApi.class,
- defaultValue = "[]",
- doc = "A list of dependencies. Optional."
- ),
- @Param(
- name = "exports",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = JavaInfoApi.class,
- defaultValue = "[]",
- doc = "A list of exports. Optional."
- ),
- @Param(
- name = "plugins",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = JavaInfoApi.class,
- defaultValue = "[]",
- doc = "A list of plugins. Optional."
- ),
- @Param(
- name = "exported_plugins",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = JavaInfoApi.class,
- defaultValue = "[]",
- doc = "A list of exported plugins. Optional."
- ),
- @Param(
- name = "strict_deps",
- defaultValue = "'ERROR'",
- positional = false,
- named = true,
- type = String.class,
- doc = "A string that specifies how to handle strict deps. Possible values: 'OFF', 'ERROR',"
- + "'WARN' and 'DEFAULT'. For more details see "
- + "https://docs.bazel.build/versions/master/bazel-user-manual.html#flag--strict_java_deps"
- + ". By default 'ERROR'."
- ),
- @Param(
- name = "java_toolchain",
- positional = false,
- named = true,
- type = TransitiveInfoCollectionApi.class,
- doc = "A label pointing to a java_toolchain rule to be used for this compilation. "
- + "Mandatory."
- ),
- @Param(
- name = "host_javabase",
- positional = false,
- named = true,
- type = TransitiveInfoCollectionApi.class,
- doc = "A label pointing to a JDK to be used for this compilation. Mandatory."
- ),
- @Param(
- name = "sourcepath",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = FileApi.class,
- defaultValue = "[]"
- ),
- @Param(
- name = "resources",
- positional = false,
- named = true,
- type = SkylarkList.class,
- generic1 = FileApi.class,
- defaultValue = "[]"
- ),
- @Param(
- name = "neverlink",
- positional = false,
- named = true,
- type = Boolean.class,
- defaultValue = "False"
- )
- },
- useEnvironment = true
- )
+ name = "compile",
+ doc =
+ "Compiles Java source files/jars from the implementation of a Starlark rule and returns "
+ + "a provider that represents the results of the compilation and can be added to "
+ + "the set of providers emitted by this rule.",
+ parameters = {
+ @Param(
+ name = "ctx",
+ positional = true,
+ named = false,
+ type = SkylarkRuleContextApi.class,
+ doc = "The rule context."),
+ @Param(
+ name = "source_jars",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = FileApi.class,
+ defaultValue = "[]",
+ doc =
+ "A list of the jars to be compiled. At least one of source_jars or source_files"
+ + " should be specified."),
+ @Param(
+ name = "source_files",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = FileApi.class,
+ defaultValue = "[]",
+ doc =
+ "A list of the Java source files to be compiled. At least one of source_jars or "
+ + "source_files should be specified."),
+ @Param(name = "output", positional = false, named = true, type = FileApi.class),
+ @Param(
+ name = "javac_opts",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = String.class,
+ defaultValue = "[]",
+ doc = "A list of the desired javac options. Optional."),
+ @Param(
+ name = "deps",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = JavaInfoApi.class,
+ defaultValue = "[]",
+ doc = "A list of dependencies. Optional."),
+ @Param(
+ name = "exports",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = JavaInfoApi.class,
+ defaultValue = "[]",
+ doc = "A list of exports. Optional."),
+ @Param(
+ name = "plugins",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = JavaInfoApi.class,
+ defaultValue = "[]",
+ doc = "A list of plugins. Optional."),
+ @Param(
+ name = "exported_plugins",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = JavaInfoApi.class,
+ defaultValue = "[]",
+ doc = "A list of exported plugins. Optional."),
+ @Param(
+ name = "strict_deps",
+ defaultValue = "'ERROR'",
+ positional = false,
+ named = true,
+ type = String.class,
+ doc =
+ "A string that specifies how to handle strict deps. Possible values: 'OFF', "
+ + "'ERROR', 'WARN' and 'DEFAULT'. For more details see "
+ + "https://docs.bazel.build/versions/master/bazel-user-manual.html#"
+ + "flag--strict_java_deps. By default 'ERROR'."),
+ @Param(
+ name = "java_toolchain",
+ positional = false,
+ named = true,
+ type = TransitiveInfoCollectionApi.class,
+ doc =
+ "A label pointing to a java_toolchain rule to be used for this compilation. "
+ + "Mandatory."),
+ @Param(
+ name = "host_javabase",
+ positional = false,
+ named = true,
+ type = TransitiveInfoCollectionApi.class,
+ doc = "A label pointing to a JDK to be used for this compilation. Mandatory."),
+ @Param(
+ name = "sourcepath",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = FileApi.class,
+ defaultValue = "[]"),
+ @Param(
+ name = "resources",
+ positional = false,
+ named = true,
+ type = SkylarkList.class,
+ generic1 = FileApi.class,
+ defaultValue = "[]"),
+ @Param(
+ name = "neverlink",
+ positional = false,
+ named = true,
+ type = Boolean.class,
+ defaultValue = "False")
+ },
+ useEnvironment = true)
public JavaInfoT createJavaCompileAction(
SkylarkRuleContextT skylarkRuleContext,
SkylarkList<FileT> sourceJars,
@@ -328,7 +313,8 @@
SkylarkList<FileT> sourcepathEntries,
SkylarkList<FileT> resources,
Boolean neverlink,
- Environment environment) throws EvalException, InterruptedException;
+ Environment environment)
+ throws EvalException, InterruptedException;
@SkylarkCallable(
name = "run_ijar",
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/PlatformCommonApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/PlatformCommonApi.java
index d6ff30d..db27f2b 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/PlatformCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/PlatformCommonApi.java
@@ -19,13 +19,10 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.syntax.SkylarkSemantics.FlagIdentifier;
-/**
- * Module containing functions to interact with the platform APIs.
- */
+/** Module containing functions to interact with the platform APIs. */
@SkylarkModule(
name = "platform_common",
- doc = "Functions for Skylark to interact with the platform APIs."
-)
+ doc = "Functions for Starlark to interact with the platform APIs.")
public interface PlatformCommonApi {
@SkylarkCallable(
name = "TemplateVariableInfo",
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/test/TestingModuleApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/test/TestingModuleApi.java
index 63528c9..97ddfc3 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/test/TestingModuleApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/test/TestingModuleApi.java
@@ -19,13 +19,10 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.syntax.SkylarkDict;
-/**
- * Helper module for accessing test infrastructure.
- */
+/** Helper module for accessing test infrastructure. */
@SkylarkModule(
name = "testing",
- doc = "Helper methods for skylark to access testing infrastructure."
-)
+ doc = "Helper methods for Starlark to access testing infrastructure.")
public interface TestingModuleApi {
// TODO(bazel-team): Change this function to be the actual ExecutionInfo.PROVIDER.
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkdebug/module/SkylarkDebuggerOptions.java b/src/main/java/com/google/devtools/build/lib/skylarkdebug/module/SkylarkDebuggerOptions.java
index 4adc962..880d518 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkdebug/module/SkylarkDebuggerOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkdebug/module/SkylarkDebuggerOptions.java
@@ -29,7 +29,7 @@
effectTags = {OptionEffectTag.EXECUTION},
metadataTags = {OptionMetadataTag.EXPERIMENTAL},
help =
- "If true, Blaze will open the Skylark debug server at the start of the build "
+ "If true, Blaze will open the Starlark debug server at the start of the build "
+ "invocation, and wait for a debugger to attach before running the build.")
public boolean debugSkylark;
@@ -39,7 +39,7 @@
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.EXECUTION},
metadataTags = {OptionMetadataTag.EXPERIMENTAL},
- help = "The port on which the Skylark debug server will listen for connections.")
+ help = "The port on which the Starlark debug server will listen for connections.")
public int debugServerPort;
@Option(
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java b/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
index 70d2bbf..bfdc795 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java
@@ -225,7 +225,7 @@
String.format(
"%s%s (%s)\n"
+ "while calling %s with args %s\n"
- + "Java parameter types: %s\nSkylark type checks: %s",
+ + "Java parameter types: %s\nStarlark type checks: %s",
(loc == null) ? "" : loc + ": ",
Arrays.asList(args),
e.getClass().getName(),
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java b/src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java
index faf66bb..eaeb66a 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java
@@ -188,8 +188,10 @@
if (parent != null) {
return parent;
}
- Preconditions.checkArgument(SkylarkValue.class.isAssignableFrom(c),
- "%s is not allowed as a Skylark value (getSkylarkType() failed)", c);
+ Preconditions.checkArgument(
+ SkylarkValue.class.isAssignableFrom(c),
+ "%s is not allowed as a Starlark value (getSkylarkType() failed)",
+ c);
return c;
}
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Runtime.java b/src/main/java/com/google/devtools/build/lib/syntax/Runtime.java
index 08c9a2a..83ff7d0 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Runtime.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Runtime.java
@@ -94,8 +94,11 @@
}
}
- @SkylarkSignature(name = "<unbound>", returnType = UnboundMarker.class, documented = false,
- doc = "Marker for unbound values in cases where neither Skylark None nor Java null can do.")
+ @SkylarkSignature(
+ name = "<unbound>",
+ returnType = UnboundMarker.class,
+ documented = false,
+ doc = "Marker for unbound values in cases where neither Starlark None nor Java null can do.")
public static final UnboundMarker UNBOUND = new UnboundMarker();
@SkylarkSignature(name = "None", returnType = NoneType.class,
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkImports.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkImports.java
index 4158b28..a339b7c 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkImports.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkImports.java
@@ -150,7 +150,7 @@
@VisibleForTesting
static final String EXTERNAL_PKG_NOT_ALLOWED_MSG =
- "Skylark files may not be loaded from the //external package";
+ "Starlark files may not be loaded from the //external package";
@VisibleForTesting
static final String INVALID_PATH_SYNTAX =
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java
index 524f06e..cb59b68 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java
@@ -627,8 +627,10 @@
if (!isTypeAllowedInSkylark(object)) {
throw new EvalException(
loc,
- "internal error: type '" + object.getClass().getSimpleName() + "' is not allowed as a "
- + "Skylark value (checkTypeAllowedInSkylark() failed)");
+ "internal error: type '"
+ + object.getClass().getSimpleName()
+ + "' is not allowed as a "
+ + "Starlark value (checkTypeAllowedInSkylark() failed)");
}
}
diff --git a/src/main/java/com/google/devtools/common/options/OptionFilterDescriptions.java b/src/main/java/com/google/devtools/common/options/OptionFilterDescriptions.java
index c98c218..4ed5dd7 100644
--- a/src/main/java/com/google/devtools/common/options/OptionFilterDescriptions.java
+++ b/src/main/java/com/google/devtools/common/options/OptionFilterDescriptions.java
@@ -75,7 +75,7 @@
"Options that affect the signing outputs of a build")
.put(
OptionDocumentationCategory.SKYLARK_SEMANTICS,
- "This option affects semantics of the skylark language or the build API accessible to "
+ "This option affects semantics of the Starlark language or the build API accessible to "
+ "BUILD files, .bzl files, or WORKSPACE files.")
.put(
OptionDocumentationCategory.TESTING,
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryIntegrationTest.java
index bf9ad93..cd3eb21 100644
--- a/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryIntegrationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryIntegrationTest.java
@@ -256,7 +256,7 @@
}
assertDoesNotContainEvent("cycle");
assertContainsEvent("Maybe repository 'foo' was defined later in your WORKSPACE file?");
- assertContainsEvent("Failed to load Skylark extension '@foo//:def.bzl'.");
+ assertContainsEvent("Failed to load Starlark extension '@foo//:def.bzl'.");
}
@Test
@@ -280,7 +280,7 @@
}
assertDoesNotContainEvent("cycle");
assertContainsEvent("Maybe repository 'foo' was defined later in your WORKSPACE file?");
- assertContainsEvent("Failed to load Skylark extension '@foo//:def.bzl'.");
+ assertContainsEvent("Failed to load Starlark extension '@foo//:def.bzl'.");
}
@Test
@@ -305,7 +305,7 @@
assertThat(expected)
.hasMessageThat()
.contains(
- "Failed to load Skylark extension "
+ "Failed to load Starlark extension "
+ "'@git_repo//xyz:foo.bzl'.\n"
+ "It usually happens when the repository is not defined prior to being used.\n"
+ "Maybe repository 'git_repo' was defined later in your WORKSPACE file?");
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java
index 882e429..69471cc 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java
@@ -154,7 +154,7 @@
invalidatePackages();
reporter.removeHandler(failFastHandler);
getConfiguredTarget("//test:target");
- assertContainsEvent("Skylark APIs accessing linking flags has been removed.");
+ assertContainsEvent("Starlark APIs accessing linking flags has been removed.");
}
@Test
@@ -205,7 +205,7 @@
invalidatePackages();
reporter.removeHandler(failFastHandler);
getConfiguredTarget("//test:target");
- assertContainsEvent("Skylark APIs accessing compilation flags has been removed.");
+ assertContainsEvent("Starlark APIs accessing compilation flags has been removed.");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
index f904c42..7ab46a8 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java
@@ -2321,7 +2321,7 @@
} catch (BuildFileContainsErrorsException e) {
// The reason that this is an exception and not reported to the event handler is that the
// error is reported by the parent sky function, which we don't have here.
- assertThat(e).hasMessageThat().contains("Skylark import cycle");
+ assertThat(e).hasMessageThat().contains("Starlark import cycle");
assertThat(e).hasMessageThat().contains("test/skylark:ext1.bzl");
assertThat(e).hasMessageThat().contains("test/skylark:ext2.bzl");
}
@@ -2347,7 +2347,7 @@
} catch (BuildFileContainsErrorsException e) {
// The reason that this is an exception and not reported to the event handler is that the
// error is reported by the parent sky function, which we don't have here.
- assertThat(e).hasMessageThat().contains("Skylark import cycle");
+ assertThat(e).hasMessageThat().contains("Starlark import cycle");
assertThat(e).hasMessageThat().contains("//test/skylark:ext2.bzl");
assertThat(e).hasMessageThat().contains("//test/skylark:ext3.bzl");
assertThat(e).hasMessageThat().contains("//test/skylark:ext4.bzl");
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/EvalUtilsTest.java b/src/test/java/com/google/devtools/build/lib/syntax/EvalUtilsTest.java
index 4c1810a..404a960 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/EvalUtilsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/EvalUtilsTest.java
@@ -186,8 +186,10 @@
assertThrows(
IllegalArgumentException.class,
() -> EvalUtils.getSkylarkType(NonSkylarkValueSubclass.class));
- assertThat(expected).hasMessageThat().contains(
- "class com.google.devtools.build.lib.syntax.EvalUtilsTest$NonSkylarkValueSubclass "
- + "is not allowed as a Skylark value");
+ assertThat(expected)
+ .hasMessageThat()
+ .contains(
+ "class com.google.devtools.build.lib.syntax.EvalUtilsTest$NonSkylarkValueSubclass "
+ + "is not allowed as a Starlark value");
}
}
diff --git a/src/test/shell/bazel/skylark_repository_test.sh b/src/test/shell/bazel/skylark_repository_test.sh
index 96fc44f..6c8e9f8 100755
--- a/src/test/shell/bazel/skylark_repository_test.sh
+++ b/src/test/shell/bazel/skylark_repository_test.sh
@@ -249,7 +249,7 @@
[ $exitCode != 0 ] || fail "building @foo//:data.txt succeed while expected failure"
expect_not_log "PACKAGE"
- expect_log "Failed to load Skylark extension '@foo//:ext.bzl'"
+ expect_log "Failed to load Starlark extension '@foo//:ext.bzl'"
expect_log "Maybe repository 'foo' was defined later in your WORKSPACE file?"
}
@@ -268,7 +268,7 @@
[ $exitCode != 0 ] || fail "building //... succeed while expected failure"
expect_not_log "PACKAGE"
- expect_log "Failed to load Skylark extension '@does_not_exist//:random.bzl'"
+ expect_log "Failed to load Starlark extension '@does_not_exist//:random.bzl'"
expect_log "Maybe repository 'does_not_exist' was defined later in your WORKSPACE file?"
# Retest with query //...
@@ -277,7 +277,7 @@
[ $exitCode != 0 ] || fail "querying //... succeed while expected failure"
expect_not_log "PACKAGE"
- expect_log "Failed to load Skylark extension '@does_not_exist//:random.bzl'"
+ expect_log "Failed to load Starlark extension '@does_not_exist//:random.bzl'"
expect_log "Maybe repository 'does_not_exist' was defined later in your WORKSPACE file?"
}
@@ -360,7 +360,7 @@
bazel build @foo//:bar --internal_skylark_flag_test_canary >& $TEST_log \
|| fail "Expected build to succeed"
expect_log "In repo rule: $MARKER" \
- "Skylark flags are not propagating to repository rule implementation \
+ "Starlark flags are not propagating to repository rule implementation \
function evaluation"
}
diff --git a/src/test/shell/integration/skylark_flag_test.sh b/src/test/shell/integration/skylark_flag_test.sh
index 171ed17..10c2157 100755
--- a/src/test/shell/integration/skylark_flag_test.sh
+++ b/src/test/shell/integration/skylark_flag_test.sh
@@ -98,7 +98,7 @@
--internal_skylark_flag_test_canary \
&>"$TEST_log" || fail "bazel build failed";
expect_log "In BUILD: $MARKER" \
- "Skylark flags are not propagating to BUILD file evaluation"
+ "Starlark flags are not propagating to BUILD file evaluation"
}
function test_bzl_file_and_macro() {
@@ -132,9 +132,9 @@
--internal_skylark_flag_test_canary \
&>"$TEST_log" || fail "bazel build failed";
expect_log "In bzl: $MARKER" \
- "Skylark flags are not propagating to .bzl file evaluation"
+ "Starlark flags are not propagating to .bzl file evaluation"
expect_log "In macro: $MARKER" \
- "Skylark flags are not propagating to macro evaluation"
+ "Starlark flags are not propagating to macro evaluation"
}
function test_rule() {
@@ -166,7 +166,7 @@
--internal_skylark_flag_test_canary \
&>"$TEST_log" || fail "bazel build failed";
expect_log "In rule: $MARKER" \
- "Skylark flags are not propagating to rule implementation function evaluation"
+ "Starlark flags are not propagating to rule implementation function evaluation"
}
# TODO(brandjon): Once we're no long dropping print() output in computed default
@@ -211,7 +211,7 @@
--internal_skylark_flag_test_canary \
&>"$TEST_log" || fail "bazel build failed";
expect_log "In aspect: $MARKER" \
- "Skylark flags are not propagating to aspect implementation function evaluation"
+ "Starlark flags are not propagating to aspect implementation function evaluation"
}