[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2017-12-02 Thread Jens Geyer (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16275552#comment-16275552
 ] 

Jens Geyer commented on THRIFT-2835:


Hi [~nsuke], 
Hi [~dtmuller],

I just ran into some questions: 

 * Is the feature supported with the Windows compiler EXE or not? 
 * If yes, shpould it be available only with mingw cross builds or in all cases 
(i.e. MSVC)?
 * And what do I have to do to enable it?



> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>Assignee: Aki Sukegawa
>  Labels: fbthrift
> Fix For: 0.10.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15522166#comment-15522166
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@nsuke Thanks a lot for your effort - I really enjoyed working with you.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>Assignee: Aki Sukegawa
>  Labels: fbthrift
> Fix For: 0.10.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15521150#comment-15521150
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@dtmuller just committed, thanks for all the help and improvements !
It might have not happened at all if you didn't pick it up and revive it ...


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15521091#comment-15521091
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user asfgit closed the pull request at:

https://github.com/apache/thrift/pull/368


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15486441#comment-15486441
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller closed the pull request at:

https://github.com/apache/thrift/pull/1039


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15486442#comment-15486442
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@nsuke That's great, thanks. I see, the two PRs are in sync, so I will 
close this one...


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15484545#comment-15484545
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@dtmuller as you may have noticed I've squashed commits for merging in #368.
If there's no concern I'll push them within a week or so.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15483510#comment-15483510
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@nsuke Do you have a rough idea when this PR can be merged? If there is 
more work to do I can assist, please let me know...


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-08-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15418533#comment-15418533
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on the issue:

https://github.com/apache/thrift/pull/1039
  
So, it looks like this could make it into the master soon - once CI is 
green. :smiley: 
Unfortunately I'm afraid that I can't help with the windows fix.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15391037#comment-15391037
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the issue:

https://github.com/apache/thrift/pull/368
  
TODO:
* Remove `sleep 0.2` in cpp_plugin_test.sh without breaking it
* Build with static boost unittest (need to do the same as some tests in 
lib/cpp/test)


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15384058#comment-15384058
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on the issue:

https://github.com/apache/thrift/pull/1039
  
I fixed a few of your findings. On the remaining two issues concerning 
`t_audit/t_logging` and the shared boost test support I'm not sure what to do...


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15384039#comment-15384039
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71325852
  
--- Diff: compiler/cpp/test/CMakeLists.txt ---
@@ -18,15 +18,15 @@
 #
 
 
-# Find required packages
-set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test 
framework
-find_package(Boost 1.53.0 REQUIRED COMPONENTS unit_test_framework)
-include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+if(${WITH_PLUGIN})
+# Find required packages
+set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test 
framework
+find_package(Boost 1.53.0 REQUIRED COMPONENTS unit_test_framework)
+include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
 
-#Make sure gen-cpp files can be included
-include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+#Make sure gen-cpp files can be included
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
 
-if(${WITH_PLUGIN})
--- End diff --

I'm not sure what you mean by that?!


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15383837#comment-15383837
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71299569
  
--- Diff: compiler/cpp/src/plugin/plugin.cc ---
@@ -402,6 +402,13 @@ THRIFT_CONVERSION(t_program, from.path, from.name) {
   boost::for_each(from.services | 
boost::adaptors::transformed(_service),
   boost::bind(&::t_program::add_service, to, _1));
 
+  for (std::vector::const_iterator it = from.includes.begin();
+   it != from.includes.end();
+   it++) {
+::t_program* tmp = new ::t_program((*it).path, (*it).name);
+convert((*it), tmp);
+to->add_include(tmp);
+  }
--- End diff --

Just stumbled over another thing: the `t_program::includes_` were empty on 
the plugin side...


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-18 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15382104#comment-15382104
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71131975
  
--- Diff: compiler/cpp/src/plugin/plugin.thrift ---
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace as3 org.apache.thrift.plugin
+namespace cpp apache.thrift.plugin
+namespace csharp Thrift.Plugin
+namespace d thrift.plugin
+namespace delphi Thrift.Plugin
+namespace go thrift
+namespace haxe org.apache.thrift.plugin
+namespace hs Thrift.Plugin
+namespace java org.apache.thrift.plugin
+namespace ocaml Thrift
+namespace perl Thrift.Plugin
+namespace php thrift.plugin
+namespace py thrift.plugin
+namespace rb Thrift
--- End diff --

Added plugin namespace for erlang.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-18 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15382100#comment-15382100
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user dtmuller commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71131802
  
--- Diff: compiler/cpp/test/plugin/conversion_test.cc ---
@@ -269,6 +268,8 @@ void test_const_value(t_const_value* sut) {
 #undef T_CONST_VALUE_CASE
   case t_const_value::CV_MAP:
 BOOST_CHECK_EQUAL(sut->get_map().size(), sut2->get_map().size());
+// NOTE This test only works with map with a single entry because we 
can't
+// rely on map ordering with pointers as key.
 BOOST_CHECK_EQUAL(sut->get_map().begin()->first->get_type(),
   sut2->get_map().begin()->first->get_type());
 BOOST_CHECK_EQUAL(sut->get_map().begin()->second->get_type(),
--- End diff --

Fixed this by extracting to a map of dereferenced types for comparison.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15381216#comment-15381216
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the issue:

https://github.com/apache/thrift/pull/1039
  
This looks mostly good except for a few issues I commented.
The t_audit part seems to be the biggest challenge.
Not sure you're going to work through them, as some of them are from 
original code and others' newer patches.
Let me know if you have any plan on it.



> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15381212#comment-15381212
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71078569
  
--- Diff: compiler/cpp/src/plugin/plugin.thrift ---
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace as3 org.apache.thrift.plugin
+namespace cpp apache.thrift.plugin
+namespace csharp Thrift.Plugin
+namespace d thrift.plugin
+namespace delphi Thrift.Plugin
+namespace go thrift
+namespace haxe org.apache.thrift.plugin
+namespace hs Thrift.Plugin
+namespace java org.apache.thrift.plugin
+namespace ocaml Thrift
+namespace perl Thrift.Plugin
+namespace php thrift.plugin
+namespace py thrift.plugin
+namespace rb Thrift
--- End diff --

`namespace erl` is added after this patch. Would be nice to have it from 
the day 1 of this feature.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15381211#comment-15381211
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71078548
  
--- Diff: compiler/cpp/src/audit/t_audit.cpp ---
@@ -41,12 +41,12 @@ void thrift_audit_warning(int level, const char* fmt, 
...) {
 
 void thrift_audit_failure(const char* fmt, ...) {
   va_list args;
-  fprintf(stderr, "[Thrift Audit Failure:%s] ", g_curpath.c_str());
+  //fprintf(stderr, "[Thrift Audit Failure:%s] ", g_curpath.c_str());
   va_start(args, fmt);
   vfprintf(stderr, fmt, args);
   va_end(args);
   fprintf(stderr, "\n");
-  g_return_failure = true;
+  //g_return_failure = true;
 }
 
--- End diff --

We cannot just undo others' warnings and exit value manipulation...
I imagine there are some difficulties to keep these ?


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15381208#comment-15381208
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71078490
  
--- Diff: compiler/cpp/test/CMakeLists.txt ---
@@ -18,15 +18,15 @@
 #
 
 
-# Find required packages
-set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test 
framework
-find_package(Boost 1.53.0 REQUIRED COMPONENTS unit_test_framework)
-include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+if(${WITH_PLUGIN})
+# Find required packages
+set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test 
framework
+find_package(Boost 1.53.0 REQUIRED COMPONENTS unit_test_framework)
+include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
 
-#Make sure gen-cpp files can be included
-include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+#Make sure gen-cpp files can be included
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
 
-if(${WITH_PLUGIN})
--- End diff --

Shared boost test support is added after this patch.
So we now need to fix the test.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15381181#comment-15381181
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1039#discussion_r71078267
  
--- Diff: lib/c_glib/test/CMakeLists.txt ---
@@ -18,12 +18,15 @@
 #
 
 
-#Make sure gen-cpp and gen-c_glib files can be included
-include_directories("${CMAKE_CURRENT_BINARY_DIR}")
-
 set(TEST_PREFIX "c_glib")
 
-include_directories(${Boost_INCLUDE_DIRS})
+# Find required packages
+set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test 
framework
+find_package(Boost 1.53.0 REQUIRED COMPONENTS unit_test_framework)
+include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
+
+#Make sure gen-cpp and gen-c_glib files can be included
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
--- End diff --

I couldn't find any boost test inside lib/c_glib. Is this needed ?


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15364596#comment-15364596
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the issue:

https://github.com/apache/thrift/pull/1039
  
@dtmuller thanks ! I'll look into the weekend after next.


> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15364465#comment-15364465
 ] 

ASF GitHub Bot commented on THRIFT-2835:


GitHub user dtmuller opened a pull request:

https://github.com/apache/thrift/pull/1039

THRIFT-2835 Add possibility to distribute generators separately

I rebased the original pull request #368 from @nsuke and added a few fixes 
on top of that.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dtmuller/thrift THRIFT-2835

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/1039.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1039


commit 8642a320ce71fd50495582041be898f2e149e743
Author: dtmuller 
Date:   2015-05-08T15:46:03Z

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

commit 333278a51aa42eca6adbc703a30ce1c15c9bee36
Author: dtmuller 
Date:   2016-07-06T15:12:23Z

Fix constness

commit 64bbcd6d97d4dc1cc5e36787497190785d827f00
Author: dtmuller 
Date:   2016-07-06T15:13:41Z

Fix build files

commit 65943df4190edf5e60338d5c2630cf2664b05601
Author: dtmuller 
Date:   2016-07-06T15:15:39Z

Type "wb" may not be supported by popen on non-Windows platforms

commit 73e5d8dafbdb8a7d4ce421a4009113296d54220f
Author: dtmuller 
Date:   2016-07-06T15:16:15Z

Don't clear type cache with every t_program conversion

Doing so breaks cache for recursive runs due to thrift includes.

commit e22790e0f0f0fd6c00161171fbb7508ede942beb
Author: dtmuller 
Date:   2016-07-06T15:16:59Z

Fix unit test test_const_value

If t_const_value is map type we cannot rely on the map ordering as the map
key is of pointer type.




> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-07-01 Thread Aki Sukegawa (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1535#comment-1535
 ] 

Aki Sukegawa commented on THRIFT-2835:
--

[~dtmuller] thanks, rebacing would be helpful, feel free to (re-)submit rebased 
code as a pullrequest to apache master, preferably with your fixes on top it 
too.
To be clear, it's not mandatory to wait for the release.

> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-06-27 Thread Daniel Mueller (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15351070#comment-15351070
 ] 

Daniel Mueller commented on THRIFT-2835:


Is this patch still on the list to make it mainline after the next release - 
and how imminent is the next release?

We're using this patch already in production code and added a few small fixes 
to it (see https://github.com/dtmuller/thrift/tree/plugin-0.9.3). So I would 
really like to see this mainline someday.

@nsuke If you don't mind I could also give it a try myself rebasing it?

> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-02-29 Thread Aki Sukegawa (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15172058#comment-15172058
 ] 

Aki Sukegawa commented on THRIFT-2835:
--

I've devised a quick overview of what the patch is doing.
If there's no concern, I'll do the rebase and merge.
Any input is appreciated.
(As the next release is imminent, it may be good idea to wait a bit and do it 
right after the release ?)

h3. How it works

When \-gen  is passed as a compiler command argument, the compiler 
invokes thrift-gen- process in the PATH.
It's similar to git commands or protobuf extensions.
It serializes the AST using Thrift binary protocol and passes it to the plugin 
process through stdin.
The plugin executable is responsible for deserializing the Thrift struct then 
generating code.

So basically, the patch is only doing conversion between AST and Thrift struct.
Thrift struct definition can be found 
[here|https://github.com/apache/thrift/pull/368/files#diff-27feb1bc4c6ea2be5d81e9007aeaa229R19].

Slightly off topic, as I see it today, naming styles can be improved.
For example, "t_program" -> "TProgram" or even "Program" since we're in a 
namespace etc.

h3. Future work

The communication between plugin and compiler can be made bi-directional so 
that it can be used to extend existing generators.
I.e., we can selectively replace or insert certain part of code generation.
The current patch is not doing bi-directional because existing generators use 
stdout directly and I wanted plugin implementation to be exactly identical to 
them.
Introducing simple logger interface to existing generators would solve this 
problem.

Another possibility is to use the Thrift IDL as a safety layer for migrating 
core lex/yacc part.
As long as the same Thrift message is constructed, every existing generator 
works out of the box.
To be clear, I'm not advocating such a migration, but just in case.

> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2016-02-29 Thread Daniel Mueller (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15171600#comment-15171600
 ] 

Daniel Mueller commented on THRIFT-2835:


Adding plugin support to thrift code generation would be a really cool feature. 
We'll be using thrift in an application requiring a highly specific interface, 
so our code generator for it probably won't ever make it upstream. I think this 
is quite a common use case which could be useful to many others as well.

I tested nsukes pull request 
(https://github.com/apache/thrift/pull/368#issuecomment-102608115) - it solves 
my use case perfectly. So I would really like to see this making it into one of 
the next releases (y).

> Add possibility to distribute generators separately from thrift core, and 
> load them dynamically
> ---
>
> Key: THRIFT-2835
> URL: https://issues.apache.org/jira/browse/THRIFT-2835
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Anatol Pomozov
>  Labels: fbthrift
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-05-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14546688#comment-14546688
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the pull request:

https://github.com/apache/thrift/pull/368#issuecomment-102608115
  
I rebased it to the current master.
The original first commit is extracted as THRIFT-3138 
(ef0a8fa62a8a86b23999f9a9ad31478852474854) because it was an unrelated issue.
The other commit remains strictly unchanged except that I had to resolve 
several trivial conflicts in build scripts.



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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14534837#comment-14534837
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user jeking3 commented on the pull request:

https://github.com/apache/thrift/pull/368#issuecomment-100288092
  
The pull request list would be a lot easier to manage if it was always 
clean/empty, so I want to work towards that.


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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14534822#comment-14534822
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user nsuke commented on the pull request:

https://github.com/apache/thrift/pull/368#issuecomment-100286364
  
Hi, you're so diligent :)
It's quite old so I'll rather rebase it.


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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14531817#comment-14531817
 ] 

ASF GitHub Bot commented on THRIFT-2835:


Github user jeking3 commented on the pull request:

https://github.com/apache/thrift/pull/368#issuecomment-99664082
  
Lots of work in here!  You might want to close and re-open this pull 
request to kick a new build.  It needs to pass CI before anyone can merge it.


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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-02-15 Thread Roger Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14322170#comment-14322170
 ] 

Roger Meier commented on THRIFT-2835:
-

Thanks [~nsuke] looks good and ready to commit!
all, are there any concerns about this?

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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-02-04 Thread Roger Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305853#comment-14305853
 ] 

Roger Meier commented on THRIFT-2835:
-

[~nsuke] this is great stuff! 
Define Thrift with Thrift, I really like it!
Thats probably the way we can go to define ENUM's for PROTOCOL types, etc.

currently I have these issues with *make check*, but did not had a closer look:
{noformat}
Makefile:1048: gen-cpp/.deps/ChildService.Plo: No such file or directory
Makefile:1049: gen-cpp/.deps/DebugProtoTest_types.Plo: No such file or directory
Makefile:1050: gen-cpp/.deps/EnumTest_types.Plo: No such file or directory
Makefile:1051: gen-cpp/.deps/OptionalRequiredTest_types.Plo: No such file or 
directory
Makefile:1052: gen-cpp/.deps/ParentService.Plo: No such file or directory
Makefile:1053: gen-cpp/.deps/Recursive_types.Plo: No such file or directory
Makefile:1054: gen-cpp/.deps/ThriftTest_constants.Plo: No such file or directory
Makefile:1055: gen-cpp/.deps/ThriftTest_types.Plo: No such file or directory
Makefile:1056: gen-cpp/.deps/TypedefTest_types.Plo: No such file or directory
Makefile:1057: gen-cpp/.deps/proc_types.Plo: No such file or directory
make[1]: *** No rule to make target 'gen-cpp/.deps/proc_types.Plo'.  Stop.
make: *** [check-recursive] Error 1
{noformat}

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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2015-01-31 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14299892#comment-14299892
 ] 

ASF GitHub Bot commented on THRIFT-2835:


GitHub user nsuke opened a pull request:

https://github.com/apache/thrift/pull/368

THRIFT-2835 Add possibility to distribute generators separately from thr...

...ift core, and load them dynamically

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/nsuke/thrift THRIFT-2835

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/368.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #368


commit 89d1f8942ebcf2e228f71dbe4f114695891852d6
Author: Nobuaki Sukegawa nsu...@gmail.com
Date:   2015-01-27T18:29:23Z

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




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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2014-11-30 Thread Jens Geyer (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229070#comment-14229070
 ] 

Jens Geyer commented on THRIFT-2835:


In general, I like the idea. I would like it even more if the whole thing could 
be more accessible to generator developers. Although it is doable to add 
another generator, it is not really a clearly structured, well-described 
process. This is ok as long as the generators are all internally, but if the 
intention (which I like) is to make it more open for independent developers, we 
need more structure, maybe kind of a generic generator framework or sort of 
somehow customizable generators and more documentation for this particular 
stuff. I know that's is slightly outside of the scope here, but these are the 
things that I absolutely would put on our agenda if we decide to go that way. 
Again, I like the idea and I see a lot of actual use cases that could be 
handled much better that way, e.g. ths stuff that is typically handled via 
annotations today. There are some other generators out there generating 
different things based on Thrift IDL as input, and there as a reason for it.

@[~hcorg], AFAIK there is already some kind of an [Setup for 
Windows|https://builds.apache.org/view/All/job/Thrift-Compiler-Windows/lastSuccessfulBuild/artifact/build_mingw32/Apache%20Thrift-1.0.0-win32.exe]
 platforms. Maybe that could be a starting point?


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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2014-11-30 Thread Konrad Grochowski (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229090#comment-14229090
 ] 

Konrad Grochowski commented on THRIFT-2835:
---

CPack installer is a good start.

Anyone tried dynamic linking mingw exe (what thrift generates) with MSVC dll 
(what users may want to create)? Iface has to be pure {{extern C}} (no 
classes etc), yet I've never tried this and I'm just wandering what happens 
with std lib symbols from both exe and dll...

Nevertheless idea is very appealing, especially if we hide all exe+dll stuff 
inside some framework (module wrapping {{extern C}} calls, so generator 
writers will not have to know about DllHell issues)

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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2014-11-24 Thread Konrad Grochowski (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14222821#comment-14222821
 ] 

Konrad Grochowski commented on THRIFT-2835:
---

yep, if we switch to windows releases based on MSVC builds with dynamic 
linking. which requires msvc redistributable etc so we would probably need to 
create some installer - which would be a good idea, but requires some work.

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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2014-11-23 Thread Roger Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14222742#comment-14222742
 ] 

Roger Meier commented on THRIFT-2835:
-

CMake (THRIFT-2850) can help us to simplify the handling of this.

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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
  Components: Compiler (General)
Reporter: Anatol Pomozov
  Labels: fbthrift

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

2014-11-17 Thread Konrad Grochowski (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14215043#comment-14215043
 ] 

Konrad Grochowski commented on THRIFT-2835:
---

sound interesting, yet we have to remember about all problems introduced by 
dynamic libraries:
 * not only {{.so}} but {{.dll}} has to be supported
 * to allow different compilers to be used iface exe/dll has to be {{extern 
C}} pure C functions and structs (no std::string for passing arguments...)
 * on Windows thrift.exe is statically linked, using dll will introduce 
'duplicated symbols' problem (both exe and dll will contain for example 
{{std::string}} definition) and may force us to move from mingw distribution to 
dynamically linked MSVC builds and towards DllHell (also - static symbols in 
exe may force users to use exact same mingw version for generating dll but it 
would be nice to allow MSVC dlls - if we're talking about full flexibility)
 * dll/so - exe iface has to be versioned and incompatibilities has to be 
detected at load time - just a reminder :)

I'm not saying I'm against it, just pointing out all things we'll have to 
remember about :)


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

 Key: THRIFT-2835
 URL: https://issues.apache.org/jira/browse/THRIFT-2835
 Project: Thrift
  Issue Type: New Feature
Reporter: Anatol Pomozov
  Labels: fbthrift,

 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)