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

Commit 4db3298d authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Improve missing apex_available message"

parents 33050c13 df915ff3
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1976,7 +1976,7 @@ func (c *flattenedApexContext) InstallBypassMake() bool {
// Visit dependencies that contributes to the payload of this APEX
// Visit dependencies that contributes to the payload of this APEX
func (a *apexBundle) walkPayloadDeps(ctx android.ModuleContext,
func (a *apexBundle) walkPayloadDeps(ctx android.ModuleContext,
	do func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool)) {
	do func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool)) {
	ctx.WalkDepsBlueprint(func(child, parent blueprint.Module) bool {
	ctx.WalkDeps(func(child, parent android.Module) bool {
		am, ok := child.(android.ApexModule)
		am, ok := child.(android.ApexModule)
		if !ok || !am.CanHaveApexVariants() {
		if !ok || !am.CanHaveApexVariants() {
			return false
			return false
@@ -2037,7 +2037,11 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
		if externalDep || to.AvailableFor(apexName) || whitelistedApexAvailable(apexName, toName) {
		if externalDep || to.AvailableFor(apexName) || whitelistedApexAvailable(apexName, toName) {
			return
			return
		}
		}
		ctx.ModuleErrorf("%q requires %q that is not available for the APEX.", fromName, toName)
		message := ""
		for _, m := range ctx.GetWalkPath()[1:] {
			message = fmt.Sprintf("%s\n    -> %s", message, m.String())
		}
		ctx.ModuleErrorf("%q requires %q that is not available for the APEX. Dependency path:%s", fromName, toName, message)
	})
	})
}
}


+7 −1
Original line number Original line Diff line number Diff line
@@ -3538,7 +3538,13 @@ func TestApexAvailable_DirectDep(t *testing.T) {


func TestApexAvailable_IndirectDep(t *testing.T) {
func TestApexAvailable_IndirectDep(t *testing.T) {
	// libbbaz is an indirect dep
	// libbbaz is an indirect dep
	testApexError(t, "requires \"libbaz\" that is not available for the APEX", `
	testApexError(t, `requires "libbaz" that is not available for the APEX. Dependency path:
.*-> libfoo.*link:shared.*
.*-> libfoo.*link:static.*
.*-> libbar.*link:shared.*
.*-> libbar.*link:static.*
.*-> libbaz.*link:shared.*
.*-> libbaz.*link:static.*`, `
	apex {
	apex {
		name: "myapex",
		name: "myapex",
		key: "myapex.key",
		key: "myapex.key",