scons is going to use python3 as interpreter

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

scons is going to use python3 as interpreter

Dominique Leuenberger / DimStar
Dear Tumbleweed hackers and packagers,

As you all know, python3 is 'the new thing' and pytho2 is being moved
to the background. Various packages have already been switched to be
using python3 - probably 'the easy ones' are all done. so we enter the
jounery of more complex things.

One such package is scons, which has been switched to be using python3
in request https://build.opensuse.org/request/show/542087

Now, scons is a bit 'special', as it is written in python and is
basiclaly compatible to python2 AND python3, BUT it parses
SConstruct/SConscript of different packages. And there the results are
a bit mixed when it comes to python3 compliance

Martin setup a test branch where he monitors all packages in
openSUSE:Factory using scons as their build script, see
https://build.opensuse.org/project/monitor/home:pluskalm:python3

Out of those only two packages are tracked as part of the rings (ffado
and gpsd), which means from a Factory process perspective, once those
two are fixed, the scons-switch to python3 could happen.

As this will impact some other packages, I'd like to ask for your help
to fix the other failing packages there. Simply branch them using "osc
branch openSUSE:Factory $pkg" and submit them back to their original
devel project. Martin's project only serves as monitor and should not
receive submissions.

In many cases, the issue in SConstruct are the usual python3 offenders:
print "FOO" needs to be written as print ("FOO") now; so patches can
turn out to be easy (in some cases they are more complex though)

This mail serves as an info so you won't be surprised when scons is
being merged and some packagaes stop building (of course some people
will still be surprised, but such is life)

Cheers
Dominique

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: scons is going to use python3 as interpreter

Dave Plater lst


On 23/11/2017 15:13, Dominique Leuenberger / DimStar wrote:
> Out of those only two packages are tracked as part of the rings (ffado
> and gpsd), which means from a Factory process perspective, once those
> two are fixed, the scons-switch to python3 could happen.

I've sorted out the rest of the print() errors, maybe I should submit it
so long. I'm now stuck on a strange error:
Checking for a working C-compiler TypeError : sequence item 0: expected
str instance, bytes found
Giving no indication of where the error is but a context.TryRun( to test
the c compiler is the point that it's at.
Unfortunately my scons and python2 to 3 skills are a bit rusty so any
help will be appreciated.
https://build.opensuse.org/package/show/home:plater/ffado
I've failed to get a more verbose error so far.
Thanks
Dave P
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: scons is going to use python3 as interpreter

Kristoffer Grönlund
Dave Plater <[hidden email]> writes:

> On 23/11/2017 15:13, Dominique Leuenberger / DimStar wrote:
>> Out of those only two packages are tracked as part of the rings (ffado
>> and gpsd), which means from a Factory process perspective, once those
>> two are fixed, the scons-switch to python3 could happen.
>
> I've sorted out the rest of the print() errors, maybe I should submit it
> so long. I'm now stuck on a strange error:
> Checking for a working C-compiler TypeError : sequence item 0: expected
> str instance, bytes found
> Giving no indication of where the error is but a context.TryRun( to test
> the c compiler is the point that it's at.
> Unfortunately my scons and python2 to 3 skills are a bit rusty so any
> help will be appreciated.
> https://build.opensuse.org/package/show/home:plater/ffado
> I've failed to get a more verbose error so far.

This error is typically due to a mixup of raw bytes and unicode strings.

In python 2, there were two types of strings: ascii strings and unicode
strings. In practice, you'd read from a command line tool and get bytes
which would be interpreted as an ascii string.

In python 3, there are only unicode strings. All of the file reading or
command line tool reading code now return bytes, that have to be decoded
into unicode using a particular interpretation: ascii, utf-8, or
something else.

If the error had been reported with a file and line number, it'd be
easier to figure out what was going wrong...


> Thanks
> Dave P
> --
> To unsubscribe, e-mail: [hidden email]
> To contact the owner, e-mail: [hidden email]
>
>

--
// Kristoffer Grönlund
// [hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: scons is going to use python3 as interpreter

Martin Pluskal-2
In reply to this post by Dave Plater lst
On Thu, 2017-11-23 at 15:28 +0200, Dave Plater wrote:
> str instance, bytes found
> Giving no indication of where the error is but a context.TryRun( to
> test
> the c compiler is the point that it's at.
> Unfortunately my scons and python2 to 3 skills are a bit rusty so
> any
> help will be appreciated.
Actually fedora solved this correctly - working version is at
home:pluskalm:python3/ffado [1] (fixed by tacit).

Cheers

M

1. https://build.opensuse.org/package/rdiff/home:pluskalm:python3/ffado?linkrev=base&rev=2
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: scons is going to use python3 as interpreter

Dave Plater lst


On 24/11/2017 11:18, Martin Pluskal wrote:

> On Thu, 2017-11-23 at 15:28 +0200, Dave Plater wrote:
>> str instance, bytes found
>> Giving no indication of where the error is but a context.TryRun( to
>> test
>> the c compiler is the point that it's at.
>> Unfortunately my scons and python2 to 3 skills are a bit rusty so
>> any
>> help will be appreciated.
> Actually fedora solved this correctly - working version is at
> home:pluskalm:python3/ffado [1] (fixed by tacit).
>
> Cheers
>
> M
>
> 1. https://build.opensuse.org/package/rdiff/home:pluskalm:python3/ffado?linkrev=base&rev=2
>
Actually Fedora solved this with:
+    return True # FIXME: The following TryRun fails on Python3

I don't call that a fix I call it a work around.
Dave P
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: scons is going to use python3 as interpreter

Martin Pluskal-2
On Fri, 2017-11-24 at 11:58 +0200, Dave Plater wrote:

>
> On 24/11/2017 11:18, Martin Pluskal wrote:
> > On Thu, 2017-11-23 at 15:28 +0200, Dave Plater wrote:
> > > str instance, bytes found
> > > Giving no indication of where the error is but a context.TryRun(
> > > to
> > > test
> > > the c compiler is the point that it's at.
> > > Unfortunately my scons and python2 to 3 skills are a bit rusty so
> > > any
> > > help will be appreciated.
> >
> > Actually fedora solved this correctly - working version is at
> > home:pluskalm:python3/ffado [1] (fixed by tacit).
> >
> > Cheers
> >
> > M
> >
> > 1. https://build.opensuse.org/package/rdiff/home:pluskalm:python3/f
> > fado?linkrev=base&rev=2
> >
>
> Actually Fedora solved this with:
> +    return True # FIXME: The following TryRun fails on Python3
>
> I don't call that a fix I call it a work around.
Well call it as you wish but apparently Fedora had already  succesfully
switched scons to python3 and has building packages :)

Cheers

M
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]