overlay profiles: Bump python to 3.12

Try to do it with in a kinda-sorta proper Gentoo way - with
PYTHON_TARGETS and PYTHON_SINGLE_TARGET variables in
make.defaults. Still need to disable all other versions of python,
otherwise our settings gets merged with settings from base Gentoo
profiles, which currently enable python 3.13. And we also need to keep
masking the other python versions, because emerge still for some
reason wants to install python 3.13 or 3.14 for some packages, despite
the settings in PYTHON_TARGETS.

We are not bumping to 3.13, because sec-policy/selinux-base
PYTHON_COMPAT is still on at most 3.12.

Note that this change still allows python 3.11 in PYTHON_TARGETS for a
transition period. Otherwise the SDK builds do not go past stage1. We
only restrict generic images to 3.12 only, otherwise we would end up
with two python version installed in sysext images.

Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
This commit is contained in:
Krzesimir Nowak 2026-01-06 16:43:47 +01:00
parent 06b03f1059
commit 5dfb62c7e8
5 changed files with 24 additions and 24 deletions

View File

@ -10,13 +10,13 @@ USE_EXPAND="${USE_EXPAND} GO_VERSION"
USE="${USE} -cracklib -cups -tcpd -berkdb"
# Use Python 3 as the default version
USE="${USE} -python_single_target_python2_7 python_single_target_python3_11"
USE="${USE} -python_targets_python2_7 python_targets_python3_11"
# Use Python 3.12 as the default version, allow python 3.11 for a transition.
PYTHON_SINGLE_TARGET="-pypy3_11 -python3_11 python3_12 -python3_13 -python3_14 -python3_13t -python3_14t"
PYTHON_TARGETS="-pypy3_11 python3_11 python3_12 -python3_13 -python3_14 -python3_13t -python3_14t"
# Use Python 3 as the default version
BOOTSTRAP_USE="${BOOTSTRAP_USE} -python_single_target_python2_7 python_single_target_python3_11"
BOOTSTRAP_USE="${BOOTSTRAP_USE} -python_targets_python2_7 python_targets_python3_11"
# Same as above, but for bootstrapping.
BOOTSTRAP_USE="${BOOTSTRAP_USE} -python_single_target_pypy3_11 -python_single_target_python3_11 python_single_target_python3_12 -python_single_target_python3_13 -python_single_target_python3_14 -python_single_target_python3_13t -python_single_target_python3_14t"
BOOTSTRAP_USE="${BOOTSTRAP_USE} -python_targets_pypy3_11 python_targets_python3_11 python_targets_python3_12 -python_targets_python3_13 -python_targets_python3_14 -python_targets_python3_13t -python_targets_python3_14t"
# Never install cron or cron jobs

View File

@ -11,9 +11,11 @@
# certificate store provided in NSS rather than the Gentoo/Debian package.
>=app-misc/ca-certificates-20000000
# Python 3.12 is in portage-stable (currently testing), so avoid picking it
# up. Update this to mask later versions when we switch to 3.11.
>=dev-lang/python-3.12
# Update engine needs updating to use a newer version of protobuf.
>=dev-libs/protobuf-22.0
# Do not install python versions that were "disabled" in
# PYTHON_TARGETS. For some reason emerge still insists on installing
# those as a dependency for some packages.
<dev-lang/python-3.11
>=dev-lang/python-3.13

View File

@ -1,20 +1,6 @@
# Never enable experimental code
kdbus
# We default to python 3.11 for now
python_targets_python2_7
python_single_target_python2_7
python_targets_python3_8
python_single_target_python3_8
python_targets_python3_9
python_single_target_python3_9
python_targets_python3_10
python_single_target_python3_10
python_targets_python3_12
python_single_target_python3_12
python_targets_python3_13
python_single_target_python3_13
# Unmask selinux so it can be enabled selectively in package.use
-selinux

View File

@ -3,6 +3,10 @@
FLATCAR_TYPE=generic
# Use Python 3.12 as the default version.
PYTHON_SINGLE_TARGET="-pypy3_11 -python3_11 python3_12 -python3_13 -python3_14 -python3_13t -python3_14t"
PYTHON_TARGETS="-pypy3_11 -python3_11 python3_12 -python3_13 -python3_14 -python3_13t -python3_14t"
USE="acpi usb cryptsetup policykit"
USE="${USE} -cros_host -expat -cairo -X -man"
USE="${USE} -acl -gpm -python"

View File

@ -0,0 +1,8 @@
# Copyright (c) 2026 The Flatcar Maintainers.
# Distributed under the terms of the GNU General Public License v2
# Do not install python versions that were "disabled" in
# PYTHON_TARGETS. For some reason emerge still insists on installing
# those as a dependency for some packages.
<dev-lang/python-3.12
>=dev-lang/python-3.13