Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24cf036b authored by Ivan Lozano's avatar Ivan Lozano
Browse files

rust: Don't produce apex variants if apex_exclude

The apex variants of apex_exclude modules were leading to a mixing of
apex and non-apex dependencies in their dependency trees, causing
StableId collisions when an -L path for both variants was emitted
to the rustc command.

Since we already exclude these variants from apexes (they are
effectively serving as a stop-gap for stub support), don't produce apex
variants if apex_exclude is true.

Bug: 203478530
Test: m
Change-Id: I1448ce1aad989b8a97fd31552a00afa7e6b78829
parent 13e719c0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1756,6 +1756,16 @@ func (mod *Module) HostToolPath() android.OptionalPath {

var _ android.ApexModule = (*Module)(nil)

// If a module is marked for exclusion from apexes, don't provide apex variants.
// TODO(b/362509506): remove this once stubs are properly supported by rust_ffi targets.
func (m *Module) CanHaveApexVariants() bool {
	if m.ApexExclude() {
		return false
	} else {
		return m.ApexModuleBase.CanHaveApexVariants()
	}
}

func (mod *Module) MinSdkVersion() string {
	return String(mod.Properties.Min_sdk_version)
}