Handle nameless modules during bp2build conversion.

So far it is `package` module.

Test: treehugger
Change-Id: Ibf3af0b0bf0a532e2ea1d478275a5ac3784ef170
This commit is contained in:
Sasha Smundak
2022-08-04 11:13:27 -07:00
parent 8c6f4576ef
commit fb58949414
4 changed files with 19 additions and 11 deletions

View File

@@ -1169,7 +1169,9 @@ func (attrs *CommonAttributes) fillCommonBp2BuildModuleAttrs(ctx *topDownMutator
mod := ctx.Module().base()
// Assert passed-in attributes include Name
if len(attrs.Name) == 0 {
ctx.ModuleErrorf("CommonAttributes in fillCommonBp2BuildModuleAttrs expects a `.Name`!")
if ctx.ModuleType() != "package" {
ctx.ModuleErrorf("CommonAttributes in fillCommonBp2BuildModuleAttrs expects a `.Name`!")
}
}
depsToLabelList := func(deps []string) bazel.LabelListAttribute {