All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-08 16:23 Ross Burton
@ 2020-10-08 19:15 ` Richard Purdie
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2020-10-08 19:15 UTC (permalink / raw)
  To: Ross Burton, openembedded-core

On Thu, 2020-10-08 at 17:23 +0100, Ross Burton wrote:
> We don't assume Python 2 is on the host and don't expose an
> unversioned
> python in HOSTTOOLS, but waf uses the unversion python binary.
> 
> Typically this is solved by patching waf (see the glmark2 recipe) but
> this can be solved centrally by invoking python3 directly.  All
> wscripts
> that needed Python 2 would have been fixed by now.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/classes/waf.bbclass | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Please rebase against master-next, Joshua beat you in patch submission
against the class!

Cheers,

Richard


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] waf: explicitly run waf under Python 3
@ 2020-10-14 11:26 Ross Burton
  2020-10-14 12:41 ` [OE-core] " Joshua Watt
  0 siblings, 1 reply; 9+ messages in thread
From: Ross Burton @ 2020-10-14 11:26 UTC (permalink / raw)
  To: openembedded-core

We don't assume Python 2 is on the host and don't expose an unversioned
python in HOSTTOOLS, but waf uses the unversion python binary.

Typically this is solved by patching waf (see the glmark2 recipe) but
this can be solved centrally by invoking python3 directly.  All wscripts
that needed Python 2 would have been fixed by now.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes/waf.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index 309f625a40..df6d4d53e8 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -42,7 +42,7 @@ python waf_preconfigure() {
     subsrcdir = d.getVar('S')
     wafbin = os.path.join(subsrcdir, 'waf')
     try:
-        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
+        result = subprocess.check_output(['python3', wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
         version = result.decode('utf-8').split()[1]
         if StrictVersion(version) >= StrictVersion("1.8.7"):
             d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
@@ -55,16 +55,16 @@ python waf_preconfigure() {
 do_configure[prefuncs] += "waf_preconfigure"
 
 waf_do_configure() {
-	(cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
+	(cd ${S} && python3 ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
 }
 
 do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
 waf_do_compile()  {
-	(cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
+	(cd ${S} && python3 ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
 }
 
 waf_do_install() {
-	(cd ${S} && ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
+	(cd ${S} && python3 ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
 }
 
 EXPORT_FUNCTIONS do_configure do_compile do_install
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-14 11:26 [PATCH] waf: explicitly run waf under Python 3 Ross Burton
@ 2020-10-14 12:41 ` Joshua Watt
  2020-10-14 21:01   ` Khem Raj
  2020-10-15 12:44   ` Richard Purdie
  0 siblings, 2 replies; 9+ messages in thread
From: Joshua Watt @ 2020-10-14 12:41 UTC (permalink / raw)
  To: Ross Burton; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]

On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:

> We don't assume Python 2 is on the host and don't expose an unversioned
> python in HOSTTOOLS, but waf uses the unversion python binary.
>
> Typically this is solved by patching waf (see the glmark2 recipe) but
> this can be solved centrally by invoking python3 directly.  All wscripts
> that needed Python 2 would have been fixed by now.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/classes/waf.bbclass | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
> index 309f625a40..df6d4d53e8 100644
> --- a/meta/classes/waf.bbclass
> +++ b/meta/classes/waf.bbclass
> @@ -42,7 +42,7 @@ python waf_preconfigure() {
>      subsrcdir = d.getVar('S')
>      wafbin = os.path.join(subsrcdir, 'waf')
>      try:
> -        result = subprocess.check_output([wafbin, '--version'],
> cwd=subsrcdir, stderr=subprocess.STDOUT)
> +        result = subprocess.check_output(['python3', wafbin,
> '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
>

This will break our internal usage... We still use waf 1 which runs under
python 2 only :(, although we are working on transitioning

         version = result.decode('utf-8').split()[1]
>          if StrictVersion(version) >= StrictVersion("1.8.7"):
>              d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir}
> --libdir=${libdir}")
> @@ -55,16 +55,16 @@ python waf_preconfigure() {
>  do_configure[prefuncs] += "waf_preconfigure"
>
>  waf_do_configure() {
> -       (cd ${S} && ./waf configure -o ${B} --prefix=${prefix}
> ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
> +       (cd ${S} && python3 ./waf configure -o ${B} --prefix=${prefix}
> ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
>  }
>
>  do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
>  waf_do_compile()  {
> -       (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d,
> '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
> +       (cd ${S} && python3 ./waf build
> ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
> ${EXTRA_OEWAF_BUILD})
>  }
>
>  waf_do_install() {
> -       (cd ${S} && ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
> +       (cd ${S} && python3 ./waf install --destdir=${D}
> ${EXTRA_OEWAF_INSTALL})
>  }
>
>  EXPORT_FUNCTIONS do_configure do_compile do_install
> --
> 2.25.1
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 3372 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-14 12:41 ` [OE-core] " Joshua Watt
@ 2020-10-14 21:01   ` Khem Raj
  2020-10-14 21:23     ` Joshua Watt
  2020-10-15 12:44   ` Richard Purdie
  1 sibling, 1 reply; 9+ messages in thread
From: Khem Raj @ 2020-10-14 21:01 UTC (permalink / raw)
  To: Joshua Watt; +Cc: Ross Burton, OE-core

On Wed, Oct 14, 2020 at 5:41 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
>
>
>
> On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:
>>
>> We don't assume Python 2 is on the host and don't expose an unversioned
>> python in HOSTTOOLS, but waf uses the unversion python binary.
>>
>> Typically this is solved by patching waf (see the glmark2 recipe) but
>> this can be solved centrally by invoking python3 directly.  All wscripts
>> that needed Python 2 would have been fixed by now.
>>
>> Signed-off-by: Ross Burton <ross.burton@arm.com>
>> ---
>>  meta/classes/waf.bbclass | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
>> index 309f625a40..df6d4d53e8 100644
>> --- a/meta/classes/waf.bbclass
>> +++ b/meta/classes/waf.bbclass
>> @@ -42,7 +42,7 @@ python waf_preconfigure() {
>>      subsrcdir = d.getVar('S')
>>      wafbin = os.path.join(subsrcdir, 'waf')
>>      try:
>> -        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
>> +        result = subprocess.check_output(['python3', wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
>
>
> This will break our internal usage... We still use waf 1 which runs under python 2 only :(, although we are working on transitioning

this is for master and we have already said goodbye to python2 in
oe-core. perhaps reverse patching waf in your app might be an option ?

>
>>          version = result.decode('utf-8').split()[1]
>>          if StrictVersion(version) >= StrictVersion("1.8.7"):
>>              d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
>> @@ -55,16 +55,16 @@ python waf_preconfigure() {
>>  do_configure[prefuncs] += "waf_preconfigure"
>>
>>  waf_do_configure() {
>> -       (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
>> +       (cd ${S} && python3 ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
>>  }
>>
>>  do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
>>  waf_do_compile()  {
>> -       (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
>> +       (cd ${S} && python3 ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
>>  }
>>
>>  waf_do_install() {
>> -       (cd ${S} && ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
>> +       (cd ${S} && python3 ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
>>  }
>>
>>  EXPORT_FUNCTIONS do_configure do_compile do_install
>> --
>> 2.25.1
>>
>>
>>
>>
>
> 
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-14 21:01   ` Khem Raj
@ 2020-10-14 21:23     ` Joshua Watt
  2020-10-14 22:47       ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Joshua Watt @ 2020-10-14 21:23 UTC (permalink / raw)
  To: Khem Raj; +Cc: Ross Burton, OE-core


On 10/14/20 4:01 PM, Khem Raj wrote:
> On Wed, Oct 14, 2020 at 5:41 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
>>
>>
>> On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:
>>> We don't assume Python 2 is on the host and don't expose an unversioned
>>> python in HOSTTOOLS, but waf uses the unversion python binary.
>>>
>>> Typically this is solved by patching waf (see the glmark2 recipe) but
>>> this can be solved centrally by invoking python3 directly.  All wscripts
>>> that needed Python 2 would have been fixed by now.
>>>
>>> Signed-off-by: Ross Burton <ross.burton@arm.com>
>>> ---
>>>   meta/classes/waf.bbclass | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
>>> index 309f625a40..df6d4d53e8 100644
>>> --- a/meta/classes/waf.bbclass
>>> +++ b/meta/classes/waf.bbclass
>>> @@ -42,7 +42,7 @@ python waf_preconfigure() {
>>>       subsrcdir = d.getVar('S')
>>>       wafbin = os.path.join(subsrcdir, 'waf')
>>>       try:
>>> -        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
>>> +        result = subprocess.check_output(['python3', wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
>>
>> This will break our internal usage... We still use waf 1 which runs under python 2 only :(, although we are working on transitioning
> this is for master and we have already said goodbye to python2 in
> oe-core. perhaps reverse patching waf in your app might be an option ?

a.k.a. upgrading to waf 2 :)

Can we deal with it by importing either `pythonnative` or 
`python3native` in the recipes along with waf.bbclass, e.g.

     inherit waf pythonnative # waf 1

or

     inherit waf python3native # waf 2

Then you get the interpreter than matches the waf in your repo.

I do appreciate that oe-core has dumped python 2 support (and we should 
have *ages* ago also)... but I also don't really want a fire drill when 
most of our applications no longer build on 3.2, especially we can just 
inherit python3native as shown.

>
>>>           version = result.decode('utf-8').split()[1]
>>>           if StrictVersion(version) >= StrictVersion("1.8.7"):
>>>               d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
>>> @@ -55,16 +55,16 @@ python waf_preconfigure() {
>>>   do_configure[prefuncs] += "waf_preconfigure"
>>>
>>>   waf_do_configure() {
>>> -       (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
>>> +       (cd ${S} && python3 ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
>>>   }
>>>
>>>   do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
>>>   waf_do_compile()  {
>>> -       (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
>>> +       (cd ${S} && python3 ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
>>>   }
>>>
>>>   waf_do_install() {
>>> -       (cd ${S} && ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
>>> +       (cd ${S} && python3 ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL})
>>>   }
>>>
>>>   EXPORT_FUNCTIONS do_configure do_compile do_install
>>> --
>>> 2.25.1
>>>
>>>
>>>
>>>
>> 
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-14 21:23     ` Joshua Watt
@ 2020-10-14 22:47       ` Khem Raj
  0 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2020-10-14 22:47 UTC (permalink / raw)
  To: Joshua Watt; +Cc: OE-core, Ross Burton

[-- Attachment #1: Type: text/plain, Size: 4027 bytes --]

On Wed, Oct 14, 2020 at 2:23 PM Joshua Watt <jpewhacker@gmail.com> wrote:

>
> On 10/14/20 4:01 PM, Khem Raj wrote:
> > On Wed, Oct 14, 2020 at 5:41 AM Joshua Watt <JPEWhacker@gmail.com>
> wrote:
> >>
> >>
> >> On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:
> >>> We don't assume Python 2 is on the host and don't expose an unversioned
> >>> python in HOSTTOOLS, but waf uses the unversion python binary.
> >>>
> >>> Typically this is solved by patching waf (see the glmark2 recipe) but
> >>> this can be solved centrally by invoking python3 directly.  All
> wscripts
> >>> that needed Python 2 would have been fixed by now.
> >>>
> >>> Signed-off-by: Ross Burton <ross.burton@arm.com>
> >>> ---
> >>>   meta/classes/waf.bbclass | 8 ++++----
> >>>   1 file changed, 4 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
> >>> index 309f625a40..df6d4d53e8 100644
> >>> --- a/meta/classes/waf.bbclass
> >>> +++ b/meta/classes/waf.bbclass
> >>> @@ -42,7 +42,7 @@ python waf_preconfigure() {
> >>>       subsrcdir = d.getVar('S')
> >>>       wafbin = os.path.join(subsrcdir, 'waf')
> >>>       try:
> >>> -        result = subprocess.check_output([wafbin, '--version'],
> cwd=subsrcdir, stderr=subprocess.STDOUT)
> >>> +        result = subprocess.check_output(['python3', wafbin,
> '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
> >>
> >> This will break our internal usage... We still use waf 1 which runs
> under python 2 only :(, although we are working on transitioning
> > this is for master and we have already said goodbye to python2 in
> > oe-core. perhaps reverse patching waf in your app might be an option ?
>
> a.k.a. upgrading to waf 2 :)
>
> Can we deal with it by importing either `pythonnative` or
> `python3native` in the recipes along with waf.bbclass, e.g.
>
>      inherit waf pythonnative # waf 1
>
> or
>
>      inherit waf python3native # waf 2
>
> Then you get the interpreter than matches the waf in your repo.



This is going to be a large set of recipes I would imagine and perhaps not
worth it for supporting old version of waf which is not used in any
packages on open layers it will aggravate serialization of waf recipes due
to python native dependency on the other hand there are recipes in meta-Oe
which need this change where patches are pending



>
> I do appreciate that oe-core has dumped python 2 support (and we should
> have *ages* ago also)... but I also don't really want a fire drill when
> most of our applications no longer build on 3.2, especially we can just
> inherit python3native as shown.
>
> >
> >>>           version = result.decode('utf-8').split()[1]
> >>>           if StrictVersion(version) >= StrictVersion("1.8.7"):
> >>>               d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir}
> --libdir=${libdir}")
> >>> @@ -55,16 +55,16 @@ python waf_preconfigure() {
> >>>   do_configure[prefuncs] += "waf_preconfigure"
> >>>
> >>>   waf_do_configure() {
> >>> -       (cd ${S} && ./waf configure -o ${B} --prefix=${prefix}
> ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
> >>> +       (cd ${S} && python3 ./waf configure -o ${B} --prefix=${prefix}
> ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
> >>>   }
> >>>
> >>>   do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
> >>>   waf_do_compile()  {
> >>> -       (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d,
> '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD})
> >>> +       (cd ${S} && python3 ./waf build
> ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
> ${EXTRA_OEWAF_BUILD})
> >>>   }
> >>>
> >>>   waf_do_install() {
> >>> -       (cd ${S} && ./waf install --destdir=${D}
> ${EXTRA_OEWAF_INSTALL})
> >>> +       (cd ${S} && python3 ./waf install --destdir=${D}
> ${EXTRA_OEWAF_INSTALL})
> >>>   }
> >>>
> >>>   EXPORT_FUNCTIONS do_configure do_compile do_install
> >>> --
> >>> 2.25.1
> >>>
> >>>
> >>>
> >>>
> >> 
> >>
>

[-- Attachment #2: Type: text/html, Size: 5639 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-14 12:41 ` [OE-core] " Joshua Watt
  2020-10-14 21:01   ` Khem Raj
@ 2020-10-15 12:44   ` Richard Purdie
  2020-10-15 13:00     ` Joshua Watt
  2020-10-15 13:52     ` Ross Burton
  1 sibling, 2 replies; 9+ messages in thread
From: Richard Purdie @ 2020-10-15 12:44 UTC (permalink / raw)
  To: Joshua Watt, Ross Burton; +Cc: OE-core

On Wed, 2020-10-14 at 07:41 -0500, Joshua Watt wrote:
> 
> 
> On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:
> > We don't assume Python 2 is on the host and don't expose an unversioned
> > python in HOSTTOOLS, but waf uses the unversion python binary.
> > 
> > Typically this is solved by patching waf (see the glmark2 recipe) but
> > this can be solved centrally by invoking python3 directly.  All wscripts
> > that needed Python 2 would have been fixed by now.
> > 
> > Signed-off-by: Ross Burton <ross.burton@arm.com>
> > ---
> >  meta/classes/waf.bbclass | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
> > index 309f625a40..df6d4d53e8 100644
> > --- a/meta/classes/waf.bbclass
> > +++ b/meta/classes/waf.bbclass
> > @@ -42,7 +42,7 @@ python waf_preconfigure() {
> >      subsrcdir = d.getVar('S')
> >      wafbin = os.path.join(subsrcdir, 'waf')
> >      try:
> > -        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
> > +        result = subprocess.check_output(['python3', wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
> 
> This will break our internal usage... We still use waf 1 which runs under python 2 only :(, although we are working on transitioning

Might I suggest this is parameterised as something like: 

WAFPYTHON = "python3"

then OE-Core can continue on and improve but people with legacy can
handle it better?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-15 12:44   ` Richard Purdie
@ 2020-10-15 13:00     ` Joshua Watt
  2020-10-15 13:52     ` Ross Burton
  1 sibling, 0 replies; 9+ messages in thread
From: Joshua Watt @ 2020-10-15 13:00 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Ross Burton, OE-core

On Thu, Oct 15, 2020 at 7:44 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2020-10-14 at 07:41 -0500, Joshua Watt wrote:
> >
> >
> > On Wed, Oct 14, 2020, 6:26 AM Ross Burton <ross@burtonini.com> wrote:
> > > We don't assume Python 2 is on the host and don't expose an unversioned
> > > python in HOSTTOOLS, but waf uses the unversion python binary.
> > >
> > > Typically this is solved by patching waf (see the glmark2 recipe) but
> > > this can be solved centrally by invoking python3 directly.  All wscripts
> > > that needed Python 2 would have been fixed by now.
> > >
> > > Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > ---
> > >  meta/classes/waf.bbclass | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
> > > index 309f625a40..df6d4d53e8 100644
> > > --- a/meta/classes/waf.bbclass
> > > +++ b/meta/classes/waf.bbclass
> > > @@ -42,7 +42,7 @@ python waf_preconfigure() {
> > >      subsrcdir = d.getVar('S')
> > >      wafbin = os.path.join(subsrcdir, 'waf')
> > >      try:
> > > -        result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
> > > +        result = subprocess.check_output(['python3', wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
> >
> > This will break our internal usage... We still use waf 1 which runs under python 2 only :(, although we are working on transitioning
>
> Might I suggest this is parameterised as something like:
>
> WAFPYTHON = "python3"
>
> then OE-Core can continue on and improve but people with legacy can
> handle it better?

That would be fine with me

>
> Cheers,
>
> Richard
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] waf: explicitly run waf under Python 3
  2020-10-15 12:44   ` Richard Purdie
  2020-10-15 13:00     ` Joshua Watt
@ 2020-10-15 13:52     ` Ross Burton
  1 sibling, 0 replies; 9+ messages in thread
From: Ross Burton @ 2020-10-15 13:52 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Joshua Watt, OE-core

On Thu, 15 Oct 2020 at 13:44, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Might I suggest this is parameterised as something like:
>
> WAFPYTHON = "python3"
>
> then OE-Core can continue on and improve but people with legacy can
> handle it better?

This was the patch I originally had months ago ;)

v2 incoming.

Ross

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-15 13:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-14 11:26 [PATCH] waf: explicitly run waf under Python 3 Ross Burton
2020-10-14 12:41 ` [OE-core] " Joshua Watt
2020-10-14 21:01   ` Khem Raj
2020-10-14 21:23     ` Joshua Watt
2020-10-14 22:47       ` Khem Raj
2020-10-15 12:44   ` Richard Purdie
2020-10-15 13:00     ` Joshua Watt
2020-10-15 13:52     ` Ross Burton
  -- strict thread matches above, loose matches on Subject: below --
2020-10-08 16:23 Ross Burton
2020-10-08 19:15 ` [OE-core] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.