Comments (16)
mosn.io/pkg/log中也没有依赖consul 这个库啊?用这个库的看了下是dubbogo的间接依赖,只要引用这部分,直接用你项目里需要的版本就可以了吧?我理解应该没有冲突的?
from holmes.
只要你的项目里不依赖 github.com/dubbogo/gost 应该就可以用你需要的版本了吧?
from holmes.
会报这个错,是mod,会报错,不知道找哪个版本,即使我指定自己用的consul 包是1.4.3。另一个consul/[email protected],是mosn.io/pkg/log中的库,在go.sum中能找到 https://github.com/mosn/holmes/blob/master/go.sum#L199
consul_registry.go:7:2: ambiguous import: found package github.com/hashicorp/consul/api in multiple modules:
github.com/hashicorp/consul v1.4.3 (/root/go/pkg/mod/github.com/hashicorp/[email protected]/api)
github.com/hashicorp/consul/api v1.3.0 (/root/go/pkg/mod/github.com/hashicorp/consul/[email protected])
from holmes.
只要你的项目里不依赖 github.com/dubbogo/gost 应该就可以用你需要的版本了吧?
项目里面没有依赖gost,我理解是mosn.io/pkg里面附带的包,有用到gost的包(https://github.com/mosn/holmes/blob/master/go.sum#L85)
consul/api的间接引用sum位置:
https://github.com/mosn/holmes/blob/master/go.sum#L199
from holmes.
log是没有依赖,但是log所在的pkg包中包含了.
这个里面包含了 mosn.io/pkg v0.0.0-20211217101631-d914102d1baf
from holmes.
我的理解是 :
mosn.io/holmes 中用到了 log,其中的log来源是mosn.io/pkg v0.0.0-20211217101631-d914102d1baf。
这个pkg中有其他的包,并没有被holmes所用(holmes只用到了其中的log),比如dubbogo,但是在pkg里面,依然会被加载,从而间接加载进holmes。
所以导致了consul/api的版本冲突。
from holmes.
module mosn.io/test
go 1.14
require (
github.com/hashicorp/consul/api v1.12.0
mosn.io/pkg v1.0.0
)
我自己简单写了一个demo 指定的是更新的版本,因为我只用了pkg/log 并没有用pkg下的dubbo 所以没有报冲突
from holmes.
go.sum里的内容可能有很多,但是并不会影响实际的使用才对
from holmes.
我指定了一下低版本(v1.4.3) 是有问题,我看了下 是因为他这个低版本还没有按照规范接入go.mod导致的
from holmes.
https://github.com/baipangbai/selfmotion
确实1.4.3会有问题,所以建议是升级还是可以把pkg中的相关依赖给去掉呢
from holmes.
在低版本 github.com/hashicorp/consul 是一个库,对应的github.com/hashicorp/consul/api 是包含在里面的
但是 新版本下 github.com/hashicorp/consul/api 是一个独立的版本,所以这里识别上会有冲突
from holmes.
https://github.com/baipangbai/selfmotion
确实1.4.3会有问题,所以建议是升级还是可以把pkg中的相关依赖给去掉呢
pkg里的registry/dubbo是有使用的,不可能去掉
from holmes.
github.com/hashicorp/consul 是一个库,对应的github.com/hashicorp/consul/api 是包含在里面的
但是 新版本下 github.com/hashicorp/consul/api 是一个独立的版本,所以这里识别上会有冲突
明白了,感谢回答~
from holmes.
github.com/hashicorp/consul 是一个库,对应的github.com/hashicorp/consul/api 是包含在里面的
但是 新版本下 github.com/hashicorp/consul/api 是一个独立的版本,所以这里识别上会有冲突明白了,感谢回答~
♥️
我看了下 https://github.com/hashicorp/consul/tree/api/v1.3.0/api 这个库专门为1.3.0 的api加了一个go.mod 但是1.4.3 这个没有。。所以导致这里识别冲突了
from holmes.
如果有底层依赖consul 导致冲突,且底层涉及较多,不方便都升级解决方案~
replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.0 (hashicorp/consul#6019
)
from holmes.
如果有底层依赖consul 导致冲突,且底层涉及较多,不方便都升级解决方案~
replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.0 (hashicorp/consul#6019 )
这里我想了一下,可以考虑把pkg里的部分内容 单独组织一个go.mod 可能可以一定程度避免这种问题,但是不能彻底的解决。
from holmes.
Related Issues (20)
- reporter plugin: upload profile to pyroscope
- DisableMemDump 这个方法是不是笔误了 HOT 1
- log priting is not normal HOT 1
- heap samples are not what I expect HOT 4
- 一点小建议 HOT 2
- report时传递更详细的现场信息 HOT 2
- a code issue in releases HOT 2
- 输出的日志文件结构中的 previous和current代表内存吗? HOT 1
- cpu 突然飙高的一下触发了dump操作,但是dump下来的文件使用 go tool pprof 分析文件,好像什么都分析不出来 HOT 16
- bug: should log the previous data in human readable order
- feature: print the CPU usage during sampling cpu profile HOT 4
- a similar project
- mosn.io/pkg/log 404 Not Found HOT 5
- get CPU core failed HOT 3
- Main binary filename not available. HOT 12
- EnableDump: current cpu percent [1] greater than the CPUMaxPercent[90] HOT 2
- bug: win环境下dump的文本出现乱码 HOT 4
- reporter interface: used filename instead of byte slice HOT 3
- dump文件多余(.)逗号. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holmes.