15
15
package com .google .devtools .build .lib .starlarkbuildapi ;
16
16
17
17
import com .google .devtools .build .docgen .annot .DocCategory ;
18
+ import com .google .devtools .build .lib .cmdline .Label ;
18
19
import com .google .devtools .build .lib .collect .nestedset .Depset ;
19
20
import net .starlark .java .annot .Param ;
20
21
import net .starlark .java .annot .ParamType ;
@@ -457,6 +458,25 @@ void symlink(
457
458
+ " <code>--experimental_action_resource_set</code> is false, the default"
458
459
+ " values are used.<p>The callback must be top-level (lambda and nested"
459
460
+ " functions aren't allowed)." ),
461
+ @ Param (
462
+ name = "toolchain" ,
463
+ allowedTypes = {
464
+ @ ParamType (type = Label .class ),
465
+ @ ParamType (type = String .class ),
466
+ @ ParamType (type = NoneType .class ),
467
+ },
468
+ defaultValue = "None" ,
469
+ named = true ,
470
+ positional = false ,
471
+ doc =
472
+ "<p>Toolchain type of the executable or tools used in this action. The parameter"
473
+ + " must be set, so that, the action executes on the correct execution"
474
+ + " platform. </p><p>It's a no-op right now, but we recommend to set it when a"
475
+ + " toolchain is used, because it will be required in the future Bazel"
476
+ + " releases.</p><p>Note that the rule which creates this action needs to"
477
+ + " define this toolchain inside its 'rule()' function.</p><p>When `toolchain`"
478
+ + " and `exec_group` parameters are both set, `exec_group` will be used. An"
479
+ + " error is raised in case the `exec_group` doesn't specify the same." ),
460
480
})
461
481
void run (
462
482
Sequence <?> outputs ,
@@ -473,7 +493,8 @@ void run(
473
493
Object inputManifestsUnchecked ,
474
494
Object execGroupUnchecked ,
475
495
Object shadowedAction ,
476
- Object resourceSetUnchecked )
496
+ Object resourceSetUnchecked ,
497
+ Object toolchainUnchecked )
477
498
throws EvalException ;
478
499
479
500
@ StarlarkMethod (
@@ -674,6 +695,26 @@ void run(
674
695
doc =
675
696
"A callback function for estimating resource usage if run locally. See"
676
697
+ "<a href=\" #run.resource_set\" ><code>ctx.actions.run()</code></a>." ),
698
+ @ Param (
699
+ name = "toolchain" ,
700
+ allowedTypes = {
701
+ @ ParamType (type = Label .class ),
702
+ @ ParamType (type = String .class ),
703
+ @ ParamType (type = NoneType .class ),
704
+ },
705
+ defaultValue = "None" ,
706
+ named = true ,
707
+ positional = false ,
708
+ doc =
709
+ "<p>Toolchain type of the executable or tools used in this action. The parameter"
710
+ + " must be set, so that, the action executes on the correct execution"
711
+ + " platform. </p><p>It's a no-op right now, but we recommend to set it when a"
712
+ + " toolchain is used, because it will be required in the future Bazel"
713
+ + " releases.</p><p>Note that the rule which creates this action needs to"
714
+ + " define this toolchain inside its 'rule()' function.</p><p>When `toolchain`"
715
+ + " and `exec_group` parameters are both set, `exec_group` will be used. An"
716
+ + " error is raised in case the `exec_group` doesn't specify the same."
717
+ + " toolchain.</p>" ),
677
718
})
678
719
void runShell (
679
720
Sequence <?> outputs ,
@@ -689,7 +730,8 @@ void runShell(
689
730
Object inputManifestsUnchecked ,
690
731
Object execGroupUnchecked ,
691
732
Object shadowedAction ,
692
- Object resourceSetUnchecked )
733
+ Object resourceSetUnchecked ,
734
+ Object toolchainUnchecked )
693
735
throws EvalException ;
694
736
695
737
@ StarlarkMethod (
0 commit comments