[U-Boot] [RFC PATCH v2 0/2] Make Python scripts compatible with older versions
Tom Rini
trini at ti.com
Thu Aug 7 18:57:19 CEST 2014
On Thu, Aug 07, 2014 at 04:17:21PM +0300, Igor Grinberg wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 08/07/14 13:57, Tom Rini wrote:
> > On Mon, Aug 04, 2014 at 04:17:00PM +0300, Igor Grinberg wrote:
> >> Hi Masahiro,
> >>
> >> On 08/04/14 15:59, Masahiro Yamada wrote:
> >>> Hi.
> >>>
> >>>>
> >>>>> It seems that those scripts only work on Python versions 2.6 - 2.7?
> >>>
> >>>
> >>>
> >>> I took a quick look and I found Python 3.x is not comatible 2.x at all.
> >>>
> >>> 3.x requires the "print" is called like
> >>> print(msg, file=sys.stderr)
> >>> but it failes in Python 2.7.x.
> >>
> >> Last time I checked the print function, it worked with parenthesis on
> >> both versions 2.7 and 3.x.
> >>
> >>>
> >>> Moreover, "except ... , ..." fails in 3.x
> >>> while "except ... as ..." fails in 2.5 or earlier.
> >>>
> >>> If the compatibility with python 3 is the requirement,
> >>> I can't do this. I must throw Python scripts away.
> >>
> >> I think we'd better replace these with something more stable
> >> in terms of API... bash? perl?
> >
> > I don't think API is an argument against python,
>
> Not the API as stand alone, of course, but the burden to support
> its changes and breakages.
> Why should U-Boot even have python as a build prerequisite?
> I really think that having shell, make, and $(cross)gcc should be
> enough for the basic source build.
>
> > we just need
> > /usr/bin/env python2 as how we invoke our scripts.
>
> This means impose python version dependency for U-Boot source build?
> Correct me if you think I'm wrong, but I don't think this is a good
> practice...
> I think that for tools like buildman, patman, etc. - this is
> perfectly fine to impose an interpreter/compiler version, but not
> for the basic source builds.
I agree. You don't need MAKEALL or buildman to do basic source builds.
Doing 'make foo_defconfig' doesn't require re-creating boards.cfg.
To me, the gray area is people doing SoC level (or higher) changes that
want to be good and test more areas. That's when MAKEALL or buildman
become handy and some sort of win over a shell forloop.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140807/751461f3/attachment.pgp>
More information about the U-Boot
mailing list