diff --git a/cc/toolchains/args.bzl b/cc/toolchains/args.bzl index e15b039..29e3a1b 100644 --- a/cc/toolchains/args.bzl +++ b/cc/toolchains/args.bzl @@ -25,8 +25,8 @@ load( "ActionTypeSetInfo", "ArgsInfo", "ArgsListInfo", - "ExpandArgsInfo", "FeatureConstraintInfo", + "NestedArgsInfo", ) visibility("public") @@ -39,12 +39,12 @@ def _cc_args_impl(ctx): files = collect_files(ctx.attr.data) requires = collect_provider(ctx.attr.requires_any_of, FeatureConstraintInfo) - expand = None + nested = None if ctx.attr.args: - # TODO: This is temporary until cc_expand_args is implemented. - expand = ExpandArgsInfo( + # TODO: This is temporary until cc_nested_args is implemented. + nested = NestedArgsInfo( label = ctx.label, - expand = tuple(), + nested = tuple(), iterate_over = None, files = files, requires_types = {}, @@ -55,7 +55,7 @@ def _cc_args_impl(ctx): label = ctx.label, actions = actions, requires_any_of = tuple(requires), - expand = expand, + nested = nested, env = ctx.attr.env, files = files, ) diff --git a/cc/toolchains/cc_toolchain_info.bzl b/cc/toolchains/cc_toolchain_info.bzl index feb1697..8c0dcd5 100644 --- a/cc/toolchains/cc_toolchain_info.bzl +++ b/cc/toolchains/cc_toolchain_info.bzl @@ -45,12 +45,12 @@ ActionTypeSetInfo = provider( }, ) -ExpandArgsInfo = provider( +NestedArgsInfo = provider( doc = "A provider representation of Args.add/add_all/add_joined parameters", # @unsorted-dict-items fields = { "label": "(Label) The label defining this provider. Place in error messages to simplify debugging", - "expand": "(Sequence[ExpandArgsInfo]) The nested arg expansion. Mutually exclusive with args", + "nested": "(Sequence[NestedArgsInfo]) The nested arg expansion. Mutually exclusive with args", "iterate_over": "(Optional[str]) The variable to iterate over", "files": "(depset[File]) The files required to use this variable", "requires_types": "(dict[str, str]) A mapping from variables to their expected type name (not type). This means that we can require the generic type Option, rather than an Option[T]", @@ -65,7 +65,7 @@ ArgsInfo = provider( "label": "(Label) The label defining this provider. Place in error messages to simplify debugging", "actions": "(depset[ActionTypeInfo]) The set of actions this is associated with", "requires_any_of": "(Sequence[FeatureConstraintInfo]) This will be enabled if any of the listed predicates are met. Equivalent to with_features", - "expand": "(Optional[ExpandArgsInfo]) The args to expand. Equivalent to a flag group.", + "nested": "(Optional[NestedArgsInfo]) The args to expand. Equivalent to a flag group.", "files": "(depset[File]) Files required for the args", "env": "(dict[str, str]) Environment variables to apply", }, diff --git a/cc/toolchains/impl/legacy_converter.bzl b/cc/toolchains/impl/legacy_converter.bzl index e4e54bb..9f9d2a9 100644 --- a/cc/toolchains/impl/legacy_converter.bzl +++ b/cc/toolchains/impl/legacy_converter.bzl @@ -64,11 +64,11 @@ def convert_args(args): ] flag_sets = [] - if args.expand != None: + if args.nested != None: flag_sets.append(legacy_flag_set( actions = actions, with_features = with_features, - flag_groups = [args.expand.legacy_flag_group], + flag_groups = [args.nested.legacy_flag_group], )) env_sets = [] diff --git a/tests/rule_based_toolchain/subjects.bzl b/tests/rule_based_toolchain/subjects.bzl index f7eab87..628996e 100644 --- a/tests/rule_based_toolchain/subjects.bzl +++ b/tests/rule_based_toolchain/subjects.bzl @@ -23,11 +23,11 @@ load( "ActionTypeSetInfo", "ArgsInfo", "ArgsListInfo", - "ExpandArgsInfo", "FeatureConstraintInfo", "FeatureInfo", "FeatureSetInfo", "MutuallyExclusiveCategoryInfo", + "NestedArgsInfo", "ToolInfo", "ToolchainConfigInfo", ) @@ -106,8 +106,8 @@ _FeatureConstraintFactory = generate_factory( ), ) -_EXPAND_ARGS_FLAGS = dict( - expand = None, +_NESTED_ARGS_FLAGS = dict( + nested = None, files = _subjects.depset_file, iterate_over = optional_subject(_subjects.str), legacy_flag_group = unknown_subject, @@ -115,18 +115,18 @@ _EXPAND_ARGS_FLAGS = dict( ) # buildifier: disable=name-conventions -_FakeExpandArgsFactory = generate_factory( - ExpandArgsInfo, - "ExpandArgsInfo", - _EXPAND_ARGS_FLAGS, +_FakeNestedArgsFactory = generate_factory( + NestedArgsInfo, + "NestedArgsInfo", + _NESTED_ARGS_FLAGS, ) # buildifier: disable=name-conventions -_ExpandArgsFactory = generate_factory( - ExpandArgsInfo, - "ExpandArgsInfo", - _EXPAND_ARGS_FLAGS | dict( - expand = ProviderSequence(_FakeExpandArgsFactory), +_NestedArgsFactory = generate_factory( + NestedArgsInfo, + "NestedArgsInfo", + _NESTED_ARGS_FLAGS | dict( + nested = ProviderSequence(_FakeNestedArgsFactory), ), ) @@ -139,7 +139,7 @@ _ArgsFactory = generate_factory( env = _subjects.dict, files = _subjects.depset_file, # Use .factory so it's not inlined. - expand = optional_subject(_ExpandArgsFactory.factory), + nested = optional_subject(_NestedArgsFactory.factory), requires_any_of = ProviderSequence(_FeatureConstraintFactory), ), ) @@ -220,7 +220,7 @@ _ToolchainConfigFactory = generate_factory( FACTORIES = [ _ActionTypeFactory, _ActionTypeSetFactory, - _ExpandArgsFactory, + _NestedArgsFactory, _ArgsFactory, _ArgsListFactory, _MutuallyExclusiveCategoryFactory,