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

Jens Geyer commented on THRIFT-3472:
------------------------------------

{quote}
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. [...] I don't believe my specific example is the issue; I 
believe the issue is the allowance of un-terminated statements.
{quote}

First, until now we don't even have a reproducible example, let alone a bug. 
Next, semo-colons or commas between struct members or the like are mostly not 
needed at all. The IDL allows them, but in most cases they are simply ignored. 

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

Thanks. Unfortunately I still get the same code generated in both cases using 
your example. What am I doing "wrong"? Could you add the two files that differ 
as attachments?

{quote}
Also, why close the bug before you understand the intent of the bug?
{quote}

I don't want to start a meta discussion about that, but the close reason was 
"not reproducible", which is a fairly correct statement so far. I also wrote 
*Feel free to reopen with a working test case* and I indeed mean it. I hereby 
explicitly invite you to reopen the ticket and providing us with *all* the 
necessary steps to reproduce the problem you observed. There may be bugs or 
problems within Thrift, there's no question about that. Every system of a 
certain complexity has bugs. But to fix them, we need hard, reproducible facts 
- not guesswork.

> 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