Search code examples
javacmacosprotocol-buffersthrift

Apache Thrift not installing on Mac


Mac OSX 10.10.5 (Yosemite) here. I am trying to find a tool that will:

  1. Given a definition/config file, generate a native C network/socket client (library); and
  2. Given a definition/config file, generate a Java network/socket server

In reality both artifacts will be ran (likely) on the same machine, but one has to be native C and the other has to be Java.

I believe Thrift is a tool that can do this job, but if it's not, or if there are other/better/easier tools to use, then I'm certainly open to other recommendations.


Right off the bat, I sort of expected Thrift to come in some kind of distribution, ready to be ran as-is. Instead, according to the documentation it looks like you have to build it yourself. Enter the pain.

I downloaded the tarball (v0.9.3) and then navigated to the unpacked directory. Then I run ./configure (as those docs state to do), which produces an enormous amount of output, most suspiciously:

Building C++ Library ......... : yes
Building C (GLib) Library .... : no     <--- heh?
Building Java Library ........ : no     <--- heh?
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : no
Building Haxe Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : yes
Building PHP Library ......... : yes
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no
Building NodeJS Library ...... : yes
Building Lua Library ......... : no

Now I don't know anything about Thrift, but to me, that looks like it's not building out "libraries"/"generators"/etc. for C or Java, the two lanaguages I'm specifically interested in!!! (1) Any ideas as to why?

Next, the instructions state to run make, which produces indecipherable compiler errors:

...blah blah blah lots of compiler output, blah blah blah...

src/thrift/transport/TSSLSocket.cpp:147:24: error: use of undeclared identifier 'TLSv1_1_method'; did you mean 'TLSv1_method'?
    ctx_ = SSL_CTX_new(TLSv1_1_method());
                       ^~~~~~~~~~~~~~
                       TLSv1_method

src/thrift/transport/TSSLSocket.cpp:149:24: error: use of undeclared identifier 'TLSv1_2_method'; did you mean 'TLSv1_method'?
    ctx_ = SSL_CTX_new(TLSv1_2_method());
                       ^~~~~~~~~~~~~~
                       TLSv1_method

74 warnings and 2 errors generated.
make[4]: *** [src/thrift/transport/TSSLSocket.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

(2) Any idea how to troubleshoot here?!?

This seems like I'm going 3 sides around the barn. In other areas of the documentation, I need to build several other libraries (Boost and libevent), and I ran into all sorts of headaches with the instructions for those builds as well (e.g. the version of libevent didn't like the version of Bison that I had that ships by default with Mac, etc.).

Does Thrift come as a fully-ready-to-go app that I can just run on Mac OS? Why do I need to go through the motions of all this building?

So most importantly: (3) If it exists, where can I find a ready-to-run Thrift Mac executable? And if it does not exist, are there other tools out there that are easier to install/run?


Solution

  • In the end, it was as simple as:

    brew install thrift