On 7/09/2015 2:19 AM, Alessandro Pilotti wrote:
Hi all,

I’m getting some Python based projects to work on Microsoft Nano Server,
in particular OpenStack Hyper-V / Windows componens and Cloudbase-Init /
Cloud-Init for Windows.

Python 3.4 x64 and Python 2.7 x64 currently work fine on Nano (Python
2.7 needs to be compiled targetting VS 2010 or above), but pywin32
required some work as Nano supports a significantly reduced API surface,
although proxies called reverse forwarders are included to simplify
porting of pre-existing applications.

Failing to remove unavailable exports results in DLL loading failures
(C000142 / C0000135 errors), as you’d expect.

Here’s a fork of the pywin32 repository with Nano support, which works
on the publicly availbale Nano server builds (e.g. Windows Server TP3).
In particular here's the relevant patch:
https://bitbucket.org/cloudbase/pywin32/commits/cae1b44e00195847312a4521ae6c5cca3bb5b195

The patch is quite coarse grained and is meant to provide a fully
working PoC and not meant for merging at the current stage, as some
cleanup and tests are needed, but it should give though an idea of the
scope of work.

That looks fine, although a consideration will be packaging - it appears to mean there will need to be twice as many packages built, and the potential for confusion by users who have no idea what a "nano" build is and whether they want that.

Another alternative (that is probably not viable) may be to build a (many?) "stub" DLL(s) that throws errors and is conditionally loaded, thus allowing the same distribution (but with reduced functionality) to be used on nano.

TBH though, I'd be fine with a patch such as you provided with an eye to a better solution in the future - but I'm not sure I can commit to making nano-specific builds for every current build. That might mean people wanting a nano build need to make one themselves, but at least they will be able to do so without modifying the source.

(Also note that the .cpp files in pywin32 tend to use tabs rather than spaces (hysterical raisins) , but your patch is using spaces)

Do you guys have already a plan around Nano support for pywin32?

Nope - it sounds like you are helping make one though ;)

Thanks!

Mark

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to