diff mbox series

[v2,5/5] sanity.bbclass: do not check for presence of distutils

Message ID 20221109202112.2035727-5-alex@linutronix.de
State New
Headers show
Series [v2,1/5] python3: correctly adjust include paths in sysconfigdata | expand

Commit Message

Alexander Kanavin Nov. 9, 2022, 8:21 p.m. UTC
This will be removed in 3.12 and has been deprecated for a while.

If anything breaks because of its absence on the host, this would
expose the breakage so it can be fixed.

icu source specifically does not refer to distutils anywhere.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes-global/sanity.bbclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Martin Jansa Feb. 26, 2024, 8:30 p.m. UTC | #1
On Wed, Nov 9, 2022 at 9:21 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> This will be removed in 3.12 and has been deprecated for a while.
>
> If anything breaks because of its absence on the host, this would
> expose the breakage so it can be fixed.

I've sent a fix for glib-2.0-native yesterday:
https://lists.openembedded.org/g/openembedded-core/message/196136
which is now queued in master-next

> icu source specifically does not refer to distutils anywhere.

yes, that was removed in 65-1 release with
https://github.com/unicode-org/icu/commit/b4d41b0561b6e8de38b99850ce0e4be8ef536bb1

FWIW: in gentoo with python-3.12.1 I can still use distutils (provided
by setuptools):
$ python3.12
Python 3.12.2 (main, Feb 17 2024, 22:28:14) [GCC 13.2.1 20240210] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils
>>>

so I've noticed this issue only after ubuntu-24.04 switched the
default python3 from 3.11 to 3.12 and my Dockerfile was installing
only python3-distutils, not python3-setuptools:

# python3-distutils is needed by few components:
# icu-native, ovmf-native:
# x86_64-linux/icu-native/64.2-r0/temp/log.do_configure.28031:ModuleNotFoundError:
No module named 'distutils.sysconfig'
# x86_64-linux/ovmf-native/edk2-stable201905-r0/temp/log.do_compile.67451:Python
reported: "No module named 'distutils.util"
# in Ubuntu the python3 package doesn't pull python3-distutils:
# python3 -m distutils.sysconfig
# /usr/bin/python3: No module named distutils.sysconfig

# This issue with icu-native with Yocto 3.0 Zeus was discussed here:
# https://www.yoctoproject.org/pipermail/yocto/2019-October/047169.html
# https://www.mail-archive.com/yocto@yoctoproject.org/msg46284.html
# icu-native/65.1 and newer (in Yocto 3.1 Dunfell) doesn't need
python3-distutils
# anymore, it was removed here:
# https://github.com/unicode-org/icu/commit/b4d41b0561b6e8de38b99850ce0e4be8ef536bb1

# Re-reported upstream in:
# http://lists.openembedded.org/pipermail/openembedded-core/2020-March/293984.html

RUN apt-get install -y python3-distutils

Not sure what to do with python-3.12 in kirkstone, icu is fine there
(70.1), ovmf-native should be fine as well (distutils removed in
edk2-stable202108-rc0:
https://github.com/tianocore/edk2/commit/fc50df0d8eb5331b6641daeedd7f05ae75014ece
https://github.com/tianocore/edk2/commit/0b1b0a9674e27c858f05436ed92250f4498245cf
kirkstone has edk2-stable202202)

So we might be able to drop it as well with only that glib-2.0 fix
backported to kirkstone.

+Steve if he agrees with this plan for kirkstone or would prefer not
to support python 3.12 there.

Cheers,

>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  meta/classes-global/sanity.bbclass | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
> index 606444cae1..38f4a4b22f 100644
> --- a/meta/classes-global/sanity.bbclass
> +++ b/meta/classes-global/sanity.bbclass
> @@ -625,11 +625,9 @@ def check_sanity_version_change(status, d):
>      # never again until the sanity version or host distrubution id/version changes.
>
>      # Check the python install is complete. Examples that are often removed in
> -    # minimal installations: glib-2.0-natives requries # xml.parsers.expat and icu
> -    # requires distutils.sysconfig.
> +    # minimal installations: glib-2.0-natives requries # xml.parsers.expat
>      try:
>          import xml.parsers.expat
> -        import distutils.sysconfig
>      except ImportError as e:
>          status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name)
>
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#173054): https://lists.openembedded.org/g/openembedded-core/message/173054
> Mute This Topic: https://lists.openembedded.org/mt/94921928/3617156
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Martin.Jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index 606444cae1..38f4a4b22f 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -625,11 +625,9 @@  def check_sanity_version_change(status, d):
     # never again until the sanity version or host distrubution id/version changes.
 
     # Check the python install is complete. Examples that are often removed in
-    # minimal installations: glib-2.0-natives requries # xml.parsers.expat and icu
-    # requires distutils.sysconfig.
+    # minimal installations: glib-2.0-natives requries # xml.parsers.expat
     try:
         import xml.parsers.expat
-        import distutils.sysconfig
     except ImportError as e:
         status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name)