The subject of which version of Python to require to build the tree came
up in bug 784841.
We currently require Python >= 2.5 but <3 to build the tree. The main
reason for the 2.5 requirement is the Linux build slaves still run
Python 2.5. Those of us who code Python for the tree have long wanted to
require at least 2.6 because 2.5 is missing many desired features. And,
since 2.6+ is ubiquitous these days, people (sometimes unknowingly)
target it (because it's what's installed locally) and then have to go
through trouble (or tree breakage) to backport compatibility to 2.5.
Personally, I feel that targeting 2.5 is extremely painful (especially
once you've used 2.6+) that I sometimes get discouraged from landing new
features to the build system or test suites because I don't want to deal
with 2.5 compatibility.
I'm pretty sure that no reasonably sized faction will have complaints
about bumping up the minimum version to 2.6. So, the question becomes
whether we should jump all the way to 2.7.
I believe we should.
Taking the long view, we will eventually need to switch to Python 3. Our
migration to Python 3 will likely involve porting all the code to
simultaneously run on both 2.x and 3.x. Python 2.7 has more backported
features from Python 3 than Python 2.6, so ensuring dual compatibility
while employing useful and convenient newer features [1] should be
easier with 2.7.
Shorter term, 2.7 is the superior Python release. There are literally
dozens of bug fixes and minor newer features. Individually, these don't
seem like much. Cumulatively, they represent a lot of saved time and pain.
Objections to requiring 2.7 will likely be about it not being installed
everywhere out of the box. Let's examine that.
MozillaBuild has shipped with Python 2.7 since November 2011. So,
Windows is taken care of.
OS X 10.7+ ship with Python 2.7. No action necessary. OS X 10.6 ships
with 2.6. However, 2.7 is easy to install through Homebrew, MacPorts, or
an official installer available through python.org. I believe the same
is true for 10.5. I don't consider this to be a hurdle on OS X,
especially since we already require similar steps for other required
packages there.
Linux distros are all over the map. Many include 2.7 as part of the
standard distribution. If they don't, they often include a "python27"
package. Or, at least it is a popular enough package that someone on the
internets provides an RPM, .deb, etc. We would just need to point people
at those in the build instructions on MDN.
In the worst case, you will need to compile Python from source. This is
literally |./configure && make && make install|. Not difficult if you
ask me.
Now, for those who need them (and that number goes down with time as 2.7
becomes more prevalent than 2.6), these will be extra steps. And, every
extra step makes getting started for first-time developers a little
harder. In the grand scheme of all the steps required to build the tree
today, I don't think it's such a big deal. Besides, work is currently
being done to enable one-line system bootstrap to help people initially
configure their systems [2]. Once landed, concerns about setting up
systems to build the tree should be rendered irrelevant for supported
platforms.
Some may say "why not go all the way and require Python 3?" Well,
"require" is a strong word. In my opinion we need to "support" it first.
This is because we almost certainly want to avoid a flag day conversion
because it would be a huge headache for releng and everyone else. This
means a period where we simultaneously support 2.x and 3.x. Once we have
dual support, then we can talk about requiring 3.x.
So, 2.6 or 2.7?
[1] http://docs.python.org/release/2.7.3/whatsnew/2.7.html
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=774112
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform