Allow missing variants when allowMissingDependencies=true

This commit is contained in:
Paul Duffin 2020-03-24 19:01:20 +00:00
parent 215230a3e8
commit b77556bdca

View file

@ -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(),