aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java
index c58334d450..6792e4e3f7 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleImplementationFunctions.java
@@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.Artifact;
+import com.google.devtools.build.lib.actions.RunfilesSupplier;
import com.google.devtools.build.lib.actions.extra.SpawnInfo;
import com.google.devtools.build.lib.analysis.AbstractConfiguredTarget;
import com.google.devtools.build.lib.analysis.CommandHelper;
@@ -196,14 +197,16 @@ public class SkylarkRuleImplementationFunctions {
+ "for useful keys."
),
@Param(
+ // TODO(bazel-team): The name here isn't accurate anymore. This is technically experimental,
+ // so folks shouldn't be too attached, but consider renaming to be more accurate/opaque.
name = "input_manifests",
- type = SkylarkDict.class,
+ type = SkylarkList.class,
noneable = true,
defaultValue = "None",
named = true,
positional = false,
doc =
- "sets the map of input manifests files; "
+ "(Experimental) sets the input runfiles metadata; "
+ "they are typically generated by resolve_command."
)
},
@@ -317,14 +320,9 @@ public class SkylarkRuleImplementationFunctions {
"execution_requirements")));
}
if (inputManifestsUnchecked != Runtime.NONE) {
- for (Map.Entry<PathFragment, Artifact> entry :
- SkylarkDict.castSkylarkDictOrNoneToDict(
- inputManifestsUnchecked,
- PathFragment.class,
- Artifact.class,
- "input manifest file map")
- .entrySet()) {
- builder.addInputManifest(entry.getValue(), entry.getKey());
+ for (RunfilesSupplier supplier : SkylarkList.castSkylarkListOrNoneToList(
+ inputManifestsUnchecked, RunfilesSupplier.class, "runfiles suppliers")) {
+ builder.addRunfilesSupplier(supplier);
}
}
// Always register the action
@@ -465,7 +463,7 @@ public class SkylarkRuleImplementationFunctions {
throws EvalException, ConversionException {
RuleContext ruleContext = ctx.getRuleContext();
Action action =
- new PseudoAction<SpawnInfo>(
+ new PseudoAction<>(
generateUuid(ruleContext),
ruleContext.getActionOwner(),
convertInputs(inputs),
@@ -661,7 +659,7 @@ public class SkylarkRuleImplementationFunctions {
private static Map<Label, Iterable<Artifact>> checkLabelDict(
Map<?, ?> labelDict, Location loc)
throws EvalException {
- Map<Label, Iterable<Artifact>> convertedMap = new HashMap<Label, Iterable<Artifact>>();
+ Map<Label, Iterable<Artifact>> convertedMap = new HashMap<>();
for (Map.Entry<?, ?> entry : labelDict.entrySet()) {
Object key = entry.getKey();
if (!(key instanceof Label)) {
@@ -695,12 +693,14 @@ public class SkylarkRuleImplementationFunctions {
@SkylarkSignature(
name = "resolve_command",
+ // TODO(bazel-team): The naming here isn't entirely accurate (input_manifests is no longer
+ // manifests), but this is experimental/should be opaque to the end user.
doc =
"<i>(Experimental)</i> "
+ "Returns a tuple <code>(inputs, command, input_manifests)</code> of the list of "
- + "resolved inputs, the argv list for the resolved command, and the dict mapping "
- + "locations to runfiles required to run the command, all of them suitable for passing "
- + "as the same-named arguments of the <code>ctx.action</code> method.",
+ + "resolved inputs, the argv list for the resolved command, and the runfiles metadata"
+ + "required to run the command, all of them suitable for passing as the same-named "
+ + "arguments of the <code>ctx.action</code> method.",
objectType = SkylarkRuleContext.class,
returnType = Tuple.class,
parameters = {
@@ -823,7 +823,7 @@ public class SkylarkRuleImplementationFunctions {
return Tuple.<Object>of(
new MutableList(inputs, env),
new MutableList(argv, env),
- helper.getRemoteRunfileManifestMap());
+ helper.getToolsRunfilesSuppliers());
}
};