apocolipse / Thrift-Swift

Apache Thrift native Swift library
53 stars 32 forks source link

[noob question] where is the thrift binary? #11

Closed AndrewSB closed 6 years ago

AndrewSB commented 7 years ago

Instructions say to use thrift --gen swift_3 thrift_file, but I'm having trouble understanding how to invoke that. Where do I get this thrift binary from?

wyland commented 6 years ago

You can find the apache version of thrift available on brew:

brew install thrift

However, because this project depends on an open pull request that has yet to be merged with Apache, you will need to install the version found in this repository manually using something like:

git clone https://github.com/apocolipse/thrift.git
cd thrift
PATH="/usr/local/opt/bison/bin:$PATH" ./bootstrap.sh
PATH="/usr/local/opt/bison/bin:$PATH" ./configure --disable-debug --prefix=/usr/local/Cellar/thrift/mine --libdir=/usr/local/Cellar/thrift/mine/lib --without-ruby --disable-tests --without-php_extension --without-python --without-haskell --without-java --without-perl --without-php --without-erlang --without-boost
PATH="/usr/local/opt/bison/bin:$PATH" make && make install

Which you can then run using:

/usr/local/Cellar/thrift/mine/bin/thrift --gen swift_3 thrift_file
AndrewSB commented 6 years ago

and what exactly is this doing? Does make && make installing it mean it overwrites my brew installed thrift in /usr/local/bin/thrift with a version made from apocolipse/thrift.git?

ghost commented 6 years ago

Does make && make installing it mean it overwrites ... No, it does not .

@wyland has already wrote step by step instructions. Use it.

AndrewSB commented 6 years ago

Ohhh, I totally misunderstood the last point. I've been using the thrift in my PATH (/usr/local/bin/thrift), not /usr/local/Cellar/thrift/mine/bin/thrift. I didn't realize that was a real path.

Retrying

AndrewSB commented 6 years ago

That was amazing!

Why does make && make install write to /usr/local/Cellar/thrift/mine/bin/thrift? Is that a brew thing? If you try to edit anything in their bin/, they create a copy for you?

wyland commented 6 years ago

Ok to close? Or are there any remaining open questions in this issue?

AndrewSB commented 6 years ago

Yup, thanks @wyland