Bug 1542376 - Avoid exception during Android bootstrap. r=glandium
authorBobby Holley <bobbyholley@gmail.com>
Fri, 05 Apr 2019 22:07:30 +0000
changeset 468251 39c1b02a33f5392adcb11238fa821da84574d057
parent 468250 6f723cac81ddf18954af5c5b3d430864e849930b
child 468252 2602ed5c149cd375608ac36787014185021abf3a
push id35824
push userapavel@mozilla.com
push dateSat, 06 Apr 2019 10:57:50 +0000
treeherdermozilla-central@a765634b9ec2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1542376
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1542376 - Avoid exception during Android bootstrap. r=glandium Mozboot uses Python 2.7.3, along with the |unicode_literals| directive, which makes string literals unicode by default. However, the LooseVersion implementation that ships with Python throws an exception when comparing against bare unicode strings, because it only checks for StringType, not UnicodeType [1]. [1] https://github.com/enthought/Python-2.7.3/blob/master/Lib/distutils/version.py#L292 Differential Revision: https://phabricator.services.mozilla.com/D26378
python/mozboot/mozboot/base.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -703,17 +703,17 @@ class BaseBootstrapper(object):
         # Support 32-bit Windows on 64-bit Windows.
         win32 = 'i686-pc-windows-msvc'
         win64 = 'x86_64-pc-windows-msvc'
         if rust.platform() == win64 and win32 not in targets:
             subprocess.check_call([rustup, 'target', 'add', win32])
 
         if 'mobile_android' in self.application:
             # Let's add the most common targets.
-            if rust_version < '1.33':
+            if rust_version < LooseVersion('1.33'):
                 arm_target = 'armv7-linux-androideabi'
             else:
                 arm_target = 'thumbv7neon-linux-androideabi'
             android_targets = (arm_target,
                                'aarch64-linux-android',
                                'i686-linux-android',
                                'x86_64-linux-android', )
             for target in android_targets: