Fix invalid memory error for python binary build
The root cause is we didn't check if the optionalpath is valid or not, the registerbuildation function directly invoke the path var and cause the invalid memory error. We just return if the launcher doesn't exist. The ctx.VisitDirectDepsWithTag() also handles allowmissingdependency so we are ok if launcher doesn't exist. Test: N/A Bug: b/116698229, b/67510844 Change-Id: I40941079a64d7797ab879fc5edaa29e835b493a0
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user