Skip to contentSkip to conversation

dependencies.sh: Check for a host python version >= 2.7

PATCH Superseded aduskett at gmail.com 3 participants 4 messages Dec 15, 2018 – Dec 16, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dependencies.sh: Check for a host python version >= 2.7

From: Adam Duskett <[email protected]>

Older distributions such as CentOS6 come with python2.6, which causes build failures in packages such as host-libglib2 because they require python2.7 or above.

CentOS6 does have the centos-release-scl which allows users to install python2.7, making this transition reasonably easy.

Debian 6 and 7 have reached EOL, and Debian 8 comes with Python 2.7, so this patch should be relatively low impact.

---
 support/dependencies/dependencies.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
support/dependencies/dependencies.sh +8 -0
index 58c34d880f..d0b6bdc23a 100755
@@ -181,6 +181,14 @@ if test "${missing_progs}" = "yes" ; then
 	exit 1
 fi
 
+# Check that the python version is at least 2.7
+PYTHON_VERSION=$(python -V 2>&1 |awk '{print $2}')
+if [ $(echo $PYTHON_VERSION |sed -e 's/\.//g') -lt 2700 ]; then
+	echo
+	echo "You have python '$PYTHON_VERSION' installed.  Python >= 2.7 is required"
+	exit 1;
+fi
+
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
 	if ! which locale > /dev/null ; then
 		echo
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 dependencies.sh: Check for a host python version >= 2.7

Hi Adam,

Quoted 5 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

Older distributions such as CentOS6 come with python2.6, which causes build failures in packages such as host-libglib2 because they require python2.7 or above.

Any reference to glib requirements? autobuilder failures?

Quoted 5 lines

CentOS6 does have the centos-release-scl which allows users to install python2.7, making this transition reasonably easy.

Debian 6 and 7 have reached EOL, and Debian 8 comes with Python 2.7, so this patch should be relatively low impact.

Please update the requirements documentation in a separate patch:

https://buildroot.org/downloads/manual/manual.html#requirement-mandatory

baruch

Quoted 24 lines
---
 support/dependencies/dependencies.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
support/dependencies/dependencies.sh +8 -0
index 58c34d880f..d0b6bdc23a 100755
@@ -181,6 +181,14 @@ if test "${missing_progs}" = "yes" ; then
 	exit 1
 fi
 
+# Check that the python version is at least 2.7
+PYTHON_VERSION=$(python -V 2>&1 |awk '{print $2}')
+if [ $(echo $PYTHON_VERSION |sed -e 's/\.//g') -lt 2700 ]; then
+	echo
+	echo "You have python '$PYTHON_VERSION' installed.  Python >= 2.7 is required"
+	exit 1;
+fi
+
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
 	if ! which locale > /dev/null ; then
 		echo
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 dependencies.sh: Check for a host python version >= 2.7

Hi Baruch!

Quoted 12 lines · Baruch Siach

Hi Adam,

Quoted 5 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

Older distributions such as CentOS6 come with python2.6, which causes build failures in packages such as host-libglib2 because they require python2.7 or above.

Any reference to glib requirements? autobuilder failures?

Not that I can see. I am not sure if any of the autobuilders are using CentOS6, however
I noticed the crash when I was using a CentOS6 Docker container and decided to do some
due diligence. :)

Quoted 10 lines
Quoted 5 lines

CentOS6 does have the centos-release-scl which allows users to install python2.7, making this transition reasonably easy.

Debian 6 and 7 have reached EOL, and Debian 8 comes with Python 2.7, so this patch should be relatively low impact.

Please update the requirements documentation in a separate patch:

https://buildroot.org/downloads/manual/manual.html#requirement-mandatory

Can do!

Adam

Quoted 31 lines

baruch

Quoted 14 lines
---
 support/dependencies/dependencies.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
support/dependencies/dependencies.sh +1 -0
index 58c34d880f..d0b6bdc23a 100755
@@ -181,6 +181,14 @@ if test "${missing_progs}" = "yes" ; then
      exit 1
 fi
 
+# Check that the python version is at least 2.7

support/dependencies/dependencies.sh if test "${missing_progs}" = "yes" ; then · line 194

Quoted 10 lines
support/dependencies/dependencies.sh +7 -0
+PYTHON_VERSION=$(python -V 2>&1 |awk '{print $2}')
+if [ $(echo $PYTHON_VERSION |sed -e 's/\.//g') -lt 2700 ]; then
+     echo
+     echo "You have python '$PYTHON_VERSION' installed.  Python >= 2.7 is required"
+     exit 1;
+fi
+
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
      if ! which locale > /dev/null ; then
              echo

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#3 lore raw

PATCH 1/1 dependencies.sh: Check for a host python version >= 2.7

Hello,

Quoted 11 lines · Adam Duskett
Quoted 10 lines · Baruch Siach

Hi Adam,

Quoted 5 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

Older distributions such as CentOS6 come with python2.6, which causes build failures in packages such as host-libglib2 because they require python2.7 or above.

Quoted 7 lines
Quoted 2 lines

Any reference to glib requirements? autobuilder failures?

Not that I can see. I am not sure if any of the autobuilders are using CentOS6, however
I noticed the crash when I was using a CentOS6 Docker container and decided to do some
due diligence. :)

Please explain in the commit log which glib version has this requirement, and which specific build failure you got.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com