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 problem: "metrics/cpu_syscall.go:34:47: invalid operation:" int32 mixed with int64 #22287

Closed
juampe opened this issue Feb 8, 2021 · 1 comment · Fixed by #22262
Closed

Comments

@juampe
Copy link

juampe commented Feb 8, 2021

To summup I tried to buid an arm geth docker container

FROM golang:buster
RUN apt-get update &&  apt-get -y upgrade && apt-get -y install --no-install-recommends bash git build-essential autoconf automake && git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/ethereum/go-ethereum.git /go-ethereum && cd /go-ethereum && make geth

And I got this error

env GO111MODULE=on go run build/ci.go install ./cmd/geth
>>> /usr/local/go/bin/go build -ldflags -X main.gitCommit=e74bd587f730fcdb5a9b625390da8aa85a2cbbc8 -X main.gitDate=20210205 -trimpath -v -o /go-ethereum/build/bin/geth ./cmd/geth
github.com/ethereum/go-ethereum/metrics
# github.com/ethereum/go-ethereum/metrics
metrics/cpu_syscall.go:34:47: invalid operation: (usage.Utime.Sec + usage.Stime.Sec) * 100 + int64(usage.Utime.Usec + usage.Stime.Usec) / 10000 (mismatched types int32 and int64)
util.go:47: exit status 2
exit status 1
make: *** [Makefile:16: geth] Error 1

The code involved
return (usage.Utime.Sec+usage.Stime.Sec)*100 + int64(usage.Utime.Usec+usage.Stime.Usec)/10000 //nolint:unconvert

The code corrected
return int64(usage.Utime.Sec+usage.Stime.Sec)*100 + int64(usage.Utime.Usec+usage.Stime.Usec)/10000 //nolint:unconvert

@MariusVanDerWijden
Copy link
Member

Yep, that's a regression, we already have a fix for it here: #22262

@MariusVanDerWijden MariusVanDerWijden linked a pull request Feb 8, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants