Support repeated flags in platform mappings and platform-based flags #22453
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: feature request
This was discovered while implementing platform-based flags, #19409. Since this uses the same
BuildOptions.applyParsingResult
method as platform mappings, the same issue applies to both.A quick definition: a repeatable flag is a flag where repeated uses accumulate, instead of overwriting. This corresponds to using
@Option.allowMultiple
in a native flag or defining a Starlark flag usingconfig.string_list(repeatable = True)
. Commonly used flags that use this are--features
and--copt
.Currently, any repeatable flags used in platform mapping or platform based flags will overwrite any previous values. If any platforms set the
--features
flag, for example, this will remove any values set on the command line.Ideally we would either intelligently merge these, or at least warn users that it happens.
There are example tests that show the error: #22386 (see errors: https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/21626).
This is a tracking issue for dealing with this.
The text was updated successfully, but these errors were encountered: