NoMorePython2: Difference between revisions
RossBurton (talk | contribs) (→Broken) |
RossBurton (talk | contribs) (→Broken) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
Python 2 is in maintenance mode and everyone should shift to Python 3. We've made the move in OpenEmbedded Core so that <tt>core-image-sato</tt> doesn't pull in Python 2, but Python 2 is still needed during the build. | Python 2 is in maintenance mode and everyone should shift to Python 3. We've made the move in OpenEmbedded Core so that <tt>core-image-sato</tt> doesn't pull in Python 2, but Python 2 is still needed during the build. | ||
There are two ways in which Python 2 is needed: | |||
# Use of <tt>/usr/bin/python</tt> on the host | |||
# Explicit dependency on <tt>python-native</tt> | |||
== Goal == | == Goal == | ||
Line 11: | Line 15: | ||
== Method == | == Method == | ||
To find implicit dependencies on the build host having Python 2, one option is to just remove Python 2 from your build host. Whilst this works, unless you're building inside a container this might not be feasible. The next best thing is to make the binary not executable briefly for the test builds. Sadly you can't remove Python 2 from <tt>HOSTTOOLS</tt> as several upstreams will explicitly poke around <tt>/usr/bin</tt> looking for a Python to run. | |||
To find recipes that depend on <tt>python-native</tt> then simply build an image/world/whatever with <tt>-g</tt> and search the resulting <tt>task-depends.dot</tt>. For example, building <tt>core-image-sato</tt> for <tt>intel-corei7-64</tt> results in: | |||
"core-image-sato.do_build" -> "bmap-tools-native.do_build" | |||
"bmap-tools-native.do_prepare_recipe_sysroot" -> "python-native.do_populate_sysroot" | |||
So, an image depends on <tt>bmap-tools-native</tt> which depends on Python 2. | |||
Patches, from ready to submit to utter hacks, are being collected in <tt>poky-contrib:ross/nopy2</tt>. | |||
== Status == | == Status == | ||
=== Done === | |||
* bmaptool | |||
* texinfo-dummy-native | |||
=== Patches Ready === | === Patches Ready === | ||
* ca-certificates | * ca-certificates (in ross/nopy2) | ||
* libsoup | * libsoup | ||
* grub | * grub | ||
Line 26: | Line 44: | ||
* xcb-proto (do all callers use py3) | * xcb-proto (do all callers use py3) | ||
=== Broken === | === Broken === | ||
* python3-pycairo ( | * python3-pycairo (new upstream uses distutils) | ||
* webkitgtk | |||
* ovmf | |||
* eglinfo-x11 eglinfo-fb (waf update?) | |||
** Waf uses Python 2 by default | ** Waf uses Python 2 by default | ||
** Add waf-native to oe-core | ** Add waf-native to oe-core | ||
** Extend waf class to invoke waf-native using Python 3 | ** Extend waf class to invoke waf-native using Python 3 | ||
** Use waf class in | ** Use waf class in recipe | ||
* | * SCons (scons 3 is working towards py3) | ||
=== Needs Python 2, actively refuses to use Python 3 === | === Needs Python 2, actively refuses to use Python 3 === | ||
* apr | * apr | ||
* qemu | * qemu (https://bugs.launchpad.net/qemu/+bug/1708462) |
Latest revision as of 12:40, 19 October 2017
No More Python 2!
Problem Statement
Python 2 is in maintenance mode and everyone should shift to Python 3. We've made the move in OpenEmbedded Core so that core-image-sato doesn't pull in Python 2, but Python 2 is still needed during the build.
There are two ways in which Python 2 is needed:
- Use of /usr/bin/python on the host
- Explicit dependency on python-native
Goal
To be able to build first core-image-sato and then world of OpenEmbedded Core without Python 2 being present on the host, or being built via python-native.
Method
To find implicit dependencies on the build host having Python 2, one option is to just remove Python 2 from your build host. Whilst this works, unless you're building inside a container this might not be feasible. The next best thing is to make the binary not executable briefly for the test builds. Sadly you can't remove Python 2 from HOSTTOOLS as several upstreams will explicitly poke around /usr/bin looking for a Python to run.
To find recipes that depend on python-native then simply build an image/world/whatever with -g and search the resulting task-depends.dot. For example, building core-image-sato for intel-corei7-64 results in:
"core-image-sato.do_build" -> "bmap-tools-native.do_build" "bmap-tools-native.do_prepare_recipe_sysroot" -> "python-native.do_populate_sysroot"
So, an image depends on bmap-tools-native which depends on Python 2.
Patches, from ready to submit to utter hacks, are being collected in poky-contrib:ross/nopy2.
Status
Done
- bmaptool
- texinfo-dummy-native
Patches Ready
- ca-certificates (in ross/nopy2)
- libsoup
- grub
- pseudo
- ninja
To Review
- xcb-proto (do all callers use py3)
Broken
- python3-pycairo (new upstream uses distutils)
- webkitgtk
- ovmf
- eglinfo-x11 eglinfo-fb (waf update?)
- Waf uses Python 2 by default
- Add waf-native to oe-core
- Extend waf class to invoke waf-native using Python 3
- Use waf class in recipe
- SCons (scons 3 is working towards py3)
Needs Python 2, actively refuses to use Python 3
- apr
- qemu (https://bugs.launchpad.net/qemu/+bug/1708462)