Fix bp2build select generation for inter-attribute soong config

variable usage.

There's bug a in the current soong_config_variable handling
implementation where a soong_config_variable sets conditions_default
value for an attr, and a non-conditions_default value for another attr.
This results in the former attr not properly setting the zero value for
the non-conditions_default select key, resulting in the pretty printer
omitting the attribute totally.

The current implementation in this CL ensures that the zero value is set
whenever this happens at the module level. This is seen in
library_linking_strategy_cc_defaults (see comments in code, and the new
tests)

Test: CI
Bug: 198556411

Change-Id: Ibaeb94508c51a7429fb7a08df610cbb5470f76d2
This commit is contained in:
Jingwen Chen
2021-11-17 12:14:41 +00:00
parent 228ef1e370
commit 58ff6801f4
6 changed files with 418 additions and 21 deletions

View File

@@ -417,6 +417,12 @@ type LabelListAttribute struct {
// This mode facilitates use of attribute defaults: an empty list should
// override the default.
ForceSpecifyEmptyList bool
// If true, signal the intent to the code generator to emit all select keys,
// even if the Includes list for that key is empty. This mode facilitates
// specific select statements where an empty list for a non-default select
// key has a meaning.
EmitEmptyList bool
}
type configurableLabelLists map[ConfigurationAxis]labelListSelectValues