Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2835

Add possibility to distribute generators separately from thrift core, and load them dynamically

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0
    • Compiler (General)

    Description

      It is a follow-up for discussion with Facebook's fbthrift https://github.com/facebook/fbthrift/issues/48

      fbthrift adds its own generator that creates C++ classes based on their libraries. I do not know how upstreamable this generator but I think other companies would want to do the same - create their own custom generators.

      Currently there is no way to distribute generators separately from the thrift core. Thus the company have to fork whole project and add their own generator. It is what Facebook did.

      The idea is that thrift should be able to load language generators dynamically. i.e. a company foo creates its own generator and puts it to system /usr/lib/thrift/generators/cpp_foo.so When thrift compiler starts - it checks /usr/lib/thrift/generators/ and uses dlopen() to load the shared libraries. The shared library contains information about the generator (name, options, ...) thus it allows thrift core to use this custom third-party generator.

      This allows companies to create and distribute generator will less pain and no need to fork the project.

      Attachments

        Issue Links

          Activity

            People

              nsuke Nobuaki Sukegawa
              anatolikus Anatol Pomozov
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: