Fix the names of the dynamically inherited modules.

The module name passed to rbld.inherit should be its path without the suffix.

Bug: 215182113
Test: internal
Change-Id: Ic65a5b73037be84f31f8db29f71f793b6c6034bb
This commit is contained in:
Sasha Smundak
2022-01-18 10:31:14 -08:00
parent 7afffe6af0
commit 845cb29c2b
2 changed files with 12 additions and 12 deletions

View File

@@ -54,6 +54,10 @@ func (im moduleInfo) entryName() string {
return im.moduleLocalName + "_init"
}
func (mi moduleInfo) name() string {
return fmt.Sprintf("%q", MakePath2ModuleName(mi.originalPath))
}
type inheritedModule interface {
name() string
entryName() string
@@ -67,10 +71,6 @@ type inheritedStaticModule struct {
loadAlways bool
}
func (im inheritedStaticModule) name() string {
return fmt.Sprintf("%q", MakePath2ModuleName(im.originalPath))
}
func (im inheritedStaticModule) emitSelect(_ *generationContext) {
}
@@ -102,7 +102,7 @@ func (i inheritedDynamicModule) emitSelect(gctx *generationContext) {
gctx.indentLevel++
for _, mi := range i.candidateModules {
gctx.newLine()
gctx.writef(`"%s": (%q, %s),`, mi.originalPath, mi.moduleLocalName, mi.entryName())
gctx.writef(`"%s": (%s, %s),`, mi.originalPath, mi.name(), mi.entryName())
}
gctx.indentLevel--
gctx.newLine()