openconfig / gnmi

gRPC Network Management Interface
Apache License 2.0
459 stars 196 forks source link

gnmi client does not build #131

Closed sfuhrm closed 1 year ago

sfuhrm commented 1 year ago
github/gnmi/cli $ go build
go: downloading github.com/protocolbuffers/txtpbfmt v0.0.0-20220608084003-fc78c767cd6a
go: downloading github.com/mitchellh/go-wordwrap v1.0.1
# github.com/protocolbuffers/txtpbfmt/parser
../../../../go/pkg/mod/github.com/protocolbuffers/txtpbfmt@v0.0.0-20220608084003-fc78c767cd6a/parser/parser.go:1345:12: undefined: math.MaxInt
robshakir commented 1 year ago

I wasn't able to reproduce this from the current repo. I'm not quite sure what github/gnmi/cli in your path refers to. But to verify:

[10:13] src/github.com/openconfig                                             ⍉
▶ gh repo clone openconfig/gnmi
Cloning into 'gnmi'...
Enter passphrase for key '/Users/robjs/.ssh/id_rsa': 
remote: Enumerating objects: 1945, done.
remote: Counting objects: 100% (591/591), done.
remote: Compressing objects: 100% (192/192), done.
remote: Total 1945 (delta 415), reused 491 (delta 382), pack-reused 1354
Receiving objects: 100% (1945/1945), 973.63 KiB | 2.18 MiB/s, done.
Resolving deltas: 100% (987/987), done.

[10:14] src/github.com/openconfig                                              
▶ cd gnmi/cmd/gnmi_cli 

[10:14] gnmi/cmd/gnmi_cli   master ✔                                      19d  
▶ go build
go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
go: downloading google.golang.org/grpc v1.40.0
go: downloading golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
go: downloading google.golang.org/genproto v0.0.0-20210811021853-ddbe55d93216

[10:15] gnmi/cmd/gnmi_cli   master ✔                                  19d ◒  
▶ cd ../../cli

[10:15] openconfig/gnmi/cli   master ✔                                  19d ◒  
▶ go build

[10:15] openconfig/gnmi/cli   master ✔                                  19d ◒  
▶ echo $?
0

Could you check how you cloned the repo?

Thanks, r.

hellt commented 1 year ago

@sfuhrm since you seem to be interested in the gNMI CLI, I can suggest having a look at https://gnmic.openconfig.net

sfuhrm commented 1 year ago

My build steps are summarized here explicitly:

tephan@lxka-bkzx3x2:/tmp$ git clone https://github.com/openconfig/gnmi.git && cd gnmi/cli && go build
Klone nach 'gnmi' ...
remote: Enumerating objects: 1945, done.
remote: Counting objects: 100% (591/591), done.
remote: Compressing objects: 100% (192/192), done.
remote: Total 1945 (delta 415), reused 491 (delta 382), pack-reused 1354
Empfange Objekte: 100% (1945/1945), 973.63 KiB | 6.45 MiB/s, fertig.
Löse Unterschiede auf: 100% (987/987), fertig.
# github.com/protocolbuffers/txtpbfmt/parser
/home/stephan/go/pkg/mod/github.com/protocolbuffers/txtpbfmt@v0.0.0-20220608084003-fc78c767cd6a/parser/parser.go:1345:12: undefined: math.MaxInt

The error is in an external repo afaik? I'm not so deep in Go to understand the source of the problem.

hellt commented 1 year ago

@sfuhrm just for the sake of completeness, your error is likely caused by Go version incompatibility. Looks like you have a Go version <= 1.16

sfuhrm commented 1 year ago

@hellt good insight, well-settled Debian 11 go version:

$ go version
go version go1.15.15 linux/amd64

With go 1.19 the build works.

Yes, the link you provided is more what I was searching, thanks! Looks like the problem is not on the side of your repo :-). Thanks for quick help!