I am testing out how simple Apache Thrift is to learn and it looks promising. One major problem: the first tutorial doesn't work..
Active4 years ago
![]()
Incubator Releases¶. Releases from the incubator ( less than 0.6.0 ) are available at the Thrift Incubator Archive. Releases from 0.6.0 up to the current release are available at the Apache Thrift Archive. Thrift.apache.org Thrift is an interface definition language and binary communication protocol 1 used for defining and creating services for numerous languages. 2 It forms a remote procedure call (RPC) framework and was developed at Facebook for 'scalable cross-language services development'.
I have Windows 7, Python 2.7, and got the Thrift .exe for Windows v.0.9.1. I'd rather not compile from source as I don't use Cygwin etc. The exe gave the problems described below. So I moved on and tried using Chocolatey to install Thrift using cinst Thriftwhich worked fine and gave me Thrift v0.9.0. But this version results in the same behavior as the exe, described below.
Installing Apache Thrift on Windows. Although primarily designed for Unix-compatible systems, Apache Thrift can also be used in the Windows environment. Today we are going to see how to build Apache Thrift for C on Visual Studio 2015. Then for demonstration, we’ll also build and run the C tutorial. Disclaimer: this tutorial builds hugely on the one given by Adil Bukhari Configuring Apache Thrift for Visual Studio 2012.The reason I create a new one is that I followed his steps but stumbled upon a few problems preventing me from. Alternatively, the Thrift compiler can also be built via Cygwin or MinGW build environments, however this method is not only less comfortable, but more time-consuming and requires much more manual effort. Prebuilt Thrift compiler¶ The windows Thrift compiler is available as a prebuilt exe available here.
When I run the tutorial found at http://thrift.apache.org/tutorial/py I get the following: Hcs highway capacity software.
Hopefully the exe works for someone because I'd love to avoid this requiring a build from source.
JensG
10.3k33 gold badges3131 silver badges4444 bronze badges
Apache Thrift Tutorial
afeltafelt
2 Answers
The answer is that the tutorial assumes you have a /tutorial folder with two .thrift files included in it. If you go the Windows EXE route and then build your tutorial.thrift file, you will also need to add shared.thrift which can be found in Git at https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob_plain;f=tutorial/shared.thrift
Save this file next to your tutorial.thrift file and you can proceed with the tutorial.
afeltafelt
Thrift Apache Org
The command
Apache Thrift Windows 7
uses the
-r[recurse] switch to automatically build a second, included IDL file shared.thrift . This shared.thrift file is located in the same folder as tutorial.thrift is. Because Thrift looks for included files based on the current folder, you have to explicitly call the Thrift compiler from that folder.
Apache Thrift Wiki
Assumed, your Thrift working copy is under C:Thrift and the
thrift.exe is reachable via search path, open a command prompt, navigate to that folder and enter the command again:
PS: The 0.9.0 is slightly outdated. The 0.9.1 is fine, the forthcoming release 0.9.2 will have even more improvements.
JensGJensG
10.3k33 gold badges3131 silver badges4444 bronze badges
Apache Thrift PythonNot the answer you're looking for? Browse other questions tagged pythonwindowsthrift or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |