Merge "Fix missing rust dependencies when ALLOW_MISSING_DEPENDENCIES=true" into main
This commit is contained in:
19
rust/rust.go
19
rust/rust.go
@@ -1306,12 +1306,17 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
linkObject := ccDep.OutputFile()
|
linkObject := ccDep.OutputFile()
|
||||||
linkPath := linkPathFromFilePath(linkObject.Path())
|
|
||||||
|
|
||||||
if !linkObject.Valid() {
|
if !linkObject.Valid() {
|
||||||
ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
|
if !ctx.Config().AllowMissingDependencies() {
|
||||||
|
ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
|
||||||
|
} else {
|
||||||
|
ctx.AddMissingDependencies([]string{depName})
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
linkPath := linkPathFromFilePath(linkObject.Path())
|
||||||
|
|
||||||
exportDep := false
|
exportDep := false
|
||||||
switch {
|
switch {
|
||||||
case cc.IsStaticDepTag(depTag):
|
case cc.IsStaticDepTag(depTag):
|
||||||
@@ -1356,6 +1361,14 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
|||||||
// Re-get linkObject as ChooseStubOrImpl actually tells us which
|
// Re-get linkObject as ChooseStubOrImpl actually tells us which
|
||||||
// object (either from stub or non-stub) to use.
|
// object (either from stub or non-stub) to use.
|
||||||
linkObject = android.OptionalPathForPath(sharedLibraryInfo.SharedLibrary)
|
linkObject = android.OptionalPathForPath(sharedLibraryInfo.SharedLibrary)
|
||||||
|
if !linkObject.Valid() {
|
||||||
|
if !ctx.Config().AllowMissingDependencies() {
|
||||||
|
ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
|
||||||
|
} else {
|
||||||
|
ctx.AddMissingDependencies([]string{depName})
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
linkPath = linkPathFromFilePath(linkObject.Path())
|
linkPath = linkPathFromFilePath(linkObject.Path())
|
||||||
|
|
||||||
depPaths.linkDirs = append(depPaths.linkDirs, linkPath)
|
depPaths.linkDirs = append(depPaths.linkDirs, linkPath)
|
||||||
|
Reference in New Issue
Block a user