Merge pull request #292 from paulduffin/master

Allow missing variants when allowMissingDependencies=true
This commit is contained in:
colincross 2020-04-01 15:13:27 -07:00 committed by GitHub
commit ef33c90fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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