Closed aariv1 closed 1 month ago
@aariv1 does adding the following line work for you locally? (if so, feel free to raise a PR)
diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh
index 6303a29c..0f626256 100755
--- a/hack/update-codegen.sh
+++ b/hack/update-codegen.sh
@@ -19,6 +19,7 @@ set -o nounset
set -o pipefail
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[@]}")/..
+mkdir -p "{SCRIPT_ROOT}/hack/tools/bin"
TOOLS_DIR=$(realpath ./hack/tools)
TOOLS_BIN_DIR="${TOOLS_DIR}/bin"
@aariv1 I encountered the same issue on my Mac, but when I used Ubuntu, everything worked fine. Maybe you could try using Linux to see if it helps.
Adding mkdir -p "${SCRIPT_ROOT}/hack/tools/bin"
does work (although the codegen is still broken https://github.com/kubernetes-sigs/scheduler-plugins/issues/729). I'll raise a pr anyway. Thank you
/assign
applied this fix and then received when the script ran
${CONTROLLER_GEN} object:headerFile="hack/boilerplate/boilerplate.generatego.txt" \
paths="./apis/scheduling/..."
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=0x2 addr=0x0 pc=0x105464b24]
goroutine 194 [running]:
go/types.(*Checker).handleBailout(0x140017db600, 0x14000529d18)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/check.go:367 +0x9c
panic({0x10573d360?, 0x105cd7e90?})
/Users/andan02/.gvm/gos/go1.22.2/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x105807b70, 0x105ce0640})
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/sizes.go:228 +0x314
go/types.(*Config).sizeof(...)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/sizes.go:333
go/types.representableConst.func1({0x105807b70?, 0x105ce0640?})
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x10580ddb0, 0x105cac7c0}, 0x140017db600, 0x105ce0640, 0x0)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/const.go:92 +0x138
go/types.(*Checker).arrayLength(0x140017db600, {0x10580c180, 0x14000547460?})
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:510 +0x238
go/types.(*Checker).typInternal(0x140017db600, {0x10580a7a0, 0x140005522a0}, 0x0)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:299 +0x3bc
go/types.(*Checker).definedType(0x140017db600, {0x10580a7a0, 0x140005522a0}, 0x104ee0a5c?)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).varType(0x140017db600, {0x10580a7a0, 0x140005522a0})
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:145 +0x2c
go/types.(*Checker).structType(0x140017db600, 0x1400055b920, 0x1400055b920?)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/struct.go:113 +0x128
go/types.(*Checker).typInternal(0x140017db600, {0x10580a710, 0x14001071590}, 0x1400055dbd0)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:316 +0xed0
go/types.(*Checker).definedType(0x140017db600, {0x10580a710, 0x14001071590}, 0x105579956?)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).typeDecl(0x140017db600, 0x1400055dbd0, 0x14000545680, 0x0)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/decl.go:615 +0x39c
go/types.(*Checker).objDecl(0x140017db600, {0x105812d20, 0x1400055dbd0}, 0x0)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/decl.go:197 +0x880
go/types.(*Checker).packageObjects(0x140017db600)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/resolver.go:681 +0x3c0
go/types.(*Checker).checkFiles(0x140017db600, {0x14000d49aa0, 0x3, 0x3})
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/check.go:408 +0x164
go/types.(*Checker).Files(...)
/Users/andan02/.gvm/gos/go1.22.2/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0x140003b8ea0, 0x1400042e900)
/Users/andan02/.gvm/pkgsets/go1.22.2/global/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:286 +0x2d8
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0x1400042e900)
/Users/andan02/.gvm/pkgsets/go1.22.2/global/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:99 +0x44
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0x1400069ce40, 0x1400042e900)
/Users/andan02/.gvm/pkgsets/go1.22.2/global/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:268 +0x304
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x5a?)
/Users/andan02/.gvm/pkgsets/go1.22.2/global/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:262 +0x58
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 178
/Users/andan02/.gvm/pkgsets/go1.22.2/global/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:260 +0x230
not sure if this is related to the underlying issue here.
@clubanderson your issue seems to be caused by Go 1.22 - which is incompatible w/ the controller-gen version. Go 1.21 works:
Meanwhile I will bump the version of controller-gen so Go 1.22 can also work.
yep - that worked -
gvm install go1.21.0
gvm use go1.21.0
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
Area
Other components
codegen
What happened?
This is more of an annoyance but when you execute ./hack/update-codegen.sh on m1 mac it by default fails because realpath fails if the path you are requesting does not exist. The error in this case is simply:
realpath: ./hack/tools: No such file or directory
What did you expect to happen?
Expectation is that you could run the update-codegen.sh without needing to create the tools directory beforehand
For example something like this:
TOOLS_DIR=$(realpath ./hack) TOOLS_DIR+="/tools"
How can we reproduce it (as minimally and precisely as possible)?
On at least m1 mach clone the repo and execute hack/update-codegen.sh
Anything else we need to know?
No response
Kubernetes version
Scheduler Plugins version