From 339a63f04469ebf69a0b3ca729243eefd838a572 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 15 Aug 2023 22:17:03 -0400 Subject: Prepare soong for python 3.11 Due to upstream changes in python path calculations, I'm simplifying the python launcher to work more like a standard python distribution. This is effectively changing the stdlib path from `internal/stdlib` to `internal/python3.10` (or `3.11`, etc). This allows us to specify the zip file as PYTHONHOME, set PYTHONPLATLIBDIR to `internal` and use the default detection after that. That does mean during upgrades that the stdlib pkg path will change, so move the source vs prebuilt calculation from the Android.bp into Soong to choose which stdlib module to pick up (with the corresponding `pkg_path`) Bug: 278602456 Test: treehugger with python3.10 Test: a python3.11 source + 3.10 prebuilt build Test: a python3.11 source+prebuilt build Change-Id: I8b02e7b22a1f1d1e02819ae1a31a99cdc985542c --- python/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/builder.go') diff --git a/python/builder.go b/python/builder.go index 106649398..2553a7714 100644 --- a/python/builder.go +++ b/python/builder.go @@ -73,14 +73,14 @@ var ( precompile = pctx.AndroidStaticRule("precompilePython", blueprint.RuleParams{ Command: `LD_LIBRARY_PATH="$ldLibraryPath" ` + - `PYTHONPATH=$stdlibZip/internal/stdlib ` + + `PYTHONPATH=$stdlibZip/internal/$stdlibPkg ` + `$launcher build/soong/python/scripts/precompile_python.py $in $out`, CommandDeps: []string{ "$stdlibZip", "$launcher", "build/soong/python/scripts/precompile_python.py", }, - }, "stdlibZip", "launcher", "ldLibraryPath") + }, "stdlibZip", "stdlibPkg", "launcher", "ldLibraryPath") ) func init() { -- cgit v1.2.3-59-g8ed1b