Skip to contentSkip to conversation

u-boot: update to 2020.01-rc3 pre-release and drop py2 dependencies

PATCH New Alexander Kanavin 1 participant 5 messages Nov 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 u-boot: update to 2020.01-rc3 pre-release and drop py2 dependencies

---
 meta/recipes-bsp/u-boot/u-boot-common.inc                   | 5 ++++-
 ...-boot-fw-utils_2019.10.bb => u-boot-fw-utils_2020.01.bb} | 0
 .../{u-boot-tools_2019.10.bb => u-boot-tools_2020.01.bb}    | 0
 meta/recipes-bsp/u-boot/u-boot.inc                          | 6 +++---
 .../u-boot/{u-boot_2019.10.bb => u-boot_2020.01.bb}         | 0
 5 files changed, 7 insertions(+), 4 deletions(-)
 rename meta/recipes-bsp/u-boot/{u-boot-fw-utils_2019.10.bb => u-boot-fw-utils_2020.01.bb} (100%)
 rename meta/recipes-bsp/u-boot/{u-boot-tools_2019.10.bb => u-boot-tools_2020.01.bb} (100%)
 rename meta/recipes-bsp/u-boot/{u-boot_2019.10.bb => u-boot_2020.01.bb} (100%)
meta/recipes-bsp/u-boot/u-boot-common.inc +4 -1
index c3e458e9251..a0f9c41469e 100644
@@ -10,9 +10,12 @@ LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e"
 PE = "1"
 
+# Drop this line when updating to 2020.01 final
+PV = "2020.01~rc3"
+
 # We use the revision in order to avoid having to fetch it from the
 # repo during parse
-SRCREV = "61ba1244b548463dbfb3c5285b6b22e7c772c5bd"
+SRCREV = "d4a31e8ee5592072d8d5208b3e950cba2d89b6bd"
 
 SRC_URI = "git://git.denx.de/u-boot.git \
           "
meta/recipes-bsp/u-boot/u-boot-fw-utils_2020.01.bb renamed from meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.10.bb +0 -0
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.10.bb
rename to meta/recipes-bsp/u-boot/u-boot-fw-utils_2020.01.bb
meta/recipes-bsp/u-boot/u-boot-tools_2020.01.bb renamed from meta/recipes-bsp/u-boot/u-boot-tools_2019.10.bb +0 -0
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot-tools_2019.10.bb
rename to meta/recipes-bsp/u-boot/u-boot-tools_2020.01.bb
meta/recipes-bsp/u-boot/u-boot.inc +3 -3
index 9a754fd09b0..55d8b478701 100644
@@ -7,13 +7,13 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 DEPENDS += "kern-tools-native"
 
-inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1
+inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native
 
-DEPENDS += "swig-native python-native"
+DEPENDS += "swig-native"
 
 EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
-EXTRA_OEMAKE += 'PYTHON2=nativepython STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
+EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
 
 PACKAGECONFIG ??= "openssl"
 # u-boot will compile its own tools during the build, with specific
meta/recipes-bsp/u-boot/u-boot_2020.01.bb renamed from meta/recipes-bsp/u-boot/u-boot_2019.10.bb +0 -0
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot_2019.10.bb
rename to meta/recipes-bsp/u-boot/u-boot_2020.01.bb
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/5 python-native: don't cause a full regeneration of the built sources

From: Ross Burton <[email protected]>

When cross-compiling Python 2 you need a native pgen binary, but the cross recipe can't do this on it's own so we build it in python-native and install it.

The rule to build pgen was also causing a complete rebuild of all of the generated sources, which meant that building Python 2 needs a *host* Python 2.

This can be fixed by simply building pgen, as this is all we need to install.

