Remove dependency from vendor_snapshot to each module
The 'vendor_snapshot' module is required to every cc_library to check
if the dependencies need to be rewritten to the snapshot modules or
not. However, as the 'vendor_snapshot' module has dependencies to the
snapshot modules, the dependency to the 'vendor_snapshot' module
creates circular dependencies.
The dependency from the 'vendor_snapshot' to the snapshot modules is
required only to read the module names of the snapshot modules. We
may remove the dependency by setting the name of the snapshot modules
directly.
Bug: 179666286
Test: m nothing
Change-Id: I14abcb06c5c81ef7f8535103578747385c89ae0f
diff --git a/cc/snapshot_prebuilt.go b/cc/snapshot_prebuilt.go
index 62daafd..69b9948 100644
--- a/cc/snapshot_prebuilt.go
+++ b/cc/snapshot_prebuilt.go
@@ -284,23 +284,14 @@
collectSnapshotMap := func(variations []blueprint.Variation, depTag blueprint.DependencyTag,
names []string, snapshotSuffix, moduleSuffix string) map[string]string {
- decoratedNames := make([]string, 0, len(names))
- for _, name := range names {
- decoratedNames = append(decoratedNames, name+
- snapshotSuffix+moduleSuffix+
- s.baseSnapshot.version()+
- "."+ctx.Arch().ArchType.Name)
- }
-
- deps := ctx.AddVariationDependencies(variations, depTag, decoratedNames...)
snapshotMap := make(map[string]string)
- for _, dep := range deps {
- if dep == nil {
- continue
- }
-
- snapshotMap[dep.(*Module).BaseModuleName()] = ctx.OtherModuleName(dep)
+ for _, name := range names {
+ snapshotMap[name] = name +
+ snapshotSuffix + moduleSuffix +
+ s.baseSnapshot.version() +
+ "." + ctx.Arch().ArchType.Name
}
+
return snapshotMap
}