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

Jason Heimann commented on THRIFT-3472:
---------------------------------------

Let's take a step back from this specific example.  Why is it that thrift 
allows an un-terminated statement at the end of a struct?  If thrift did not, 
this bug would not exist.

To answer your question, the missing semicolon, which is later replaced, is at 
the end of the line "2: required Common.VersionId sequenceNumber"

I'll attach the include file, though I don't believe my specific example is the 
issue; I believe the issue is the allowance of un-terminated statements.



> Missing semi-colon in IDL leads to non-deterministic builds
> -----------------------------------------------------------
>
>                 Key: THRIFT-3472
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3472
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.9.2
>         Environment: Ubuntu 14.04.3 LTS x86_64
>            Reporter: Jason Heimann
>
> The following erroneous IDL was fed into thrift, from which we generated 
> python (new_style), java (private-members), node.js and C++ output:
> {code}
> namespace java com.acme.model.sequencenumber
> namespace py acme_thrift.model.sequencenumber
> namespace cpp acme.model.sequencenumber
> include "Common.thrift"
> struct SequenceNumberResponse
> {
>     1: required Common.ResponseContext context;
>     2: required Common.VersionId sequenceNumber
> }
> {code}
> Each of these generated languages are compiled (as applicable) and packaged 
> after generation.  This is all to say, several revisions of our thrift IDL 
> successfully generated, compiled, packaged and deployed with this error.
> ...until it didn't.  An IDL revision in a completely unrelated namespace 
> triggered the following compilation error in the C++ output:
> {code}
> In file included from 
> /build_tmp/thrift-api-cmake/generated-sources/gen-cpp/SequenceNumber.cpp:7:0:
>  
> /build_tmp/thrift-api-cmake/generated-sources/gen-cpp/SequenceNumber.h:18:57: 
> error: 'acme::model::sequencenumber' has not been declared
>  
> /build_tmp/thrift-api-cmake/generated-sources/gen-cpp/SequenceNumber.h:18:95: 
> error: expected ',' or '...' before '&' token
> {code}
> Of course, adding the missing semicolon fixed this issue.  This being said, 
> I'd expect something in the thrift compiler to complain about such faulty IDL



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

Reply via email to