[ YOCTO #13645 ]

---
 meta/recipes-devtools/python/python-native_2.7.17.bb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
meta/recipes-devtools/python/python-native_2.7.17.bb +3 -4
index 936810d9806..98805d998d5 100644
@@ -35,10 +35,9 @@ do_configure_append() {
 	autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
 }
 
-# Regenerate all of the generated files
-# This ensures that pgen and friends get created during the compile phase
-do_compile_prepend() {
-    oe_runmake regen-all
+# Cross-compiling Python needs a native pgen, build it here for use later.
+do_compile_append() {
+	oe_runmake Parser/pgen
 }
 
 do_install() {
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/5 python: clean up command overriding

In reply to Alexander Kanavin

From: Ross Burton <[email protected]>

There's no need to add HOSTPGEN or HOSTPYTHON variables when we can just override the existing PGEN and PYTHON_FOR_BUILD variables.

---
 .../01-use-proper-tools-for-cross-build.patch | 65 +------------------
 .../fix_for_using_different_libdir.patch      | 38 ++++-------
 meta/recipes-devtools/python/python_2.7.17.bb |  9 +--
 3 files changed, 20 insertions(+), 92 deletions(-)
meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch +3 -62
index e795a74b911..fa6c5ef1d7f 100644
@@ -1,29 +1,13 @@
-We need to ensure our host tools get run during build, not the freshly
-built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
+Unfortunately the explanation for these changes have been lost to the mists of
+time.
 
 Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Michael 'Mickey' Lauer <[email protected]>
-Signed-off-by: Paul Eggleton <[email protected]>
-
-Rebased for python-2.7.9
-Signed-off-by: Alejandro Hernandez <[email protected]>
-
-Rebased for python-2.7.14
-Signed-off-by: Derek Straka <[email protected]>
+Signed-off-by: Ross Burton <[email protected]>
 
 Index: Python-2.7.13/Makefile.pre.in
 ===================================================================
 --- Python-2.7.13.orig/Makefile.pre.in
 +++ Python-2.7.13/Makefile.pre.in
-@@ -245,6 +245,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
- ##########################################################################
- # Parser
- PGEN=		Parser/pgen$(EXE)
-+HOSTPGEN=	$(PGEN)$(EXE)
- 
- PSRCS=		\
- 		Parser/acceler.c \
 @@ -512,7 +513,7 @@ $(BUILDPYTHON):	Modules/python.o $(LIBRA
  			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
  
@@ -33,49 +17,6 @@ Index: Python-2.7.13/Makefile.pre.in
  
  # Create build directory and generate the sysconfig build-time data there.
  # pybuilddir.txt contains the name of the build dir and is used for
-@@ -663,7 +663,7 @@
- 	# Regenerate Include/graminit.h and Python/graminit.c
- 	# from Grammar/Grammar using pgen
- 	@$(MKDIR_P) Include
--	$(PGEN) $(srcdir)/Grammar/Grammar \
-+	$(HOSTPGEN) $(srcdir)/Grammar/Grammar \
- 		$(srcdir)/Include/graminit.h \
- 		$(srcdir)/Python/graminit.c
- 
-@@ -1121,27 +1122,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
- 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
- 	fi
- 	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-+		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- 		-d $(LIBDEST) -f \
- 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- 		$(DESTDIR)$(LIBDEST)
- 	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-+		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- 		-d $(LIBDEST) -f \
- 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- 		$(DESTDIR)$(LIBDEST)
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-+		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- 		-d $(LIBDEST)/site-packages -f \
- 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-+		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- 		-d $(LIBDEST)/site-packages -f \
- 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-+		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
-+		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
- 
- # Create the PLATDIR source directory, if one wasn't distributed..
- $(srcdir)/Lib/$(PLATDIR):
 Index: Python-2.7.13/setup.py
 ===================================================================
 --- Python-2.7.13.orig/setup.py
meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch +14 -24
index 5f7309367c4..eeb6833186e 100644
@@ -1,19 +1,9 @@
-Upstream-Status: Inappropriate [Embedded specific]
-
 This patch fixes issuing with different libdir like lib64.
 This patch makes the native python binary modules findable
 in the install process of the host python.
 
-Signed-off-by: Nitin A Kamble <[email protected]>
-Date: 2012/03/14
-
-Updated for python 2.7.3
-Signed-off-by: Nitin A Kamble <[email protected]>
-Date: 2012/05/01
-
-Rebased for python-2.7.9
-Signed-off-by: Alejandro Hernandez <[email protected]>
-
+Upstream-Status: Inappropriate [Embedded specific]
+Signed-off-by: Ross Burton <[email protected]>
 
 Index: Python-2.7.9/Lib/sysconfig.py
 ===================================================================
@@ -37,41 +27,41 @@ Index: Python-2.7.9/Lib/sysconfig.py
          'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
          'include': '{userbase}/include/python{py_version_short}',
          'scripts': '{userbase}/bin',
-Index: Python-2.7.9/Makefile.pre.in
-===================================================================
---- Python-2.7.9.orig/Makefile.pre.in
-+++ Python-2.7.9/Makefile.pre.in
-@@ -1046,27 +1046,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 17e6f05..3db0a46 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1133,27 +1133,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
  	fi
 -	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
 +	PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
- 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  		-d $(LIBDEST) -f \
  		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  		$(DESTDIR)$(LIBDEST)
 -	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-+	PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH}$(RUNSHARED) \
- 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++	PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  		-d $(LIBDEST) -f \
  		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  		$(DESTDIR)$(LIBDEST)
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
 +	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
- 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  		-d $(LIBDEST)/site-packages -f \
  		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 +	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
- 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  		-d $(LIBDEST)/site-packages -f \
  		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 +	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
- 		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 +	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
- 		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
  
  # Create the PLATDIR source directory, if one wasn't distributed..
meta/recipes-devtools/python/python_2.7.17.bb +3 -6
index 5b856a50977..7e9aef556b8 100644
@@ -82,8 +82,7 @@ do_compile() {
 	export CROSS_COMPILE="${TARGET_PREFIX}"
 	export PYTHONBUILDDIR="${B}"
 
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+	oe_runmake PGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
 		STAGING_LIBDIR=${STAGING_LIBDIR} \
 		STAGING_INCDIR=${STAGING_INCDIR} \
 		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
@@ -100,16 +99,14 @@ do_install() {
 
 	# After swizzling the makefile, we need to run the build again.
 	# install can race with the build so we have to run this first, then install
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+	oe_runmake PGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
 		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
 		STAGING_LIBDIR=${STAGING_LIBDIR} \
 		STAGING_INCDIR=${STAGING_INCDIR} \
 		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
 		DESTDIR=${D} LIBDIR=${libdir}
 	
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+	oe_runmake PGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
 		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
 		STAGING_LIBDIR=${STAGING_LIBDIR} \
 		STAGING_INCDIR=${STAGING_INCDIR} \
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/5 hosttools: no longer check for or provide host python 2 to builds

In reply to Alexander Kanavin
---
 meta/classes/base.bbclass    | 5 -----
 meta/conf/bitbake.conf       | 5 ++---
 scripts/oe-buildenv-internal | 7 -------
 3 files changed, 2 insertions(+), 15 deletions(-)
meta/classes/base.bbclass +0 -5
index 1cea3a22138..ff3fbb28c31 100644
@@ -138,11 +138,6 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
                 os.symlink(srctool, desttool)
             else:
                 notfound.append(tool)
-    # Force "python" -> "python2"
-    desttool = os.path.join(dest, "python")
-    if not os.path.exists(desttool):
-        srctool = "python2"
-        os.symlink(srctool, desttool)
 
     if notfound and fatal:
         bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n  %s" % " ".join(notfound))
meta/conf/bitbake.conf +2 -3
index 263d8aea4fb..e75bbcece09 100644
@@ -481,14 +481,13 @@ export PATH
 HOSTTOOLS_DIR = "${TMPDIR}/hosttools"
 
 # Tools needed to run builds with OE-Core
-# python is special cased to point at python2
 HOSTTOOLS += " \
     [ ar as awk basename bash bzip2 cat chgrp chmod chown chrpath cmp comm cp cpio \
     cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
     fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
     head hostname iconv id install ld ldd ln ls make makeinfo md5sum mkdir mknod \
-    mktemp mv nm objcopy objdump od patch perl pod2man pr printf pwd python2 \
-    python2.7 python3 ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh sha256sum \
+    mktemp mv nm objcopy objdump od patch perl pod2man pr printf pwd \
+    python3 ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh sha256sum \
     sleep sort split stat strings strip tail tar tee test touch tr true uname \
     uniq wc wget which xargs \
 "
scripts/oe-buildenv-internal +0 -7
index 96bb0c3dc95..c17cf4da711 100755
@@ -29,13 +29,6 @@ if [ -z "$OE_SKIP_SDK_CHECK" ] && [ -n "$OECORE_SDK_VERSION" ]; then
     return 1
 fi
 
-py_v27_check=$(python2 -c 'import sys; print sys.version_info >= (2,7,3)')
-if [ "$py_v27_check" != "True" ]; then
-    echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
-    echo >&2 "Please upgrade your python v2."
-fi
-unset py_v27_check
-
 # We potentially have code that doesn't parse correctly with older versions 
 # of Python, and rather than fixing that and being eternally vigilant for 
 # any other new feature use, just check the version here.
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/5 packagegroup-self-hosted: remove python 2.x

In reply to Alexander Kanavin

With this change, python 2.x recipes are ready to be moved to an external layer. Once that happens, they will be removed from oe-core.

---
 meta/recipes-core/packagegroups/packagegroup-self-hosted.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-core/packagegroups/packagegroup-self-hosted.bb +0 -2
index 0aab23e3e0d..83306caea7c 100644
@@ -153,8 +153,6 @@ RDEPENDS_packagegroup-self-hosted-extended = "\
     perl-misc \
     perl-modules \
     perl-pod \
-    python \
-    python-modules \
     python3 \
     python3-modules \
     python3-git \
Signature · 1 line
2.17.1