win32 confirmed build

20 views
Skip to first unread message

Nicolas Lehuen

unread,
Jul 17, 2007, 7:49:17 PM7/17/07
to modwsgi
Hi Adal,

Just passing by to confirm that your build script works like a charm.
I especially like the templating idea.

I'm somewhat responsible for the win32 builds of mod_python, so Graham
asked me to have a look at mod_wsgi. Unfortunately, I was not as fast
as you ;).

I have also another build system that relies on the standard Python
setup.py procedure. It *could* allow us to support other compiler than
MSVC7.1, which is becoming increasingly rare, as well as other
platforms.

The script can be found at the address below, and it's heavily
inspired from mod_python, of course...

http://nicolas.lehuen.com/download/mod_wsgi/

Regards,
Nicolas

Adal Chiriliuc

unread,
Jul 19, 2007, 11:56:03 AM7/19/07
to modwsgi
Hello Nicolas,

I'm glad that the script worked.

Unfortunately I couldn't try your script since from what Graham said
it requires a Perl installation and I really don't want to do that
(bad memories) :)

I also don't like VC71. Unfortunately we are stuck with it since it's
the one used by the binary release of Python 2.4/2.5 for Windows.
Visual Studio 2008, the next compiler likely to be used by Python will
probably appear after Python 2.6 is out, so one more iteration with
VC71 :(

I thought about mentioning the compiler warnings generated by Visual
Studio 2005.

Level 3 warnings (default warning level):

mod_wsgi.c(1287) : warning C4018: '>=' : signed/unsigned mismatch
mod_wsgi.c(1328) : warning C4018: '<' : signed/unsigned mismatch
mod_wsgi.c(1428) : warning C4018: '<' : signed/unsigned mismatch
mod_wsgi.c(1453) : warning C4018: '<' : signed/unsigned mismatch
mod_wsgi.c(1568) : warning C4018: '<' : signed/unsigned mismatch

Level 4 warnings:

mod_wsgi.c(302) : warning C4100: 's' : unreferenced formal parameter
mod_wsgi.c(421) : warning C4100: 'dir' : unreferenced formal parameter
mod_wsgi.c(1314) : warning C4389: '!=' : signed/unsigned mismatch
mod_wsgi.c(1329) : warning C4389: '!=' : signed/unsigned mismatch
mod_wsgi.c(1361) : warning C4389: '!=' : signed/unsigned mismatch
mod_wsgi.c(1506) : warning C4389: '!=' : signed/unsigned mismatch
mod_wsgi.c(1653) : warning C4389: '!=' : signed/unsigned mismatch
mod_wsgi.c(1689) : warning C4127: conditional expression is constant
mod_wsgi.c(2116) : warning C4127: conditional expression is constant
mod_wsgi.c(2116) : warning C4127: conditional expression is constant
mod_wsgi.c(2119) : warning C4127: conditional expression is constant
mod_wsgi.c(2119) : warning C4127: conditional expression is constant
mod_wsgi.c(2472) : warning C4100: 'name' : unreferenced formal
parameter
mod_wsgi.c(2528) : warning C4100: 'self' : unreferenced formal
parameter
mod_wsgi.c(3127) : warning C4100: 'data' : unreferenced formal
parameter
mod_wsgi.c(3740) : warning C4100: 'data' : unreferenced formal
parameter
mod_wsgi.c(3887) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(3914) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(3930) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(3946) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(3962) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(3978) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(4000) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(4022) : warning C4100: 'mconfig' : unreferenced formal
parameter
mod_wsgi.c(4419) : warning C4189: 'c' : local variable is initialized
but not referenced
mod_wsgi.c(6867) : warning C4100: 'plog' : unreferenced formal
parameter
mod_wsgi.c(6866) : warning C4100: 'ptemp' : unreferenced formal
parameter
mod_wsgi.c(6932) : warning C4100: 's' : unreferenced formal parameter
mod_wsgi.c(6937) : warning C4100: 'p' : unreferenced formal parameter

mod_wsgi.c(1006) : warning C4706: assignment within conditional
expression
mod_wsgi.c(1692) : warning C4706: assignment within conditional
expression
mod_wsgi.c(2296) : warning C4706: assignment within conditional
expression
mod_wsgi.c(3402) : warning C4706: assignment within conditional
expression

Maybe the "unreferenced formal parameter" warnings could be fixed by
commenting the name of the parameter? That's what I usually do in C++.
I'm not sure if this is the C/Linux way.

Ben Hoyt

unread,
Jul 19, 2007, 2:30:49 PM7/19/07
to mod...@googlegroups.com
I'm running Windows XP, but I don't have VC so I can't build mod_wsgi myself. If it's easy for one of you guys to build against Python 2.5(.1) and Apache 2.0(.59) and put the binary somewhere, I'd be happy to do some Win32 testing ...

(At the moment we're using mod_python on our Windows devel machines and mod_wsgi on our server.)

Cheers,
-Ben

--
Ben Hoyt, +64 21 331 841
http://www.benhoyt.com/

Graham Dumpleton

unread,
Jul 19, 2007, 6:14:12 PM7/19/07
to mod...@googlegroups.com
On 20/07/07, Adal Chiriliuc <adal.ch...@gmail.com> wrote:
>
> Hello Nicolas,
>
> I'm glad that the script worked.
>
> Unfortunately I couldn't try your script since from what Graham said
> it requires a Perl installation and I really don't want to do that
> (bad memories) :)

The script that Nicolas came up with doesn't use Perl, it is a
standard Python distutils type build script. Nicolas was scared off of
the Perl requirement as well and so used similar Python only approach
to what mod_python uses.

Graham

Adal Chiriliuc

unread,
Jul 19, 2007, 6:54:56 PM7/19/07
to modwsgi
Sorry for the misunderstanding. I'll give it another try tomorrow.

I've put binaries for Python 2.4/2.5 combined with Apache 2.0/2.2
here:
http://adal.chiriliuc.com/temp/mod_wsgi_win32/

On 20 Jul, 01:14, "Graham Dumpleton" <graham.dumple...@gmail.com>
wrote:

Ben Hoyt

unread,
Jul 19, 2007, 7:21:13 PM7/19/07
to mod...@googlegroups.com, mPledge Group
Sweet! Thanks. I'll give your 2.5/2.0 binary a try in the next few days. -Ben

Adal Chiriliuc

unread,
Jul 20, 2007, 5:42:48 AM7/20/07
to modwsgi
I've tried your setup.py. It worked without having to install
anything.

I've also tested the generated binary (Python 2.5/Apache 2.2) and it
worked perfectly.

I have one small suggestion: maybe you can add an extra build step to
automatically rename mod_wsgi_so.pyd to mod_wsgi.so.

On Jul 18, 2:49 am, Nicolas Lehuen <nicolas.leh...@gmail.com> wrote:

Ben Hoyt

unread,
Jul 20, 2007, 9:42:06 PM7/20/07
to mod...@googlegroups.com, mPledge Group
I've put binaries for Python 2.4/2.5 combined with Apache 2.0/2.2
here:
http://adal.chiriliuc.com/temp/mod_wsgi_win32/

I've just been playing with the Python 2.5, Apache 2.0 binary on my Windows devel machine. Works great, thanks Adal!

Using WSGIScriptAlias and running a simple "Hello world" under web.py I got around 700 requests/second with mod_python, and 1000 requests/second with mod_wsgi (with "ab -n1000 -c10 http://localhost/test"). That's not quite the more-than-twice-as-fast benchmark that Graham got (presumably under *nix), but a lot of that's probably web.py overhead, because I get 2000 requests/sec with a static file.

Are those Win32 builds going to stay at that address? I don't suppose Graham D would want to link them as "beta Win32 binaries" from the mod_wsgi pages ... or maybe put them on the Downloads page marked as beta? Could be helpful for people like me in the future. :-)

-Ben



On 20 Jul, 01:14, "Graham Dumpleton" < graham.dumple...@gmail.com>
wrote:
> On 20/07/07, Adal Chiriliuc <adal.chiril...@gmail.com> wrote:
>
>
>
> > Hello Nicolas,
>
> > I'm glad that the script worked.
>
> > Unfortunately I couldn't try your script since from what Graham said
> > it requires a Perl installation and I really don't want to do that
> > (bad memories) :)
>
> The script that Nicolas came up with doesn't use Perl, it is a
> standard Python distutils type build script. Nicolas was scared off of
> the Perl requirement as well and so used similar Python only approach
> to what mod_python uses.
>
> Graham


