Hi all,

  We (ie. @ work ) are in the process of migrating from thrift 0.6.1 to
thrift 0.9.1 and i'm having some issues with some files that used to
compile under the older version but don't seem to compile with the new
updated version.

As far as I can tell the errors seem to related to how thrift treats
typedefs.

Usually we define each struct/enum/exception in its own .thrift file and
include it wherever it's being used.

If multiple files have the typedef it seems to break, but if I use the FQN
(fully qualified name) of the struct then I have no problems with it.

Before I was able to fix it, I also saw errors such as:

"Type "User" is already defined."

A clear case of the behavior with be something like

user.thrift  ##  defines struct User
twitter_user.thrift  ## (or whatever specialized user you want) typedefs
the struct from user.thrift and includes user.thrift

user_service.thrift  ## includes user.thrift and twitter_user.thrift and
typedefs struct from both thrift files.

Basically since the file is typedef in twitter_user.thrift it errors out
when its typdef again in user_service.thrift.

I was wondering if something like C's #ifndef / #endif construct existed.

Or if anyone had any suggestions on how to handle such use cases.

Right now the only solution that comes to mind is limiting typdef use to
services.thrift files only.
(Or the highest level tier which can get get a bit difficult to determine
if you use service based inheritance)


Oh also.. to complicate things that much more.  We're currently generating
artifacts for both thrift 0.6.1 and thrift 0.9.1 (or trying to) so the
thrfit IDL
needs to compile with both versions.


Any suggestions/ guidance would be appreciated.

Reply via email to