You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/03/03 20:08:04 UTC

[jira] [Commented] (THRIFT-3021) Service remote tool does not import stub package with package prefix

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

ASF GitHub Bot commented on THRIFT-3021:
----------------------------------------

GitHub user yinyin opened a pull request:

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

    THRIFT-3021 - Service remote tool does not import stub package with package prefix

    Detail: https://issues.apache.org/jira/browse/THRIFT-3021
    
    fix by prepending package prefix to generated stub package path if package_prefix option is given.

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

    $ git pull https://github.com/yinyin/thrift service-remote-package-prefix-missing

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

    https://github.com/apache/thrift/pull/385.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 #385
    
----
commit d46c7cd47f95488217012ef1275901e7c15749a4
Author: Yinyin L <yi...@gmail.com>
Date:   2015-03-03T18:24:46Z

    add package prefix to generated import statement in service remote tool
    
    prepend package prefix to generated stub package path if package_prefix option is given.

----


> Service remote tool does not import stub package with package prefix
> --------------------------------------------------------------------
>
>                 Key: THRIFT-3021
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3021
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>    Affects Versions: 0.9.2
>         Environment: Go 1.4.2
>            Reporter: Yinyin L
>            Priority: Minor
>
> When generating code with package_prefix option, the generated service remote tool does not import generated package with given package prefix.
> For example, generate Go code for the following thrift:
> {noformat}
> namespace go testpkgprefix.api.thrift_gen
> service TestPkgPrefix {
> 	string echo(1: required string msg);
> }
> {noformat}
> with command:
> {noformat}
> thrift --gen go:package_prefix=repo.local/user/ -out src/repo.local/user -v idl/testpkgprefix.thrift
> {noformat}
> The resulted Go code will resides in {{src/repo.local/user/testpkgprefix/api/thrift_gen}}.
> But the import statement of service remote tool ( {{src/repo.local/user/testpkgprefix/api/thrift_gen/test_pkg_prefix-remote/test_pkg_prefix-remote.go}} ) will be:
> {noformat}
> import (
> 	... // skip
> 	"testpkgprefix/api/thrift_gen"
> 	... // skip
> {noformat}
> instead of:
> {noformat}
> import (
> 	... // skip
> 	"repo.local/user/testpkgprefix/api/thrift_gen"
> 	... // skip
> {noformat}
> This issue prevents some tool which does full build (build with ./...) from function normally.



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