Skip to content

Commit

Permalink
fix: include namepace in rule name
Browse files Browse the repository at this point in the history
Bob's `genrule` plugin for Soong needs to consider
namespace within the rule name to avoid duplication
for module with the same name but from different
Soong namespaces.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I5cc2bf6dce3878ea589e6cc67e1d6c1f3dbae8d3
  • Loading branch information
birunts committed Oct 2, 2024
1 parent c1a68ea commit e4e9ec0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/genrulebob/genrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,13 @@ func (m *genrulebobCommon) writeNinjaRules(ctx android.ModuleContext, args map[s
ruleparams.Deps = blueprint.DepsGCC
}

rule := ctx.Rule(pctx, "bob_gen_"+ctx.ModuleName(), ruleparams, keys...)
var namespacePrefix string
namespace := ctx.Namespace().Path
if namespace != "." {
namespacePrefix = strings.ReplaceAll(namespace, "/", "_") + "_"
}

rule := ctx.Rule(pctx, "bob_gen_"+namespacePrefix+ctx.ModuleName(), ruleparams, keys...)

for _, io := range m.inouts {
// `args` is slightly different for each inout, but blueprint's
Expand Down

0 comments on commit e4e9ec0

Please sign in to comment.