[6/6] waf: python2 -> python3

Submitted by Robert Yang on June 28, 2019, 12:23 p.m. | Patch ID: 162622

Details

Message ID 37d251c3a3f0b81fa910df996f54bc0be22cf846.1561724553.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang June 28, 2019, 12:23 p.m.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-graphics/eglinfo/files/waf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-graphics/eglinfo/files/waf b/meta/recipes-graphics/eglinfo/files/waf
index 04ddd9f..2c83ed4 100755
--- a/meta/recipes-graphics/eglinfo/files/waf
+++ b/meta/recipes-graphics/eglinfo/files/waf
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # encoding: latin-1
 # Thomas Nagy, 2005-2018
 #
@@ -113,7 +113,7 @@  def unpack_wafdir(dir, src):
 	os.remove(tmp)
 	os.chdir(cwd)
 
-	try: dir = unicode(dir, 'mbcs')
+	try: dir = str(dir, 'mbcs')
 	except: pass
 	try:
 		from ctypes import windll

Comments

Ross Burton June 28, 2019, 12:15 p.m.
Did you just do the minimum required, or take a new copy of waf from upstream?

(https://gitlab.com/ita1024/waf/)

Ross

On Fri, 28 Jun 2019 at 13:01, Robert Yang <liezhi.yang@windriver.com> wrote:
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/recipes-graphics/eglinfo/files/waf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-graphics/eglinfo/files/waf b/meta/recipes-graphics/eglinfo/files/waf
> index 04ddd9f..2c83ed4 100755
> --- a/meta/recipes-graphics/eglinfo/files/waf
> +++ b/meta/recipes-graphics/eglinfo/files/waf
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  # encoding: latin-1
>  # Thomas Nagy, 2005-2018
>  #
> @@ -113,7 +113,7 @@ def unpack_wafdir(dir, src):
>         os.remove(tmp)
>         os.chdir(cwd)
>
> -       try: dir = unicode(dir, 'mbcs')
> +       try: dir = str(dir, 'mbcs')
>         except: pass
>         try:
>                 from ctypes import windll
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Robert Yang June 28, 2019, 12:18 p.m.
On 6/28/19 8:15 PM, Burton, Ross wrote:
> Did you just do the minimum required, or take a new copy of waf from upstream?
> 
> (https://gitlab.com/ita1024/waf/)

No, I didn't take it from upstream, I just modified it and ran:

$ bitbake eglinfo-fb eglinfo-x11 eglinfo-wayland

// RObert

> 
> Ross
> 
> On Fri, 28 Jun 2019 at 13:01, Robert Yang <liezhi.yang@windriver.com> wrote:
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   meta/recipes-graphics/eglinfo/files/waf | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-graphics/eglinfo/files/waf b/meta/recipes-graphics/eglinfo/files/waf
>> index 04ddd9f..2c83ed4 100755
>> --- a/meta/recipes-graphics/eglinfo/files/waf
>> +++ b/meta/recipes-graphics/eglinfo/files/waf
>> @@ -1,4 +1,4 @@
>> -#!/usr/bin/env python
>> +#!/usr/bin/env python3
>>   # encoding: latin-1
>>   # Thomas Nagy, 2005-2018
>>   #
>> @@ -113,7 +113,7 @@ def unpack_wafdir(dir, src):
>>          os.remove(tmp)
>>          os.chdir(cwd)
>>
>> -       try: dir = unicode(dir, 'mbcs')
>> +       try: dir = str(dir, 'mbcs')
>>          except: pass
>>          try:
>>                  from ctypes import windll
>> --
>> 2.7.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Robert Yang July 11, 2019, 3 a.m.
Hi Ross,

On 6/28/19 8:15 PM, Burton, Ross wrote:
> Did you just do the minimum required, or take a new copy of waf from upstream?
> 
> (https://gitlab.com/ita1024/waf/)

I checked the one from upstream, it is still python2. The waf is the only one
which still requires python2 in oe-core. We can get rid of python2 after this
patch, what's your opinion, please?

// Robert

> 
> Ross
> 
> On Fri, 28 Jun 2019 at 13:01, Robert Yang <liezhi.yang@windriver.com> wrote:
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   meta/recipes-graphics/eglinfo/files/waf | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-graphics/eglinfo/files/waf b/meta/recipes-graphics/eglinfo/files/waf
>> index 04ddd9f..2c83ed4 100755
>> --- a/meta/recipes-graphics/eglinfo/files/waf
>> +++ b/meta/recipes-graphics/eglinfo/files/waf
>> @@ -1,4 +1,4 @@
>> -#!/usr/bin/env python
>> +#!/usr/bin/env python3
>>   # encoding: latin-1
>>   # Thomas Nagy, 2005-2018
>>   #
>> @@ -113,7 +113,7 @@ def unpack_wafdir(dir, src):
>>          os.remove(tmp)
>>          os.chdir(cwd)
>>
>> -       try: dir = unicode(dir, 'mbcs')
>> +       try: dir = str(dir, 'mbcs')
>>          except: pass
>>          try:
>>                  from ctypes import windll
>> --
>> 2.7.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Ross Burton July 11, 2019, 10:26 a.m.
On Thu, 11 Jul 2019 at 03:59, Robert Yang <liezhi.yang@windriver.com> wrote:
> On 6/28/19 8:15 PM, Burton, Ross wrote:
> > Did you just do the minimum required, or take a new copy of waf from upstream?
> >
> > (https://gitlab.com/ita1024/waf/)
>
> I checked the one from upstream, it is still python2. The waf is the only one
> which still requires python2 in oe-core. We can get rid of python2 after this
> patch, what's your opinion, please?

If that's the case then YES YES YES.  :)

Ross
Ross Burton July 11, 2019, 10:46 a.m.
On Thu, 11 Jul 2019 at 11:26, Burton, Ross <ross.burton@intel.com> wrote:
>
> On Thu, 11 Jul 2019 at 03:59, Robert Yang <liezhi.yang@windriver.com> wrote:
> > On 6/28/19 8:15 PM, Burton, Ross wrote:
> > > Did you just do the minimum required, or take a new copy of waf from upstream?
> > >
> > > (https://gitlab.com/ita1024/waf/)
> >
> > I checked the one from upstream, it is still python2. The waf is the only one
> > which still requires python2 in oe-core. We can get rid of python2 after this
> > patch, what's your opinion, please?
>
> If that's the case then YES YES YES.  :)

Follow-up: do you mean remove python2 from HOSTTOOLS, or the recipe
from oe-core?

$ bitbake -g world
$ grep -- '-> "python"' recipe-depends.dot
"kernel-devsrc" -> "python"
"ltp" -> "python"
"meta-world-pkgdata" -> "python"
"packagegroup-core-tools-profile" -> "python"
"packagegroup-core-tools-testapps" -> "python"
"packagegroup-self-hosted" -> "python"
"perf" -> "python"
"python-nose" -> "python"
"python-numpy" -> "python"
"python-scons" -> "python"
"python-setuptools" -> "python"

Nothing depends on the python-* in core, we can ignore the
packagegroups, so that leaves kernel-devsrc, ltp, and perf. Also
u-boot uses nativepython.

HOSTTOOLS is more complicated and there's still plenty of pieces that
use host python.  I've an old poky-contrib:ross/nopy2 branch that
fixes a few more users of host python2 that needs rebasing and
retesting.

Ross

Ross
Robert Yang July 12, 2019, 10:34 a.m.
On 7/11/19 6:46 PM, Burton, Ross wrote:
> On Thu, 11 Jul 2019 at 11:26, Burton, Ross <ross.burton@intel.com> wrote:
>>
>> On Thu, 11 Jul 2019 at 03:59, Robert Yang <liezhi.yang@windriver.com> wrote:
>>> On 6/28/19 8:15 PM, Burton, Ross wrote:
>>>> Did you just do the minimum required, or take a new copy of waf from upstream?
>>>>
>>>> (https://gitlab.com/ita1024/waf/)
>>>
>>> I checked the one from upstream, it is still python2. The waf is the only one
>>> which still requires python2 in oe-core. We can get rid of python2 after this
>>> patch, what's your opinion, please?
>>
>> If that's the case then YES YES YES.  :)
> 
> Follow-up: do you mean remove python2 from HOSTTOOLS, or the recipe
> from oe-core?
> 
> $ bitbake -g world
> $ grep -- '-> "python"' recipe-depends.dot
> "kernel-devsrc" -> "python"
> "ltp" -> "python"
> "meta-world-pkgdata" -> "python"
> "packagegroup-core-tools-profile" -> "python"
> "packagegroup-core-tools-testapps" -> "python"
> "packagegroup-self-hosted" -> "python"
> "perf" -> "python"
> "python-nose" -> "python"
> "python-numpy" -> "python"
> "python-scons" -> "python"
> "python-setuptools" -> "python"
> 
> Nothing depends on the python-* in core, we can ignore the
> packagegroups, so that leaves kernel-devsrc, ltp, and perf. Also
> u-boot uses nativepython.
> 
> HOSTTOOLS is more complicated and there's still plenty of pieces that
> use host python.  I've an old poky-contrib:ross/nopy2 branch that
> fixes a few more users of host python2 that needs rebasing and
> retesting.

I meant remove python2 from HOSTTOOLS, but it seems not easy to do atm, so maybe
we still need keep it for many years. I have this idea is because host such as
Redhat Linux 8 doesn't install python2 by default any more.

// Robert

> 
> Ross
> 
> Ross
>
Ross Burton July 12, 2019, 11:55 a.m.
On Fri, 12 Jul 2019 at 11:33, Robert Yang <liezhi.yang@windriver.com> wrote:
> > HOSTTOOLS is more complicated and there's still plenty of pieces that
> > use host python.  I've an old poky-contrib:ross/nopy2 branch that
> > fixes a few more users of host python2 that needs rebasing and
> > retesting.
>
> I meant remove python2 from HOSTTOOLS, but it seems not easy to do atm, so maybe
> we still need keep it for many years. I have this idea is because host such as
> Redhat Linux 8 doesn't install python2 by default any more.

I left a world build going last night, some more fixes in nopy2.
There's still about 10 recipes failing.

Ross