Adal Chiriliuc

unread,
Jul 23, 2007, 4:55:00 AM7/23/07
to modwsgi
I will continue to compile mod_wsgi from time to time (since I use it
myself) and make the builds available at the same address.

On Jul 21, 4:42 am, "Ben Hoyt" <benh...@gmail.com> wrote:
> > I've put binaries for Python 2.4/2.5 combined with Apache 2.0/2.2
> > here:
> >http://adal.chiriliuc.com/temp/mod_wsgi_win32/
>
> I've just been playing with the Python 2.5, Apache 2.0 binary on my Windows
> devel machine. Works great, thanks Adal!
>
> Using WSGIScriptAlias and running a simple "Hello world" under web.py I got
> around 700 requests/second with mod_python, and 1000 requests/second with

> mod_wsgi (with "ab -n1000 -c10http://localhost/test"). That's not quite the

Graham Dumpleton

unread,
Jul 25, 2007, 12:26:43 AM7/25/07
to mod...@googlegroups.com
Adal, can you update mod_wsgi source code from repository (rev 385)
and recompile for Windows and reconfirm it works.

If all is okay I'll then tag this as 1.0c1 and create a source tarball
for release area.

I would then with your help like to get together some instructions for
installing Windows binaries you have been creating. Want to list stuff
like MS C/C++ runtime library dependencies for each Apache/Python
variant, plus things like ensuring access permissions are such that
Apache can read module and MS C/C++ runtime libraries, and that Python
was installed as administrator so that registry entries setup so
Apache service user will find them etc etc. In other words, a big list
of all the possible Windows issues that have come up over the years
with mod_python and which could also affect mod_wsgi.

