diff options
author | 2023-02-13 23:17:40 +0000 | |
---|---|---|
committer | 2023-02-13 23:17:40 +0000 | |
commit | 909d237c842b45c5208018f4c396931757553ee1 (patch) | |
tree | d32c60bf82eb2879ba490ed61c38a0dec4a8057b /python/binary.go | |
parent | aa5b377ee956f2e7ff2e0fb6630f636ecfe15b84 (diff) |
Revert "Dynamically assemble the list of python launcher shared libs for precompiling"
This reverts commit aa5b377ee956f2e7ff2e0fb6630f636ecfe15b84.
Reason for revert: this broke musl builds by removing the install dependency from python binaries to the launcher shared libraries: https://android-build.googleplex.com/builds/submitted/9600042/unit_tests_x86_64_musl/latest/view/logs/build_error.log
Change-Id: I4e13f333f287831ba13724f13ab2be789a92b476
Diffstat (limited to 'python/binary.go')
-rw-r--r-- | python/binary.go | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/python/binary.go b/python/binary.go index 95c751a82..75135f345 100644 --- a/python/binary.go +++ b/python/binary.go @@ -125,25 +125,6 @@ func (p *PythonBinaryModule) buildBinary(ctx android.ModuleContext) { launcherPath = provider.IntermPathForModuleOut() } }) - - // TODO: get the list of shared libraries directly from the launcher module somehow - var sharedLibs []string - sharedLibs = append(sharedLibs, "libsqlite") - if ctx.Target().Os.Bionic() { - sharedLibs = append(sharedLibs, "libc", "libdl", "libm") - } - if ctx.Target().Os == android.LinuxMusl && !ctx.Config().HostStaticBinaries() { - sharedLibs = append(sharedLibs, "libc_musl") - } - switch p.properties.Actual_version { - case pyVersion2: - sharedLibs = append(sharedLibs, "libc++") - case pyVersion3: - if ctx.Device() { - sharedLibs = append(sharedLibs, "liblog") - } - } - p.androidMkSharedLibs = sharedLibs } srcsZips := make(android.Paths, 0, len(depsSrcsZips)+1) if embeddedLauncher { @@ -155,6 +136,14 @@ func (p *PythonBinaryModule) buildBinary(ctx android.ModuleContext) { p.installSource = registerBuildActionForParFile(ctx, embeddedLauncher, launcherPath, p.getHostInterpreterName(ctx, p.properties.Actual_version), main, p.getStem(ctx), srcsZips) + + var sharedLibs []string + // if embedded launcher is enabled, we need to collect the shared library dependencies of the + // launcher + for _, dep := range ctx.GetDirectDepsWithTag(launcherSharedLibTag) { + sharedLibs = append(sharedLibs, ctx.OtherModuleName(dep)) + } + p.androidMkSharedLibs = sharedLibs } func (p *PythonBinaryModule) AndroidMkEntries() []android.AndroidMkEntries { @@ -187,7 +176,7 @@ func (p *PythonBinaryModule) DepsMutator(ctx android.BottomUpMutatorContext) { p.PythonLibraryModule.DepsMutator(ctx) if p.isEmbeddedLauncherEnabled() { - p.AddDepsOnPythonLauncherAndStdlib(ctx, pythonLibTag, launcherTag, p.autorun(), ctx.Target()) + p.AddDepsOnPythonLauncherAndStdlib(ctx, pythonLibTag, launcherTag, launcherSharedLibTag, p.autorun(), ctx.Target()) } } |