Make embedded_launcher true by default
embedded_launcher causes the python interpreter to be bundled in the built zip file. This is beneficial because: - You can export the built executable and run it on systems without python or an old version of python. The CI servers have python 3.7, so it's useful to update that. - Because the python version is known, the python sources will be precompiled. - It will start running the code directly from the zip file, without extracting the binary to a temporary directory like non-embedded launcher binaries. This is particuarly useful because some developers use the extracted files directly instead of using `importlib.resources`, so having the non-extracting implementation gives them a nudge in the right direction. Make embedded_launcher the default so that more developers will do the right thing when developing python programs. Bug: 331488610 Test: Presubmits Change-Id: Ideb113a1d4d3b29ac04d57a48d111a99f77b2dfc
This commit is contained in:
@@ -203,7 +203,7 @@ func (p *PythonBinaryModule) OutputFiles(tag string) (android.Paths, error) {
|
||||
}
|
||||
|
||||
func (p *PythonBinaryModule) isEmbeddedLauncherEnabled() bool {
|
||||
return Bool(p.properties.Embedded_launcher)
|
||||
return BoolDefault(p.properties.Embedded_launcher, true)
|
||||
}
|
||||
|
||||
func (b *PythonBinaryModule) autorun() bool {
|
||||
|
@@ -59,7 +59,7 @@ type VersionProperties struct {
|
||||
// list of the Python libraries used only for this Python version.
|
||||
Libs []string `android:"arch_variant"`
|
||||
|
||||
// whether the binary is required to be built with embedded launcher for this version, defaults to false.
|
||||
// whether the binary is required to be built with embedded launcher for this version, defaults to true.
|
||||
Embedded_launcher *bool // TODO(b/174041232): Remove this property
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user