You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2026/10/11 10:44:00 UTC
[jira] [Comment Edited] (THRIFT-6387) Compiler: option to prepend a license header to every generated file
[ https://issues.apache.org/jira/browse/THRIFT-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126024#comment-18126024 ]
Jens Geyer edited comment on THRIFT-6387 at 10/11/26 10:43 AM:
---------------------------------------------------------------
I have mixed feelings about this.
First and foremost, it is not Apache Thrift's problem (nor the problem of any other code-generationg tool) when people come up with that sort of requirements regarding +their+ own repos like this. We already have that "generated" header that plainly states about the nature and origin of the file. If you need a license header, add it to the source IDL file, that's where it belongs. If they want to convince every tool on earth that generates code to add a license header option - sure, try it, and good luck with that.
Another thing that comes to mind is the risk of code injection - will Thrift be held liable to sanitize the extra input properly for 20+ languages or what is the exact plan/expectation here?
{*}TL;DR{*}: I will not stand in the way if someone decides that we absolutely need that option, but I am not a fan of it either. IMHO we should not do this.
was (Author: jensg):
I have mixed feelings about this.
First and foremost, it is not Apache Thrift's problem (nor the problem of any other code-generationg tool) when people come up with that sort of requirements regarding +their+ own repos like this. If they want to convince every tool on earth that generates code to add a license header option - sure, try it, and good luck with that.
Another thing that comes to mind is the risk of code injection - will Thrift be held liable to sanitize the extra input properly for 20+ languages or what is the exact plan/expectation here?
{*}TL;DR{*}: I will not stand in the way if someone decides that we absolutely need that option, but I am not a fan of it either. IMHO we should not do this.
> Compiler: option to prepend a license header to every generated file
> --------------------------------------------------------------------
>
> Key: THRIFT-6387
> URL: https://issues.apache.org/jira/browse/THRIFT-6387
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (General)
> Reporter: Sylwester Lachiewicz
> Priority: Minor
>
> Projects that check generated code into their repositories must either add a license header to each generated file or exclude the files from license checks:
> * Apache Accumulo post-processes every generated Java, C++, Python and Ruby file in [core/src/main/scripts/generate-thrift.sh|https://github.com/apache/accumulo/blob/main/core/src/main/scripts/generate-thrift.sh] to prepend the Apache license header in each language's comment syntax.
> * Apache HBase excludes {{**/generated/**}} from RAT in its root pom.xml; hbase-thrift checks in 41 generated thrift2 classes.
> * Apache Hive checks in 368 generated metastore classes under {{standalone-metastore/metastore-common/src/gen/thrift}}.
> A compiler option, for example {{--header <file>}}, that writes the given text as a comment at the top of every generated file, before the "Autogenerated by Thrift Compiler" banner, would remove the post-processing step and the exclusions. Each generator already writes that banner in its own comment syntax, which is where such a header would go.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)