You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Arun C Murthy (JIRA)" <ji...@apache.org> on 2010/10/05 02:35:32 UTC

[jira] Created: (AVRO-676) Avro IDL can't process includes from disparate src trees

Avro IDL can't process includes from disparate src trees
--------------------------------------------------------

                 Key: AVRO-676
                 URL: https://issues.apache.org/jira/browse/AVRO-676
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.4.0
            Reporter: Arun C Murthy


AVRO-495 introduced support from includes in IDL. However it turns out that a bug in the implementation, which assumes that the path for the included path is in the same src tree causes it to not support includes from different source trees.

E.g.

src/foo/main/avro/a.genavro
// something here

...

src/foobar/main/avro/b.genavro

protocol foobar {
  import idl "src/foo/main/avro/a.genavro";
  ...
}.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-676) Avro IDL can't process includes from disparate src trees

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-676:
------------------------------

    Attachment: AVRO-676.patch

A relative path works for me when I modify a unit test to use one.  Can you provide a test that fails?

> Avro IDL can't process includes from disparate src trees
> --------------------------------------------------------
>
>                 Key: AVRO-676
>                 URL: https://issues.apache.org/jira/browse/AVRO-676
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.0
>            Reporter: Arun C Murthy
>         Attachments: AVRO-676.patch, AVRO-676.patch
>
>
> AVRO-495 introduced support from includes in IDL. However it turns out that a bug in the implementation, which assumes that the path for the included path is in the same src tree causes it to not support includes from different source trees.
> E.g.
> src/foo/main/avro/a.genavro
> // something here
> ...
> src/foobar/main/avro/b.genavro
> protocol foobar {
>   import idl "src/foo/main/avro/a.genavro";
>   ...
> }.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-676) Avro IDL can't process includes from disparate src trees

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918079#action_12918079 ] 

Doug Cutting commented on AVRO-676:
-----------------------------------

IDL import statements are relative to the IDL file they're in:

http://avro.apache.org/docs/current/idl.html#imports

This is by analogy with CPP:

http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html

So, in your example, I believe you should use something like:

{code}
import idl "../../../foo/main/avro/a.genavro"
{code}

The patch you've provided makes all imports relative to the connected directory of the compiler's JVM, which is not desired.

> Avro IDL can't process includes from disparate src trees
> --------------------------------------------------------
>
>                 Key: AVRO-676
>                 URL: https://issues.apache.org/jira/browse/AVRO-676
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.0
>            Reporter: Arun C Murthy
>         Attachments: AVRO-676.patch
>
>
> AVRO-495 introduced support from includes in IDL. However it turns out that a bug in the implementation, which assumes that the path for the included path is in the same src tree causes it to not support includes from different source trees.
> E.g.
> src/foo/main/avro/a.genavro
> // something here
> ...
> src/foobar/main/avro/b.genavro
> protocol foobar {
>   import idl "src/foo/main/avro/a.genavro";
>   ...
> }.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-676) Avro IDL can't process includes from disparate src trees

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun C Murthy updated AVRO-676:
-------------------------------

    Attachment: AVRO-676.patch

Illustrative patch... seems to work for me. 

> Avro IDL can't process includes from disparate src trees
> --------------------------------------------------------
>
>                 Key: AVRO-676
>                 URL: https://issues.apache.org/jira/browse/AVRO-676
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.0
>            Reporter: Arun C Murthy
>         Attachments: AVRO-676.patch
>
>
> AVRO-495 introduced support from includes in IDL. However it turns out that a bug in the implementation, which assumes that the path for the included path is in the same src tree causes it to not support includes from different source trees.
> E.g.
> src/foo/main/avro/a.genavro
> // something here
> ...
> src/foobar/main/avro/b.genavro
> protocol foobar {
>   import idl "src/foo/main/avro/a.genavro";
>   ...
> }.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-676) Avro IDL can't process includes from disparate src trees

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918099#action_12918099 ] 

Arun C Murthy commented on AVRO-676:
------------------------------------

Thanks for the clarification Doug. 

I get this error with a relative path:

{code}
  import idl "../../../foo/main/avro/a.genavro";
{code}

{noformat}
Embedded error: Error importing ../../../foo/main/avro/a.genavro: java.io.FileNotFoundException: ./../../../foo/main/avro/a.genavro (No such file or directory)
Caused by: org.apache.avro.idl.ParseException: Error importing ../../../foo/main/avro/a.genavro: java.io.FileNotFoundException: ./../../../foo/main/avro/a.genavro (No such file or directory)
	at org.apache.avro.idl.Idl.ImportIdl(Idl.java:320)
	at org.apache.avro.idl.Idl.ProtocolBody(Idl.java:261)
	at org.apache.avro.idl.Idl.ProtocolDeclaration(Idl.java:162)
	at org.apache.avro.idl.Idl.CompilationUnit(Idl.java:49)
	at org.apache.avro.mojo.AvroMojo.execute(AvroMojo.java:153)
{noformat}

I have verified that the relative path is correct... am I missing anything? Help? Thanks.


> Avro IDL can't process includes from disparate src trees
> --------------------------------------------------------
>
>                 Key: AVRO-676
>                 URL: https://issues.apache.org/jira/browse/AVRO-676
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.0
>            Reporter: Arun C Murthy
>         Attachments: AVRO-676.patch
>
>
> AVRO-495 introduced support from includes in IDL. However it turns out that a bug in the implementation, which assumes that the path for the included path is in the same src tree causes it to not support includes from different source trees.
> E.g.
> src/foo/main/avro/a.genavro
> // something here
> ...
> src/foobar/main/avro/b.genavro
> protocol foobar {
>   import idl "src/foo/main/avro/a.genavro";
>   ...
> }.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.