thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Schmit <msch...@gmail.com>
Subject Re: No C++ types output from Thrift compiler on Windows
Date Mon, 21 Sep 2009 05:45:29 GMT
I decided it probably wasn't a build error and just debugged, and thankfully
seem to have found the problem.  Apparently when building with MinGW under
Cygwin, compiler/cpp/main.cc is using the windows function GetFullPathName,
which returns a string full of backslashes.  All of the compiler code is
hardcoded to do rfind for forward-slashes, so it all breaks and produces
paths like "./gen-cpp/c:\temp\thrift\thrift\tutorial\shared_types.h" instead
of "./gen-cpp/shared_types.h".  Once I made main.cc:saferealpath replace '\'
with '/' the output worked fine.
Since I'd rather not go through the trouble of trying to set up code
contribution just to fix this minor bug, I'd appreciate it if someone who
works with this code regularly would add something akin to the following to
main.cc:194.5 just before "return resolved_path;":

size_t resolved_len = strlen(resolved_path);
for (size_t i = 0; i < resolved_len; ++i) {
  if (resolved_path[i] == '\\')
    resolved_path[i] = '/';
}

I'd also appreciate if the
http://wiki.apache.org/thrift/ThriftInstallationWin32 was updated to say
"after you build, get your non-cygwin-dependent .exe from the hidden '.libs'
directory", since it seems the thrift.exe in the local directory is merely a
cygwin1.dll-using pointer to that and this confused me for the longest time.

I tried sending this earlier with the binary attached, but my mail got
rejected so I assume it's because of the attachment.  If there's a place I
can upload the win32 binary for you all to host I'd be happy to do so.

-Mark

On Mon, Sep 14, 2009 at 11:38 PM, Bruce Simpson <bms@incunabulum.net> wrote:

> Mark Schmit wrote:
>
>> Did this not go through or do people simply not build on (or care about
>> thrift compiler on) Windows?  Has anyone else encountered similar
>> problems?
>> -Mark
>>
>>
>
> Give MinGW + MSYS a try. It will not attempt to shim all of the POSIX APIs
> the way Cygwin does, but you might have better luck with it. The MSYS
> developer tools are needed to run configure scripts, and it has a GNU make.
>
> Have a look at the XORP BUILD_NOTES for step-by-step instructions on
> installing that stack of developer tools. We're not supporting Win32, for
> the moment, in XORP, due to a lack of active maintainership or current
> interest from Microsoft:-
>
> http://xorp.svn.sourceforge.net/viewvc/xorp/trunk/xorp/BUILD_NOTES?revision=11305&view=markup
>
> Scroll down to "Windows Server 2003".
>
> MinGW applications link directly against the Microsoft C Runtime,
> MSVCRT.DLL, shipped in all versions of Windows since Windows 98. One known
> issue with that DLL is that snprintf() has a very different return value
> from how it is implemented in the popular UNIX-like systems.
>
> If you need a Win32 Python, try the ActiveState build -- I have had better
> luck with it in the past. good luck!
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message