Skip to content
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

[BUG] compile error with cli #8553

Open
2 of 3 tasks
Hyzhou opened this issue Nov 25, 2024 · 3 comments
Open
2 of 3 tasks

[BUG] compile error with cli #8553

Hyzhou opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Hyzhou
Copy link
Contributor

Hyzhou commented Nov 25, 2024

Search before asking

  • I had searched in the issues and found no similar feature requirement.

DeepFlow Component

CLI
Server

What you expected to happen

  1. CLI Build Error
ubuntu@VM-32-17-ubuntu:~/go/src/github.com/deepflowio/deepflow/cli$ make cli 
go mod tidy && go mod download && go mod vendor
cp -r ../message/* vendor/github.com/deepflowio/deepflow/message/
cp -r ../server/go.* vendor/github.com/deepflowio/deepflow/server/
find vendor -type d -exec chmod +w {} \;
cp vendor/github.com/deepflowio/deepflow/message/metric.proto vendor/github.com/deepflowio/deepflow/server/libs/flow-metrics/pb
cp vendor/github.com/deepflowio/deepflow/message/flow_log.proto vendor/github.com/deepflowio/deepflow/server/libs/datatype/pb
cp vendor/github.com/deepflowio/deepflow/message/stats.proto vendor/github.com/deepflowio/deepflow/server/libs/stats/pb
sed -i '6,10s/^...//' vendor/github.com/deepflowio/deepflow/server/libs/flow-metrics/pb/metric.proto
sed -i '6,10s/^...//' vendor/github.com/deepflowio/deepflow/server/libs/datatype/pb/flow_log.proto
sed -i '6,10s/^...//' vendor/github.com/deepflowio/deepflow/server/libs/stats/pb/stats.proto
cd vendor/github.com/deepflowio/deepflow/message && go generate ./...
cd vendor/github.com/deepflowio/deepflow/server/libs && go generate ./...
ambiguous import: found package github.com/deepflowio/deepflow/server/libs/logger/blocker in multiple modules:
        github.com/deepflowio/deepflow/server (/home/ubuntu/go/src/github.com/deepflowio/deepflow/cli/vendor/github.com/deepflowio/deepflow/server/libs/logger/blocker)
        github.com/deepflowio/deepflow/server/libs/logger/blocker v0.0.0-20240822020041-cdaf0f82ce6f (/home/ubuntu/go/src/github.com/deepflowio/deepflow/cli/vendor/github.com/deepflowio/deepflow/server/libs/logger/blocker)
make: *** [Makefile:28: vendor] Error 1
  1. Server Build Error:
go build -mod vendor -ldflags "-X main.Branch=main -X main.RevCount=11350 -X main.Revision=6759013a6f2953de8b6143f10646d7233c92dae3 -X main.CommitDate=2024-11-25 -X 'main.goVersion=go version go1.23.3 linux/amd64' -X 'main.CompileTime=2024-11-25 20:28:31'" -tags=go_json -o bin/deepflow-server cmd/server/main.go cmd/server/config.go cmd/server/free_os_memory_handler.go
# github.com/bytedance/sonic/loader
vendor/github.com/bytedance/sonic/loader/funcdata.go:37:32: undefined: _func
vendor/github.com/bytedance/sonic/loader/funcdata.go:74:12: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/funcdata.go:77:18: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/funcdata.go:188:28: undefined: compilationUnit
vendor/github.com/bytedance/sonic/loader/stubs.go:27:22: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:29:26: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:34:27: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:36:36: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:46:21: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:50:22: undefined: moduledata
vendor/github.com/bytedance/sonic/loader/stubs.go:50:22: too many errors
# github.com/grafana/pyroscope-go/godeltaprof/internal/pprof
vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go:25:20: undefined: runtime_cyclesPerSecond
vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go:400:8: undefined: runtime_expandFinalInlineFrame
make: *** [Makefile:120: server] Error 1

因为我使用了Go 1.23进行编译,而基础库github.com/bytedance/sonic不支持。
升级基础库之后编译失败,我可以退回更低版本的go进行编译,官方是不是可以评估一下这个库能否支持升级?
go get -u github.com/bytedance/[email protected]

How to reproduce

No response

DeepFlow version

main

DeepFlow agent list

No response

Kubernetes CNI

No response

Operation-System/Kernel version

No response

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Hyzhou Hyzhou added the bug Something isn't working label Nov 25, 2024
lzf575 added a commit that referenced this issue Nov 26, 2024
@lzf575 lzf575 assigned SongZhen0704 and unassigned lzf575 Nov 26, 2024
@lzf575
Copy link
Contributor

lzf575 commented Nov 26, 2024

sonic 已更新

lzf575 added a commit that referenced this issue Nov 26, 2024
@Hyzhou
Copy link
Contributor Author

Hyzhou commented Nov 26, 2024

sonic 已更新

第一个CLI的编译问题,能不能也帮忙看一下。
第二个在高版本1.23 Go环境编译的问题并没有得到解决。

go build -mod vendor -ldflags "-X main.Branch=main -X main.RevCount=11354 -X main.Revision=98d8f792179551657a971c611da3b97d510053bb -X main.CommitDate=2024-11-26 -X 'main.goVersion=go version go1.23.3 linux/amd64' -X 'main.CompileTime=2024-11-26 15:20:14'" -tags=go_json -o bin/deepflow-server cmd/server/main.go cmd/server/config.go cmd/server/free_os_memory_handler.go
# github.com/grafana/pyroscope-go/godeltaprof/internal/pprof
vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go:25:20: undefined: runtime_cyclesPerSecond
vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go:400:8: undefined: runtime_expandFinalInlineFrame

https://github.com/grafana/pyroscope-go 的依赖版本也低了,需要升级才能够支持

lzf575 added a commit that referenced this issue Nov 27, 2024
for compiled under go1.23
lzf575 added a commit that referenced this issue Nov 27, 2024
for compiled under go1.23
@lzf575
Copy link
Contributor

lzf575 commented Nov 27, 2024

  • cli 问题暂时无法解决,cli可以用 go1.21 编译的版本,不影响使用。
  • go 1.23 的编译应该加强了依赖校验 , server 依赖 blocker, cli 依赖server 又间接依赖了blocker, 但blocker 和 server是2个包却是相同路径前缀, 编译时都拷贝到vendor 同一位置,发现 2个包都有指向 一个位置,就报错了。
  • 目前使用 replace 重定向到本地路径编译,也无法解决。

@lzf575 lzf575 assigned ZhengYa-0110 and unassigned SongZhen0704 Jan 3, 2025
@lzf575 lzf575 reopened this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants