Menu

#144 fix exchange module batch builds

Unstable (example)
open
nobody
None
5
2016-02-27
2015-07-28
No

This patch resolves issues building the exchange module for 32-bit and 64-bit builds using the project batch build scripts. 64-bit builds now also include dummy functions that will raise a NotImplementedError for all of the unsupported 32-bit ExchangeSDK functions.

This patch also reverts some changes to setup.py introduced in [#124] that are no longer used.

Thanks to Mark for all of his help and suggestions to create this patch.

Building the exchange module requires installation of the Microsoft Exchange 2003 SDK

1 Attachments

Related

Old Patches - new patches via https://github.com/mhammond/pywin32/pulls: #124

Discussion

  • Mark Hammond

    Mark Hammond - 2016-02-27

    Sadly I can't make this work. I installed the new SDK and while 32bit builds work, the 64bit builds fail with unresolved externals for the UUIDs:

    Creating library build\temp.win-amd64-2.7\Release\com/win32comext/mapi/src\exchange.lib and objec
    t build\temp.win-amd64-2.7\Release\com/win32comext/mapi/src\exchange.exp
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IProfSect
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IMAPIStatus
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IABContainer
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IDistList
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IMailUser
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IAttachment
    mapiutil.obj : error LNK2001: unresolved external symbol IID_IMessage
    build\lib.win-amd64-2.7\win32comext/mapi\exchange.pyd : fatal error LNK1120: 7 unresolved externals
    error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe"' failed with exit status 1120

    Note that setup.py includes the block:

        if distutils.util.get_platform() == 'win-amd64':
            # Additional utility functions are only available for 32-bit builds.
            pass
        else:
            libs += " version user32 advapi32 Ex2KSdk sadapi netapi32"
    

    but it's not clear there are 64bit libs in that sdk. I'm out of time to dig further. I've attached the patch rebased against current tip.

     
  • Nick Czeczulin

    Nick Czeczulin - 2016-02-27

    I seemed to have been behind for some reason when I cloned, so I had to manually resolve the patch. Of course I didn't realize until much later that I was simply missing [#158]. However, I don't think that should have affected my build result being different.

    That said, I also originally failed building. Except I failed on the exchdapi module instead. The only change I needed to make for a successful build was:

    diff --git a/setup.py b/setup.py
    --- a/setup.py
    +++ b/setup.py
    @@ -810,7 +810,7 @@
             # Exclude exchange 32-bit utility libraries from 64-bit
             # builds. Note that the exchange module now builds, but only
             # includes interfaces for 64-bit builds.
    -        if self.plat_name == 'win-amd64' and ext.name in ['exchdapi', 'exchange']:
    +        if self.plat_name == 'win-amd64' and ext.name in ['exchdapi']:
                 return "No 64-bit library for utility functions available."
             if get_build_version() >=14 and ext.name in ['exchdapi', 'exchange']:
                 return "Haven't worked out how to make exchange modules build on vs2015"
    

    The fact that you are able to build the 32-bit version and only failing on the 64-bit exchange module leaves me puzzled as well.

     

    Related

    Old Patches - new patches via https://github.com/mhammond/pywin32/pulls: #158


Log in to post a comment.