Merge "Fix invalid memory error for python binary build"

This commit is contained in:
Nan Zhang 2018-09-27 20:31:40 +00:00 committed by Gerrit Code Review
commit 8202ad2f9a
2 changed files with 6 additions and 6 deletions

View File

@ -84,15 +84,15 @@ func (binary *binaryDecorator) bootstrap(ctx android.ModuleContext, actualVersio
main := binary.getPyMainFile(ctx, srcsPathMappings)
var launcherPath android.Path
var launcherPath android.OptionalPath
if embeddedLauncher {
ctx.VisitDirectDepsWithTag(launcherTag, func(m android.Module) {
if provider, ok := m.(IntermPathProvider); ok {
if launcherPath != nil {
if launcherPath.Valid() {
panic(fmt.Errorf("launcher path was found before: %q",
launcherPath))
}
launcherPath = provider.IntermPathForModuleOut().Path()
launcherPath = provider.IntermPathForModuleOut()
}
})
}

View File

@ -70,7 +70,7 @@ func init() {
}
func registerBuildActionForParFile(ctx android.ModuleContext, embeddedLauncher bool,
launcherPath android.Path, interpreter, main, binName string,
launcherPath android.OptionalPath, interpreter, main, binName string,
srcsZips android.Paths) android.Path {
// .intermediate output path for merged zip file.
@ -104,9 +104,9 @@ func registerBuildActionForParFile(ctx android.ModuleContext, embeddedLauncher b
"srcsZips": strings.Join(srcsZips.Strings(), " "),
},
})
} else {
} else if launcherPath.Valid() {
// added launcherPath to the implicits Ninja dependencies.
implicits = append(implicits, launcherPath)
implicits = append(implicits, launcherPath.Path())
// .intermediate output path for entry_point.txt
entryPoint := android.PathForModuleOut(ctx, entryPointFile).String()