Note, at the moment I haven't included either your build scripts or
Nicolas' script in the actual source package. We can work on including
some solution in source when we work through some instructions.

Thanks.

Graham

Ben Hoyt

unread,
Jul 25, 2007, 12:52:28 AM7/25/07
to mod...@googlegroups.com
I would then with your help like to get together some instructions for
installing Windows binaries you have been creating. Want to list stuff
like MS C/C++ runtime library dependencies for each Apache/Python
variant, plus things like ensuring access permissions are such that
Apache can read module and MS C/C++ runtime libraries, and that Python
was installed as administrator so that registry entries setup so
Apache service user will find them etc etc. In other words, a big list
of all the possible Windows issues that have come up over the years
with mod_python and which could also affect mod_wsgi.

Wow, that is a big list. My install procedure was:

copy mod_wsgi.so "C:\Program Files\Apache Group\Apache2\modules\"

:-)

But I guess there are plenty of issues I *could* have faced. Besides, this is just my development machine, so I'm not worried about security.

Cheers,
Ben.

Adal Chiriliuc

unread,
Jul 25, 2007, 10:10:25 AM7/25/07
to modwsgi
I've put updated binaries here:
http://adal.chiriliuc.com/temp/mod_wsgi-1.0c1-rev_385-win32/

I've tested all four of them, they work properly.

In the previous test I couldn't get the Python 2.4 version to serve my
Pylons application. This was caused by me having two installed
versions of Python 2.4 and forgetting that in the registry the other
one than I was expecting was active (since it was the last one
installed). I fixed this and it worked.

> ensuring access permissions are such that Apache can read module and MS C/C++ runtime libraries.

As far as I can think this is not an issue on Windows (unless the user
played with file/folder permissions which would be unusual).

> Want to list stuff like MS C/C++ runtime library dependencies for each Apache/Python variant

This is easy. All of them have only one runtime library dependency:
msvcr71.dll. There is a potential problem here: if this library is not
installed somewhere in PATH, mod_wsgi.so will fail to load. The Python
2.4/2.5 installer puts this file in the Windows\system32 folder (which
is in PATH) if it's run as an administrator. Otherwise I think in the
Python installation folder (not sure). If it's put in the installation
folder, and that folder is added to the user PATH (so that python.exe
can be started from a command line), it should also work.

Or the user can just copy the file and put it next to mod_wsgi.so (or
apache.exe/httpd.exe - it depends on how Apache loads the dynamic
modules).

That being said, if Python was installed by an administrator for all
users, it should just work.

Note: in all my tests, I started Apache from a command line. I didn't
tried it when run as a service.

On Jul 25, 7:26 am, "Graham Dumpleton" <graham.dumple...@gmail.com>
wrote:

Reply all
Reply to author
Forward
0 new messages