Skip to content

Commit

Permalink
Allow --extra_execution_platforms to support overrides by making it n…
Browse files Browse the repository at this point in the history
…o longer "allowMultiple".

RELNOTES:
Subsequent settings of --extra_execution_platforms now override previous settings, instead of adding them to a list. If you currently set --extra_execution_platforms more than once, please migrate by passing a list of values to --extra_execution_platforms instead so that earlier values aren't overwritten.

current
--extra_execution_platforms=platform1
--extra_execution_platforms=platform2

future
--extra_execution_platforms=platform1,platform2
PiperOrigin-RevId: 515741836
Change-Id: I435f6a18482b1890d401ef31d5c4c94fde7e9ff3
  • Loading branch information
susinmotion authored and copybara-github committed Mar 10, 2023
1 parent aa6f23e commit c602cec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions site/en/docs/user-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,8 @@ The platforms that are available as execution platforms to run actions.
Platforms can be specified by exact target, or as a target pattern. These
platforms will be considered before those declared in the WORKSPACE file by
[register_execution_platforms()](/rules/lib/globals#register_execution_platforms).
This option accepts a comma-separated list of platforms in order of priority.
If the flag is passed multiple times, the most recent overrides.

#### `--extra_toolchains={{ "<var>" }}labels{{ "</var>" }}` {:#extra-toolchains}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public static boolean platformIsDefault(Label platform) {
@Option(
name = "extra_execution_platforms",
converter = CommaSeparatedOptionListConverter.class,
defaultValue = "null",
defaultValue = "",
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
allowMultiple = true,
effectTags = {OptionEffectTag.EXECUTION},
help =
"The platforms that are available as execution platforms to run actions. "
+ "Platforms can be specified by exact target, or as a target pattern. "
+ "These platforms will be considered before those declared in the WORKSPACE file by "
+ "register_execution_platforms().")
+ "register_execution_platforms(). This option may only be set once; later "
+ "instances will override earlier flag settings.")
public List<String> extraExecutionPlatforms;

@Option(
Expand Down

0 comments on commit c602cec

Please sign in to comment.