Hi All,
in the restricted env I have to live at work (corporate windows-based, can't install python, can't install apache, don't reaaaally want to fiddle with IIS), I'm taking much more care of the windows binary than ever ^_^
Also, I bashed Massimo's a few times saying that the binary he rebuilds lead to an unusual smaller library.zip than the one obtained by running py2exe.
After a few rounds, I discovered that by default py2exe packages exactly two copies of gluon (and gluon/contrib) as duplicate files into library.zip .
It may be due to circular imports (and/or from gluon.something import something vs import something).
To
sum up, tomorrow I'll test a build obtained by a slightly modified
setup_exe.py that eliminates the issue de-compressing and re-compressing
library.zip, and I'll then send a PR if it all works out.
It's clearly an hack, and to be fair, py2exe is slightly unpredictable (and seems a bit "old").
That's reason one to look for alternatives.
Reason 2: I tried unsuccessfully to build web2py including something more "speedy" than rocket to be served in.
After a little bit of thought, seemed that on windows the best option was gevent (has even SSL support!).
But....gevent + py2exe is like asking for disaster.
So, I started looking at bbfreeze. Yes, it's a little bit undocumented, but the source code is quite understandable .
One or two hacks later, web2py was working fine with no need for workarounds, packed with bbfreeze.
Bonus points, I could successfully package gevent in it, so I can serve web2py apps with gevent.pywsgi! (roughly, 3x performance speedup, and a solid 15x just serving static files). In addition to the "default" two binaries, I created a third one stripping out anyserver to serve only on gevent (web2py_gevent.exe)
Now, 3 questions:
- is anyone contrary in shifting to bbfreeze for building the windows binary (less hackish, not 5 years old, etc) ? The current Makefile doesn't need to change, bbfreeze ships library.zip too.
- does anyone like the idea of a 3x performance speedup on windows ?
- is this worth it ?