Patchwork [3,of,3,in,crew] run-tests: use correct python safely under --jobs

login
register
mail settings
Submitter Adrian Buehlmann
Date Dec. 12, 2012, 12:41 p.m.
Message ID <50C87B90.4090706@cadifra.com>
Download mbox | patch
Permalink /patch/68/
State Accepted
Commit 5522a7951bd7e2b16831ba1736feb2e9145d7e58
Headers show

Comments

Adrian Buehlmann - Dec. 12, 2012, 12:41 p.m.
On 2012-12-12 02:35, Siddharth Agarwal wrote:
> Unfortunately it seems the trick of copying the python executable into 
> the hg directory doesn't work on Windows, because Windows Python depends 
> on other files in its own directory to work.

This is not entirely true, as at least a globally installed Python on
Windows will have the required dll's installed in a system directory and
should thus find them (and its other required files).

At least it does find them here (Windows 7 x64).

The tests pass here in MSYS using fe5a41144982 with:

$ PATH="/mingw/bin:/bin:`pwd`/..:/c/python:/c/python/scripts" python
run-tests.py --local

Two tests are currently failing here:


After the test, I see that there is a python.exe in the repo root.

And Microsoft's Windows "firewall" popped up alerting me that this
python.exe newly wants to start listening on some ports (which I
acknowledged).

> Mads suggested we make sure
> os.path.join(dirname(sys.executable), "python.exe") existed, and then 
> add that directory to the path.

I haven't investigated enough to comment on that.

But copying the python.exe feels indeed a bit strange on first thought here.
Siddharth Agarwal - Dec. 12, 2012, 6:31 p.m.
On 12/12/2012 04:41 AM, Adrian Buehlmann wrote:
> This is not entirely true, as at least a globally installed Python on
> Windows will have the required dll's installed in a system directory and
> should thus find them (and its other required files).

Interesting. That could be possible, but it doesn't seem like something 
we can rely on. Unfortunately most of this side-by-side stuff is a black 
box.
Adrian Buehlmann - Dec. 12, 2012, 7:33 p.m.
On 2012-12-12 19:31, Siddharth Agarwal wrote:
> On 12/12/2012 04:41 AM, Adrian Buehlmann wrote:
>> This is not entirely true, as at least a globally installed Python on
>> Windows will have the required dll's installed in a system directory and
>> should thus find them (and its other required files).
> 
> Interesting. That could be possible, but it doesn't seem like something 
> we can rely on. Unfortunately most of this side-by-side stuff is a black 
> box.

It's not that much of black magic.

You can see some of those tricks in mercurial/exewrapper.c.
Bryan O'Sullivan - Dec. 12, 2012, 10:54 p.m.
On Wed, Dec 12, 2012 at 4:41 AM, Adrian Buehlmann <adrian at cadifra.com>wrote:

> This is not entirely true, as at least a globally installed Python on
> Windows will have the required dll's installed in a system directory and
> should thus find them (and its other required files).
>

I've globally installed two incompatible versions of Python under Windows,
and come up with a solution that appears to work with both.

http://hg.intevation.org/mercurial/crew/rev/c135ab6413b4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121212/1c4faff6/attachment.html>

Patch

--- C:\Users\adi\hgrepos\hg-main\tests\test-install.t
+++ C:\Users\adi\hgrepos\hg-main\tests\test-install.t.err
@@ -1,7 +1,7 @@ 
 hg debuginstall
   $ hg debuginstall
   checking encoding (ascii)...
-  checking Python lib (*lib*)... (glob)
+  checking Python lib (C:\Python27_x64\Lib)...
   checking installed modules (*mercurial)... (glob)
   checking templates (*mercurial?templates)... (glob)
   checking commit editor...
@@ -11,7 +11,7 @@ 
 hg debuginstall with no username
   $ HGUSER= hg debuginstall
   checking encoding (ascii)...
-  checking Python lib (*lib*)... (glob)
+  checking Python lib (C:\Python27_x64\Lib)...
   checking installed modules (*mercurial)... (glob)
   checking templates (*mercurial?templates)... (glob)
   checking commit editor...

--- C:\Users\adi\hgrepos\hg-main\tests\test-rebase-pull.t
+++ C:\Users\adi\hgrepos\hg-main\tests\test-rebase-pull.t.err
@@ -144,7 +144,7 @@ 
   adding L1
   created new head
   $ hg pull --rev tip --rebase
-  pulling from $TESTTMP/a
+  pulling from $TESTTMP\a
   searching for changes
   adding changesets
   adding manifests