-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consul/api 版本冲突无法使用 #101
Comments
mosn.io/pkg/log中也没有依赖consul 这个库啊?用这个库的看了下是dubbogo的间接依赖,只要引用这部分,直接用你项目里需要的版本就可以了吧?我理解应该没有冲突的? |
只要你的项目里不依赖 github.com/dubbogo/gost 应该就可以用你需要的版本了吧? |
|
项目里面没有依赖gost,我理解是mosn.io/pkg里面附带的包,有用到gost的包(https://github.com/mosn/holmes/blob/master/go.sum#L85) consul/api的间接引用sum位置: |
log是没有依赖,但是log所在的pkg包中包含了. 这个里面包含了 mosn.io/pkg v0.0.0-20211217101631-d914102d1baf |
我的理解是 : mosn.io/holmes 中用到了 log,其中的log来源是mosn.io/pkg v0.0.0-20211217101631-d914102d1baf。 这个pkg中有其他的包,并没有被holmes所用(holmes只用到了其中的log),比如dubbogo,但是在pkg里面,依然会被加载,从而间接加载进holmes。 所以导致了consul/api的版本冲突。 |
我自己简单写了一个demo 指定的是更新的版本,因为我只用了pkg/log 并没有用pkg下的dubbo 所以没有报冲突 |
go.sum里的内容可能有很多,但是并不会影响实际的使用才对 |
我指定了一下低版本(v1.4.3) 是有问题,我看了下 是因为他这个低版本还没有按照规范接入go.mod导致的 |
https://github.com/baipangbai/selfmotion 确实1.4.3会有问题,所以建议是升级还是可以把pkg中的相关依赖给去掉呢 |
在低版本 github.com/hashicorp/consul 是一个库,对应的github.com/hashicorp/consul/api 是包含在里面的 |
pkg里的registry/dubbo是有使用的,不可能去掉 |
明白了,感谢回答~ |
我看了下 https://github.com/hashicorp/consul/tree/api/v1.3.0/api 这个库专门为1.3.0 的api加了一个go.mod 但是1.4.3 这个没有。。所以导致这里识别冲突了 |
如果有底层依赖consul 导致冲突,且底层涉及较多,不方便都升级解决方案~ replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.0 (hashicorp/consul#6019 |
这里我想了一下,可以考虑把pkg里的部分内容 单独组织一个go.mod 可能可以一定程度避免这种问题,但是不能彻底的解决。 |
自己项目中有用到consul版本为v1.4.3,holmes中的consul/api的版本为v1.3.0
去看holmes代码中其实并没用用到consul,去追依赖发现依赖层级如下
本身holmes中并没有任何consul的依赖,即使是使用的日志库holmes.io/pkg/log的功能中,也没有用到consul/api的功能。
不知是否可以把moson.io/pkg/log中有关consul的依赖去除,要不可惜了这么优秀的开源不能使用。
The text was updated successfully, but these errors were encountered: