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 com .google .devtools .build .lib .packages .semantics .BuildLanguageOptions ;
20
21
import net .starlark .java .annot .Param ;
@@ -465,6 +466,25 @@ void symlink(
465
466
+ " <code>--experimental_action_resource_set</code> is false, the default"
466
467
+ " values are used.<p>The callback must be top-level (lambda and nested"
467
468
+ " functions aren't allowed)." ),
469
+ @ Param (
470
+ name = "toolchain" ,
471
+ allowedTypes = {
472
+ @ ParamType (type = Label .class ),
473
+ @ ParamType (type = String .class ),
474
+ @ ParamType (type = NoneType .class ),
475
+ },
476
+ defaultValue = "None" ,
477
+ named = true ,
478
+ positional = false ,
479
+ doc =
480
+ "<p>Toolchain type of the executable or tools used in this action. The parameter"
481
+ + " must be set, so that, the action executes on the correct execution"
482
+ + " platform. </p><p>It's a no-op right now, but we recommend to set it when a"
483
+ + " toolchain is used, because it will be required in the future Bazel"
484
+ + " releases.</p><p>Note that the rule which creates this action needs to"
485
+ + " define this toolchain inside its 'rule()' function.</p><p>When `toolchain`"
486
+ + " and `exec_group` parameters are both set, `exec_group` will be used. An"
487
+ + " error is raised in case the `exec_group` doesn't specify the same." ),
468
488
})
469
489
void run (
470
490
Sequence <?> outputs ,
@@ -481,7 +501,8 @@ void run(
481
501
Object inputManifestsUnchecked ,
482
502
Object execGroupUnchecked ,
483
503
Object shadowedAction ,
484
- Object resourceSetUnchecked )
504
+ Object resourceSetUnchecked ,
505
+ Object toolchainUnchecked )
485
506
throws EvalException ;
486
507
487
508
@ StarlarkMethod (
@@ -682,6 +703,26 @@ void run(
682
703
doc =
683
704
"A callback function for estimating resource usage if run locally. See"
684
705
+ "<a href=\" #run.resource_set\" ><code>ctx.actions.run()</code></a>." ),
706
+ @ Param (
707
+ name = "toolchain" ,
708
+ allowedTypes = {
709
+ @ ParamType (type = Label .class ),
710
+ @ ParamType (type = String .class ),
711
+ @ ParamType (type = NoneType .class ),
712
+ },
713
+ defaultValue = "None" ,
714
+ named = true ,
715
+ positional = false ,
716
+ doc =
717
+ "<p>Toolchain type of the executable or tools used in this action. The parameter"
718
+ + " must be set, so that, the action executes on the correct execution"
719
+ + " platform. </p><p>It's a no-op right now, but we recommend to set it when a"
720
+ + " toolchain is used, because it will be required in the future Bazel"
721
+ + " releases.</p><p>Note that the rule which creates this action needs to"
722
+ + " define this toolchain inside its 'rule()' function.</p><p>When `toolchain`"
723
+ + " and `exec_group` parameters are both set, `exec_group` will be used. An"
724
+ + " error is raised in case the `exec_group` doesn't specify the same."
725
+ + " toolchain.</p>" ),
685
726
})
686
727
void runShell (
687
728
Sequence <?> outputs ,
@@ -697,7 +738,8 @@ void runShell(
697
738
Object inputManifestsUnchecked ,
698
739
Object execGroupUnchecked ,
699
740
Object shadowedAction ,
700
- Object resourceSetUnchecked )
741
+ Object resourceSetUnchecked ,
742
+ Object toolchainUnchecked )
701
743
throws EvalException ;
702
744
703
745
@ StarlarkMethod (
0 commit comments