Skip to content

Commit

Permalink
BEGIN_PUBLIC
Browse files Browse the repository at this point in the history
Final removal of `copy_from_rule` from exec_groups.

See #17668.
END_PUBLIC

PiperOrigin-RevId: 518213763
Change-Id: I9411481b44c65bb79928492457ec3b0a4d33da73
  • Loading branch information
kotlaja authored and copybara-github committed Mar 21, 2023
1 parent 4973166 commit f48412f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1045,19 +1045,8 @@ public Label label(Object input, StarlarkThread thread) throws EvalException {

@Override
public ExecGroup execGroup(
Sequence<?> toolchains,
Sequence<?> execCompatibleWith,
Boolean copyFromRule,
StarlarkThread thread)
Sequence<?> toolchains, Sequence<?> execCompatibleWith, StarlarkThread thread)
throws EvalException {
if (copyFromRule) {
if (!toolchains.isEmpty() || !execCompatibleWith.isEmpty()) {
throw Starlark.errorf(
"An exec group cannot set copy_from_rule=True and declare toolchains or constraints.");
}
return ExecGroup.copyFromDefault();
}

ImmutableSet<ToolchainTypeRequirement> toolchainTypes = parseToolchainTypes(toolchains, thread);
ImmutableSet<Label> constraints = parseExecCompatibleWith(execCompatibleWith, thread);
return ExecGroup.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,21 +756,9 @@ StarlarkAspectApi aspect(
positional = false,
defaultValue = "[]",
doc = "A list of constraints on the execution platform."),
@Param(
name = "copy_from_rule",
defaultValue = "False",
named = true,
positional = false,
doc =
"If set to true, this exec group inherits the toolchains and constraints of the"
+ " rule to which this group is attached. If set to any other string this will"
+ " throw an error.")
},
useStarlarkThread = true)
ExecGroupApi execGroup(
Sequence<?> execCompatibleWith,
Sequence<?> toolchains,
Boolean copyFromRule,
StarlarkThread thread)
Sequence<?> execCompatibleWith, Sequence<?> toolchains, StarlarkThread thread)
throws EvalException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,7 @@ public StarlarkAspectApi aspect(

@Override
public ExecGroupApi execGroup(
Sequence<?> execCompatibleWith,
Sequence<?> toolchains,
Boolean copyFromRule,
StarlarkThread thread) {
Sequence<?> execCompatibleWith, Sequence<?> toolchains, StarlarkThread thread) {
return new FakeExecGroup();
}

Expand Down

0 comments on commit f48412f

Please sign in to comment.