summaryrefslogtreecommitdiff
path: root/java/bootclasspath.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-04-26 13:55:36 +0100
committer Paul Duffin <paulduffin@google.com> 2021-04-27 15:56:47 +0100
commit81667c8c11ec6a37f10e893de2ec7fc6eb2ad2ac (patch)
tree5c4bc1b5e15668b530272311586195f47052d86d /java/bootclasspath.go
parentc86058876314c04ed0d8e7cdff7e3b9319611997 (diff)
Remove panics from reportMissingVariationDependency
The code that has been removed triggers in many cases when it should not, e.g. an unknown module on the bootclasspath. The code was originally added to try and ensure that if the attempt to add useful error messages failed it would help debug the issue. However, it ended up just creating more failures. If this does become an issue then this will be revisited. Bug: 177892522 Test: Add an unknown module to PRODUCT_BOOT_JARS m SOONG_ALLOW_MISSING_DEPENDENCIES=true Change-Id: I08dbd4b29d301f3f1f78a0fb396687062b47deb8
Diffstat (limited to 'java/bootclasspath.go')
-rw-r--r--java/bootclasspath.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/java/bootclasspath.go b/java/bootclasspath.go
index 6ca0f7533..c16193d73 100644
--- a/java/bootclasspath.go
+++ b/java/bootclasspath.go
@@ -15,9 +15,8 @@
package java
import (
- "fmt"
-
"android/soong/android"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -116,15 +115,7 @@ func addDependencyOntoApexModulePair(ctx android.BottomUpMutatorContext, apex st
// reportMissingVariationDependency intentionally adds a dependency on a missing variation in order
// to generate an appropriate error message with information about the available variations.
func reportMissingVariationDependency(ctx android.BottomUpMutatorContext, variations []blueprint.Variation, name string) {
- modules := ctx.AddFarVariationDependencies(variations, nil, name)
- if len(modules) != 1 {
- panic(fmt.Errorf("Internal Error: expected one module, found %d", len(modules)))
- return
- }
- if modules[0] != nil {
- panic(fmt.Errorf("Internal Error: expected module to be missing but was found: %q", modules[0]))
- return
- }
+ ctx.AddFarVariationDependencies(variations, nil, name)
}
// ApexVariantReference specifies a particular apex variant of a module.