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

build fail #388

Closed
Kitebin-h opened this issue Apr 25, 2024 · 3 comments
Closed

build fail #388

Kitebin-h opened this issue Apr 25, 2024 · 3 comments

Comments

@Kitebin-h
Copy link

I clone the repo on my Ubuntu22.04 Server. When I executes "make build", I hit a problem, stdout list below

> make build
make build-binary GO_BUILD_ARGS="-tags netgo,osusergo" GO_LDFLAGS='-extldflags "-static"'
make[1]: Entering directory '/root/visiable_solution/ebpf_exporter'
CGO_LDFLAGS="-l bpf -L/root/visiable_solution/ebpf_exporter/libbpf/dest/usr/lib" CGO_CFLAGS="-I/root/visiable_solution/ebpf_exporter/libbpf/dest/usr/include" go build -tags netgo,osusergo -o ebpf_exporter -v -ldflags="-extldflags "-static" -X github.com/prometheus/common/version.Version=v2.4.1-10-gf99f787 -X github.com/prometheus/common/version.Branch=master -X github.com/prometheus/common/version.Revision=f99f787 -X github.com/prometheus/common/version.BuildUser=root@iZwz93nr54zgf1j7mjvdv7Z -X github.com/prometheus/common/version.BuildDate=2024-04-26T04:41:46+08:00" ./cmd/ebpf_exporter
go: github.com/aquasecurity/[email protected]: Get "https://proxy.golang.org/github.com/aquasecurity/libbpfgo/@v/v0.6.0-libbpf-1.3.mod": dial tcp 142.251.42.241:443: i/o timeout
make[1]: *** [Makefile:81: build-binary] Error 1
make[1]: Leaving directory '/root/visiable_solution/ebpf_exporter'
make: *** [Makefile:73: build-static] Error 2

my go env is go version go1.14.2 linux/amd64.

how can I sovle this problem to build the binary file, hope to a solution answer !!!

@bobrik
Copy link
Contributor

bobrik commented Apr 25, 2024

It looks like your internet connection is to blame here:

go: github.com/aquasecurity/[email protected]: Get "https://proxy.golang.org/github.com/aquasecurity/libbpfgo/@v/v0.6.0-libbpf-1.3.mod": dial tcp 142.251.42.241:443: i/o timeout

You can try with GOPROXY=off.

@Kitebin-h
Copy link
Author

All right. I retry to set go proxy and execute "make build", I hit a another error below:

/root/go/pkg/mod/google.golang.org/[email protected]/internal/editiondefaults/defaults.go:9:8: package embed is not in GOROOT (/usr/local/go/src/embed)
/root/go/pkg/mod/golang.org/x/[email protected]/http2/frame.go:18:2: found packages hpack (encode.go) and main (gen.go) in /root/go/pkg/mod/golang.org/x/[email protected]/http2/hpack
cgroup/fanotify.go:16:2: found packages unix (affinity_linux.go) and main (mkasm.go) in /root/go/pkg/mod/golang.org/x/[email protected]/unix
/root/go/pkg/mod/golang.org/x/[email protected]/secure/bidirule/bidirule.go:16:2: found packages bidi (bidi.go) and main (gen.go) in /root/go/pkg/mod/golang.org/x/[email protected]/unicode/bidi
/root/go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:27:2: found packages norm (composition.go) and main (maketables.go) in /root/go/pkg/mod/golang.org/x/[email protected]/unicode/norm
cgroup/walker.go:4:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)
/root/go/pkg/mod/github.com/prometheus/[email protected]/model/labelset.go:20:2: package slices is not in GOROOT (/usr/local/go/src/slices)
make[1]: *** [Makefile:81: build-binary] Error 1
make[1]: Leaving directory '/root/visiable_solution/ebpf_exporter'
make: *** [Makefile:73: build-static] Error 2

@Kitebin-h
Copy link
Author

I retry update my go version to go1.12.4, and rebuild the binary file from repo. Finally, I successfully get the binary file "ebpf_exporter". The problem is solved.

@bobrik bobrik closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants