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

Commit 89f36501 authored by Logan Chien's avatar Logan Chien Committed by android-build-merger
Browse files

Merge "Run ABI checks for shared libs exported by APEX" am: e87dae60

am: 0fa84ea0

Change-Id: I2d3f5be7c1b106faf385fc69894b6247a82e8509
parents f157e164 0fa84ea0
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ type ModuleContextIntf interface {
	isPgoCompile() bool
	isNDKStubLibrary() bool
	useClangLld(actx ModuleContext) bool
	isForPlatform() bool
	apexName() string
	hasStubsVariants() bool
	isStubs() bool
@@ -1056,10 +1057,6 @@ func (ctx *moduleContextImpl) shouldCreateSourceAbiDump() bool {
		// Host modules do not need ABI dumps.
		return false
	}
	if !ctx.mod.IsForPlatform() {
		// APEX variants do not need ABI dumps.
		return false
	}
	if ctx.isStubs() {
		// Stubs do not need ABI dumps.
		return false
@@ -1086,6 +1083,10 @@ func (ctx *moduleContextImpl) getVndkExtendsModuleName() string {
	return ctx.mod.getVndkExtendsModuleName()
}

func (ctx *moduleContextImpl) isForPlatform() bool {
	return ctx.mod.IsForPlatform()
}

func (ctx *moduleContextImpl) apexName() string {
	return ctx.mod.ApexName()
}
+13 −0
Original line number Diff line number Diff line
@@ -522,6 +522,19 @@ func (library *libraryDecorator) shouldCreateSourceAbiDump(ctx ModuleContext) bo
	if !ctx.shouldCreateSourceAbiDump() {
		return false
	}
	if !ctx.isForPlatform() {
		if !ctx.hasStubsVariants() {
			// Skip ABI checks if this library is for APEX but isn't exported.
			return false
		}
		if !Bool(library.Properties.Header_abi_checker.Enabled) {
			// Skip ABI checks if this library is for APEX and did not explicitly enable
			// ABI checks.
			// TODO(b/145608479): ABI checks should be enabled by default. Remove this
			// after evaluating the extra build time.
			return false
		}
	}
	return library.classifySourceAbiDump(ctx) != ""
}