bzr 1.14: Installing from source broken by default on Windows when compiling extensions
John Arbash Meinel
john at arbash-meinel.com
Fri May 1 16:39:38 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Gary van der Merwe wrote:
> On Fri, May 1, 2009 at 4:30 PM, John Arbash Meinel
> <john at arbash-meinel.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> It is a problem when using the pure python executable to build the
>> pure-win32 extensions. It knows how to find 'gcc.exe' but not when that
>> object is a symlink.
>> If you set 'compiler = mingw' (or python setup.py -c mingw) it will
>> search for C:\cygwin\bin\gcc.exe
>> And it knows to pass '-mno-cygwin' so that you don't end up with a
>> binary that is built against cygwin?.dll.
>> I do this intentionally because I *don't* want to accidentally use the
>> cygwin python and build cygwin extensions. (IIRC, cygwin python will
>> actually build .dll files instead of .pyd, for a bit of special
>> craziness, which means you can actually build *both* cygwin dlls and
>> win32 dlls in the same place, as long as you build the win32 ones
>> *first* so win32 python doesn't try to load the cygwin version.)
> I just checked - I don't have cygwin's python installed, and it must
> be using "pure-python" cause it's creating .pyd files.
> Just to confirm - If I run
> python setup.py build -c mingw32
> in command prompt - I get :
> building 'bzrlib._btree_serializer_c' extension
> gcc -mno-cygwin -mdll -O -Wall -DWIN32 -IC:\Python25\include
> -IC:\Python25\PC -c bzrlib/_btree_serializer_c.c -o
> Cannot build extension "bzrlib._btree_serializer_c".
> Use "build_ext --allow-python-fallback" to use slower python
> implementations instead.
> error: command 'gcc' failed: No such file or directory
> and from cygwin bash shell it works.
Which 'python' are you running in both situations? I'm guessing the
latter is using cygwin's python, and the former is using win32 python.
Mostly stated, because I do, indeed, run under bash *all the time*, I
just call out to the native python interpreter to run things. (I alias
it to 'py' but that is just an implementation detail.)
I would double check the extensions that are getting built. We may be
fine, if they are, indeed, using -mno-cygwin.
But win32 python's 'subprocess' module has no way of following cygwin
symlinks in order to invoke 'gcc' directly.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar