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

crd-ref-docs doesn't support Go 1.22 #531

Closed
enocom opened this issue Feb 16, 2024 · 1 comment
Closed

crd-ref-docs doesn't support Go 1.22 #531

enocom opened this issue Feb 16, 2024 · 1 comment
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@enocom
Copy link
Member

enocom commented Feb 16, 2024

Our current tool to generate reference documentation for the CRD here is broken on Go 1.22.

$ bin/crd-ref-docs --source-path=internal/api/ --config=tools/config-crd-ref-docs.yaml --output-path=bin --renderer=markdown && \
                cp bin/out.md docs/api.md
2024-02-16T12:54:26.268-0700    INFO    crd-ref-docs    Loading configuration   {"path": "tools/config-crd-ref-docs.yaml"}
2024-02-16T12:54:26.269-0700    INFO    crd-ref-docs    Processing source directory     {"directory": "internal/api/", "depth": 6}
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x641a1e]

goroutine 159 [running]:
go/types.(*Checker).handleBailout(0xc001c8b000, 0xc001719d40)
        /usr/local/go/src/go/types/check.go:367 +0x88
panic({0xba0ae0?, 0x128e380?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xd96b50, 0x12976a0})
        /usr/local/go/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
        /usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xd96b50?, 0x12976a0?})
        /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xd9c848, 0x1261ac0}, 0xc001c8b000, 0x12976a0, 0x0)
        /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc001c8b000, {0xd99ba0, 0xc001ca3f40?})
        /usr/local/go/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc001c8b000, {0xd99cf0, 0xc001cb2120}, 0x0)
        /usr/local/go/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc001c8b000, {0xd99cf0, 0xc001cb2120}, 0xc001719328?)
        /usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc001c8b000, {0xd99cf0, 0xc001cb2120})
        /usr/local/go/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc001c8b000, 0xc001cbf7a0, 0xc001cbf7a0?)
        /usr/local/go/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc001c8b000, {0xd99d20, 0xc001ca1788}, 0xc001cc0c30)
        /usr/local/go/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc001c8b000, {0xd99d20, 0xc001ca1788}, 0xc6c00e?)
        /usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc001c8b000, 0xc001cc0c30, 0xc001ca5240, 0x0)
        /usr/local/go/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc001c8b000, {0xda2938, 0xc001cc0c30}, 0x0)
        /usr/local/go/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc001c8b000)
        /usr/local/go/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc001c8b000, {0xc001c82a68, 0x3, 0x3})
        /usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
        /usr/local/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc00023ac90, 0xc00037d780)
        /home/enocom/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc00037d780)
        /home/enocom/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc00091e060, 0xc00037d780)
        /home/enocom/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x49?)
        /home/enocom/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 146
        /home/enocom/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:260 +0x1c5

The underlying issue is in an old version of controller-tools and has been fixed in the latest version. See kubernetes-sigs/controller-tools#880.

However, crd-ref-docs is using the bad version. We need to get crd-ref-docs to update their version and cut a release.

@enocom enocom added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Feb 16, 2024
@ttosta-google
Copy link
Contributor

crd-ref-docs has been updated to v0.14.0 (elastic/crd-ref-docs#63) and now it supports Go 1.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants