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

Fedor Korotkiy commented on THRIFT-4685:
----------------------------------------

I think it is necessary to explain original problem with thrift in go 
ecosystem. The issue is related to sem-ver, but it is *not the same* issue.

 

Every go library is uniquely identified by it's import path. You can't link two 
libraries with the same import path, into a single binary. Current go library 
for thrift is located at github.com/apache/thrift/lib/go/thrift.

 

Over the years, many other popular go projects started depending on 
github.com/apache/thrift/lib/go/thrift.

 

For example:

 - github.com/xitongsys/parquet-go currently depends on thrift v0.13.1

 - github.com/jaegertracing/jaeger used thrift 0.9.3 [until 
recently|https://github.com/jaegertracing/jaeger/pull/2311/files]

 - github.com/uber/tchannel-go still uses old version 
https://github.com/uber/tchannel-go/issues/781

When library uses thrift directly, api breakages don't cause any trouble. 
Libraries pin dependency to particular version, and update at their own pace.

 

*The problem* arises in project, that use multiple libraries, that are in turn 
use thrift internally. That is classical diamond dependency problem, I'm sure 
you are all familiar with.

 

Go has a solution for that. Libraries should change import path, when changing 
API in incompatible ways. Multiple thrift versions can co-exist in the same 
binary without problems, provided that their import paths don't collide. Each 
library consumer can gradually update to new version, without coordination with 
others. After last consumer is updated, old library is no longer needed, and is 
removed from build.

 

You may change versioning scheme for the whole project, but that is *not 
required*. In case of thrift, it is better to update go import path manually. 
That is a preferred way, because you don't want to change it every release. You 
should update it, only when incompatible change is made to go api.

 

I hope that clarifies the situation.

> Support the new golang modules (1.11 or later)
> ----------------------------------------------
>
>                 Key: THRIFT-4685
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4685
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Library
>    Affects Versions: 0.12.0
>         Environment: golang 1.11 or later
>            Reporter: James E. King III
>            Assignee: Duru Can Celasun
>            Priority: Minor
>
> Go added new module support in 1.11, see:
> https://github.com/golang/go/wiki/Modules
> We should move towards it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to