aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2023-03-10 06:37:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-03-10 06:37:24 +0000
commitcd70c8d107e005e9ec5876b16506a767faf8a82f (patch)
tree30ebca99efc4bea09ddbbab51bf16a37aed1647e
parentc3eb995eefef3f3d779d17895de3e9a2a101cdea (diff)
parent189905be98dd897fd73e27e35b1f5a7d97e01099 (diff)
downloadbuild-cd70c8d107e005e9ec5876b16506a767faf8a82f.tar.gz
Merge "Add BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES"
-rw-r--r--Changes.md18
-rw-r--r--core/board_config.mk1
-rw-r--r--core/soong_config.mk1
3 files changed, 19 insertions, 1 deletions
diff --git a/Changes.md b/Changes.md
index 8979e3091c..daebd5231a 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,21 @@
# Build System Changes for Android.mk Writers
+## Python 2 to 3 migration
+
+The path set when running builds now makes the `python` executable point to python 3,
+whereas on previous versions it pointed to python 2. If you still have python 2 scripts,
+you can change the shebang line to use `python2` explicitly. This only applies for
+scripts run directly from makefiles, or from soong genrules. This behavior can be
+temporarily overridden by setting the `BUILD_BROKEN_PYTHON_IS_PYTHON2` environment
+variable to `true`. It's only an environment variable and not a product config variable
+because product config sometimes calls python code.
+
+In addition, `python_*` soong modules no longer allow python 2. This can be temporarily
+overridden by setting the `BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES` product configuration
+variable to `true`.
+
+Python 2 is slated for complete removal in V.
+
## Stop referencing sysprop_library directly from cc modules
For the migration to Bazel, we are no longer mapping sysprop_library targets
@@ -818,7 +834,7 @@ for this option to exist.
### Stop using clang property
-Clang has been deleted from Soong. To fix any build errors, remove the clang
+The clang property has been deleted from Soong. To fix any build errors, remove the clang
property from affected Android.bp files using bpmodify.
diff --git a/core/board_config.mk b/core/board_config.mk
index 70c91a80b3..af059730ea 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -188,6 +188,7 @@ _build_broken_var_list := \
BUILD_BROKEN_PREBUILT_ELF_FILES \
BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
BUILD_BROKEN_USES_NETWORK \
+ BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES \
BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE \
BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 091fa343d5..0101796d8a 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -286,6 +286,7 @@ $(call add_json_bool, BuildBrokenClangCFlags, $(filter true,$(BUILD_
$(call add_json_bool, BuildBrokenDepfile, $(filter true,$(BUILD_BROKEN_DEPFILE)))
$(call add_json_bool, BuildBrokenEnforceSyspropOwner, $(filter true,$(BUILD_BROKEN_ENFORCE_SYSPROP_OWNER)))
$(call add_json_bool, BuildBrokenTrebleSyspropNeverallow, $(filter true,$(BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW)))
+$(call add_json_bool, BuildBrokenUsesSoongPython2Modules, $(filter true,$(BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES)))
$(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE)))
$(call add_json_list, BuildBrokenInputDirModules, $(BUILD_BROKEN_INPUT_DIR_MODULES))