summaryrefslogtreecommitdiff
path: root/rust/project_json.go
diff options
context:
space:
mode:
author Matthew Maurer <mmaurer@google.com> 2024-04-30 23:06:05 +0000
committer Matthew Maurer <mmaurer@google.com> 2024-04-30 23:26:29 +0000
commitc1e0cb695bf8359d2350a33904a3162ac5a5ec38 (patch)
tree70db742bc63a3318c2931dd817b44edbc0a6807f /rust/project_json.go
parent0dd436cd0a165aa5fe5c317c803b494f91a8844a (diff)
rust: Don't suppress adding deps for rust-project.json device override
When switching from an initially found host module to a later found device module, we passed `cInfo.Deps` through. This actually suppresses addition of some modules, which was not the intention. Bug: 336695421 Test: SOONG_GEN_RUST_PROJECT=1 m blueprint_tests Test: check rust-projects.json manually afterwards for deps Change-Id: Ib90f9c755e07f88e85a3b3cbd9bc698cce8af038
Diffstat (limited to 'rust/project_json.go')
-rw-r--r--rust/project_json.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/rust/project_json.go b/rust/project_json.go
index ad9b69020..05fc09b3a 100644
--- a/rust/project_json.go
+++ b/rust/project_json.go
@@ -96,7 +96,7 @@ func (singleton *projectGeneratorSingleton) mergeDependencies(ctx android.Single
var childId int
cInfo, known := singleton.knownCrates[rChild.Name()]
if !known {
- childId, ok = singleton.addCrate(ctx, rChild, make(map[string]int))
+ childId, ok = singleton.addCrate(ctx, rChild)
if !ok {
return
}
@@ -128,7 +128,8 @@ func isModuleSupported(ctx android.SingletonContext, module android.Module) (*Mo
// addCrate adds a crate to singleton.project.Crates ensuring that required
// dependencies are also added. It returns the index of the new crate in
// singleton.project.Crates
-func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContext, rModule *Module, deps map[string]int) (int, bool) {
+func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContext, rModule *Module) (int, bool) {
+ deps := make(map[string]int)
rootModule, err := rModule.compiler.checkedCrateRootPath()
if err != nil {
return 0, false
@@ -180,7 +181,7 @@ func (singleton *projectGeneratorSingleton) appendCrateAndDependencies(ctx andro
if cInfo, ok := singleton.knownCrates[module.Name()]; ok {
// If we have a new device variant, override the old one
if !cInfo.Device && rModule.Device() {
- singleton.addCrate(ctx, rModule, cInfo.Deps)
+ singleton.addCrate(ctx, rModule)
return
}
crate := singleton.project.Crates[cInfo.Idx]
@@ -188,7 +189,7 @@ func (singleton *projectGeneratorSingleton) appendCrateAndDependencies(ctx andro
singleton.project.Crates[cInfo.Idx] = crate
return
}
- singleton.addCrate(ctx, rModule, make(map[string]int))
+ singleton.addCrate(ctx, rModule)
}
func (singleton *projectGeneratorSingleton) GenerateBuildActions(ctx android.SingletonContext) {