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

infra: make generate is broken on ubuntu18 #339

Closed
zirain opened this issue Sep 2, 2022 · 6 comments · Fixed by #354
Closed

infra: make generate is broken on ubuntu18 #339

zirain opened this issue Sep 2, 2022 · 6 comments · Fixed by #354
Labels
kind/bug Something isn't working

Comments

@zirain
Copy link
Contributor

zirain commented Sep 2, 2022

make generate is broken since #193

cc @danehans

git checkout f7572928d42f8838c68c5133ab6252d01a93dfb8
make generate
tools/bin/controller-gen object paths="./..."
panic: interface conversion: ast.Expr is *ast.CompositeLit, not *ast.Ident

goroutine 1403 [running]:
sigs.k8s.io/controller-tools/pkg/loader.(*referenceCollector).Visit(0xc003c83550, {0xd5b798?, 0xc00b8b5a70})
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:136 +0xff
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b798?, 0xc00b8b5a70?})
        /usr/local/go/src/go/ast/walk.go:52 +0x62
go/ast.walkExprList({0xd591a0, 0xc003c83550}, {0xc00b8c6610?, 0x1, 0xd5b838?})
        /usr/local/go/src/go/ast/walk.go:26 +0x91
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b1f8?, 0xc00b8cc980?})
        /usr/local/go/src/go/ast/walk.go:145 +0xa8b
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b180?, 0xc00b8c5710?})
        /usr/local/go/src/go/ast/walk.go:154 +0xfc5
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b090?, 0xc00b8c5740?})
        /usr/local/go/src/go/ast/walk.go:164 +0x1e49
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b3d8?, 0xc00b8cc9c0?})
        /usr/local/go/src/go/ast/walk.go:75 +0x37c
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b400?, 0xc00b8c5770?})
        /usr/local/go/src/go/ast/walk.go:86 +0x227a
go/ast.Walk({0xd591a0?, 0xc003c83550?}, {0xd5b838?, 0xc00b8b5a88?})
        /usr/local/go/src/go/ast/walk.go:169 +0x19a5
sigs.k8s.io/controller-tools/pkg/loader.(*referenceSet).collectReferences(0xc005ac6820, {0xd5e5b0?, 0xc00b8b5a88}, 0xc00b6dc600)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:107 +0xd4
sigs.k8s.io/controller-tools/pkg/loader.allReferencedPackages.func1(0x203002?, 0xc009f5e920?, 0xc00b8cc880)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:164 +0x52
sigs.k8s.io/controller-tools/pkg/loader.(*typeVisitor).Visit(0x0?, {0xd5b8b0?, 0xc00b8cc880?})
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/visit.go:64 +0xe9
go/ast.Walk({0xd591c0?, 0xc00cc8f830?}, {0xd5b8b0?, 0xc00b8cc880?})
        /usr/local/go/src/go/ast/walk.go:52 +0x62
go/ast.Walk({0xd591c0?, 0xc00cc8f830?}, {0xd5b4f0?, 0xc00b8cca00?})
        /usr/local/go/src/go/ast/walk.go:345 +0x21ea
go/ast.walkDeclList({0xd591c0, 0xc00cc8f830}, {0xc00b69f100?, 0xd, 0x0?})
        /usr/local/go/src/go/ast/walk.go:38 +0x91
go/ast.Walk({0xd591c0?, 0xc00cc8f830?}, {0xd5b428?, 0xc00b8acd80?})
        /usr/local/go/src/go/ast/walk.go:367 +0x1890
sigs.k8s.io/controller-tools/pkg/loader.EachType(0xc00b6e23c0, 0xc00cc8f818)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/visit.go:38 +0x96
sigs.k8s.io/controller-tools/pkg/loader.allReferencedPackages(0xc00b6e23c0, 0xc00b6dc600)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:162 +0x266
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc0075d1b00, 0xc00b6e23c0)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:249 +0x187
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x47?)
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:257 +0x65
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check
        /root/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/loader/refs.go:255 +0x1cd
tools/make/kube.mk:12: recipe for target 'generate' failed
@zirain zirain added the kind/bug Something isn't working label Sep 2, 2022
@Xunzhuo
Copy link
Member

Xunzhuo commented Sep 2, 2022

image

I did not see anything wrong?

image

@zirain
Copy link
Contributor Author

zirain commented Sep 2, 2022

yes, pass on my mac-pro, but failed on my dev machine

root@ecs-zirain:~# uname -a
Linux ecs-zirain 5.10.5-051005-generic #202101061537 SMP Wed Jan 6 15:43:53 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@ecs-zirain:~# lsb_release 
No LSB modules are available.
root@ecs-zirain:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

@zirain zirain changed the title infra: make generate is broken infra: make generate is broken on ubuntu18 Sep 2, 2022
@arkodg
Copy link
Contributor

arkodg commented Sep 3, 2022

yes, pass on my mac-pro, but failed on my dev machine

root@ecs-zirain:~# uname -a
Linux ecs-zirain 5.10.5-051005-generic #202101061537 SMP Wed Jan 6 15:43:53 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@ecs-zirain:~# lsb_release 
No LSB modules are available.
root@ecs-zirain:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

go version same on both machines ?

@zirain
Copy link
Contributor Author

zirain commented Sep 3, 2022

on ubuntu18

go version go1.18.2 linux/amd64

mac

go version go1.18.1 darwin/amd64

@sysulq
Copy link

sysulq commented Sep 6, 2022

Same error on my ubuntu server.

It would be fixed when downgrade grpc to 1.45.0 with replace in gomod file.

replace google.golang.org/grpc => google.golang.org/grpc v1.45.0

@arkodg
Copy link
Contributor

arkodg commented Sep 6, 2022

hey @hnlq715 @zirain thank for further debugging this issue
does bumping controller-tools https://github.com/envoyproxy/gateway/blob/main/tools/src/controller-gen/go.mod to a newer tag https://github.com/kubernetes-sigs/controller-tools/tags fix the issue ? if not, lets downgrade google.golang.org/grpc to v1.45.0
relates to kubernetes-sigs/controller-tools#648

arkodg added a commit to arkodg/gateway that referenced this issue Sep 7, 2022
* Possibly fixes envoyproxy#339

* Reran `make generate` and `make manifests` which updated the CRD
manifest

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
zirain pushed a commit to zirain/gateway that referenced this issue Sep 8, 2022
* Possibly fixes envoyproxy#339

* Reran `make generate` and `make manifests` which updated the CRD
manifest

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg closed this as completed in 1b4706b Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants