diff --git a/context.go b/context.go index e99bbcb..7e4979c 100644 --- a/context.go +++ b/context.go @@ -1548,6 +1548,11 @@ func (c *Context) addDependency(module *moduleInfo, tag DependencyTag, depName s return nil } + if c.allowMissingDependencies { + // Allow missing variants. + return c.discoveredMissingDependencies(module, depName+c.prettyPrintVariant(module.dependencyVariant)) + } + return []error{&BlueprintError{ Err: fmt.Errorf("dependency %q of %q missing variant:\n %s\navailable variants:\n %s", depName, module.Name(), @@ -1578,6 +1583,11 @@ func (c *Context) findReverseDependency(module *moduleInfo, destName string) (*m return m, nil } + if c.allowMissingDependencies { + // Allow missing variants. + return module, c.discoveredMissingDependencies(module, destName+c.prettyPrintVariant(module.dependencyVariant)) + } + return nil, []error{&BlueprintError{ Err: fmt.Errorf("reverse dependency %q of %q missing variant:\n %s\navailable variants:\n %s", destName, module.Name(), @@ -1638,6 +1648,10 @@ func (c *Context) addVariationDependency(module *moduleInfo, variations []Variat } if foundDep == nil { + if c.allowMissingDependencies { + // Allow missing variants. + return c.discoveredMissingDependencies(module, depName+c.prettyPrintVariant(newVariant)) + } return []error{&BlueprintError{ Err: fmt.Errorf("dependency %q of %q missing variant:\n %s\navailable variants:\n %s", depName, module.Name(),