Rev 4815: Require pyrex 0.9.6.3 as the minimum version to build the static_tuple extensions. in http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b1-minimum-pyrex

John Arbash Meinel john at arbash-meinel.com
Wed Feb 17 16:55:23 GMT 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b1-minimum-pyrex

------------------------------------------------------------
revno: 4815
revision-id: john at arbash-meinel.com-20100217165455-g4v9swlc4eyyr4sq
parent: pqm at pqm.ubuntu.com-20100217065845-lmm1uctm5jlcy8d2
fixes bug(s): https://launchpad.net/bugs/449776
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b1-minimum-pyrex
timestamp: Wed 2010-02-17 10:54:55 -0600
message:
  Require pyrex 0.9.6.3 as the minimum version to build the static_tuple extensions.
  
  bug #449776
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2010-02-17 06:01:54 +0000
+++ b/NEWS	2010-02-17 16:54:55 +0000
@@ -18,6 +18,10 @@
   problems importing bzrlib from a non-main thread.
   (Elliot Murphy, #521989)
 
+* Warn if pyrex is too old to compile the new ``SimpleSet`` and
+  ``StaticTuple`` extensions, rather than having the build fail randomly.
+  (John Arbash Meinel, #449776)
+
 
 bzr 2.1.0
 #########

=== modified file 'setup.py'
--- a/setup.py	2010-01-12 06:30:41 +0000
+++ b/setup.py	2010-02-17 16:54:55 +0000
@@ -186,6 +186,7 @@
     from distutils.command.build_ext import build_ext
 else:
     have_pyrex = True
+    pyrex_version_info = map(int, pyrex_version.split('.'))
 
 
 class build_ext_if_possible(build_ext):
@@ -282,7 +283,7 @@
     add_pyrex_extension('bzrlib._walkdirs_win32')
     z_lib = 'zdll'
 else:
-    if have_pyrex and pyrex_version.startswith('0.9.4'):
+    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
         # Pyrex 0.9.4.1 fails to compile this extension correctly
         # The code it generates re-uses a "local" pointer and
         # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
@@ -301,9 +302,20 @@
 add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
 ext_modules.append(Extension('bzrlib._patiencediff_c',
                              ['bzrlib/_patiencediff_c.c']))
-add_pyrex_extension('bzrlib._simple_set_pyx')
-ext_modules.append(Extension('bzrlib._static_tuple_c',
-                             ['bzrlib/_static_tuple_c.c']))
+if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
+    print
+    print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
+        pyrex_version)
+    print 'and static_tuple extensions.'
+    print 'Please upgrade to at least Pyrex 0.9.6.3'
+    print
+    # TODO: Should this be a fatal error?
+else:
+    # We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
+    # on simple_set
+    add_pyrex_extension('bzrlib._simple_set_pyx')
+    ext_modules.append(Extension('bzrlib._static_tuple_c',
+                                 ['bzrlib/_static_tuple_c.c']))
 add_pyrex_extension('bzrlib._btree_serializer_pyx')
 
 



More information about the bazaar-commits mailing list