Skip host variant in `collectDepsMutator`
`fsGenState` currently stores the deps information key-d on the module
name. For modules with both host and device variants, the dep
information map is updated multiple times. This is usually benign, but
can return incorrect values if the host variant sets different values
for properties that are crucial for the classification heuristic (e.g.
compile_multilib, enabled, ...)
Update `collectDepsMutator` to update the deps information only for
device variants.
Test: verified that both variants of `libEGL_emulation` are installed in
the autogenerated vendor partition. At ToT, only 64-bit is installed
since the host variant sets `compile_multlib: 64`
Change-Id: Ib1add872b5ff1b170eb3a610d19d40010a6a3f7e
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index dc7becb..f838ae2 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -173,7 +173,7 @@
fsGenState := mctx.Config().Get(fsGenStateOnceKey).(*FsGenState)
m := mctx.Module()
- if slices.Contains(fsGenState.depCandidates, m.Name()) {
+ if m.Target().Os.Class == android.Device && slices.Contains(fsGenState.depCandidates, m.Name()) {
installPartition := m.PartitionTag(mctx.DeviceConfig())
fsGenState.fsDepsMutex.Lock()
// Only add the module as dependency when: