[PATCH STABLE] setup: fix build_hgexe for mingw32 compiler

Adrian Buehlmann adrian at cadifra.com
Sat Jul 28 15:12:02 CDT 2012


On 2012-07-28 17:46, Patrick Mézard wrote:
> Le 25/07/12 16:50, Adrian Buehlmann a écrit :
>> # HG changeset patch
>> # User Adrian Buehlmann <adrian at cadifra.com>
>> # Date 1343227822 -7200
>> # Branch stable
>> # Node ID 450330d3276f34576b98fd2d940c257f4bdef73b
>> # Parent  ffc49100151b68c0bcd061b900d9993e9e1a0d7d
>> setup: fix build_hgexe for mingw32 compiler
>>
>> Fixes
>>
>>   python setup.py build_hgexe -i --compiler=mingw32
> 
> This is not exactly related to this patch but to exewrapper, but I would like to mention we had to tweak the existing Windows buildbot setup to have it run with exewrapper. The errors were:
> 
>   http://hgbuildbot.kublai.com/builders/Windows%202008%20R2%20hg%20tests%20(stable)/builds/94/steps/run-tests.py%20(python2.6)/logs/stdio
> 
> and the fix was to explicitely set $PYTHONHOME to the python interpreter used to build and run the tests. I do not know why PYTHONHOME helped here as the referenced python interpreter was already the first in $PATH (there is at least another global one installed on the box), but it helped.
> 
> Is it the symptom of possible problems with exewrapper or the test suite, I do not know.

I found the following works:

Assuming an x64 Python 2.7 is used, which is installed in C:\Python27_x64.

In the repo root of a local clone of Mercurial do:

  $ C:\Python27_x64\python.exe setup.py build_ext -i
  $ C:\Python27_x64\python.exe setup.py build_hgexe -i

This should build the hg.exe and the mercurial/*.pyd files using the MS
toolchain (alternatively, this should work with --compiler=mingw32 too).

Now, copy the folder C:\Python27_x64\Lib into the repo root. Or zip its
contents to python27.zip (make sure there is no "Lib" top directory
inside the zip) and put that zip file into the repo root.

Then copy the contents of C:\Python27_x64\DLLs into the repo root
(specifically the files _ctypes.pyd, _socket.pyd, etc.).

Copy python27.dll (I found it in C:\Windows\System32 here) into the repo
root.

If you do that, setting $PYTHONHOME should no longer be needed. hg.exe
will find the things it needs right next to it.


More information about the Mercurial-devel mailing list