k9s icon indicating copy to clipboard operation
k9s copied to clipboard

failed to build on riscv64 as explicitly set CGO_ENABLED?=0

Open aimixsaka opened this issue 11 months ago • 0 comments




Describe the bug Failed to build on RISC-V with -buildmode=pie as CGO_ENABLED is explicitly set default to 0 in Makefile

To Reproduce

  1. use qemu-system-riscv or qemu-riscv64(qemu-user) (you can create this environment by following https://github.com/felixonmars/archriscv-packages/wiki/Setup-Arch-Linux-RISC-V-Development-Environment),
  2. clone this repo and then:
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
make build

Historical Documents Build log:

...
go: downloading github.com/google/s2a-go v0.1.7
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2
-buildmode=pie requires external (cgo) linking, but cgo is not enabled
make: *** [Makefile:28: build] Error 1
...

Expected behavior Build successfully.

Versions After added the CGO_ENABLED?=0 in Makefile(after https://github.com/derailed/k9s/commit/d5c9cf5ed5671a1d193b0d397253dfb140370024)

Confusion Of course we can explicitly export CGO_ENABLED=1 to build , but why we disable cgo by default from https://github.com/derailed/k9s/commit/d5c9cf5ed5671a1d193b0d397253dfb140370024 ? Are there any problems when not setting CGO_ENABLED?=0 explicitly ? :-/

Thanks. :-)

aimixsaka avatar Mar 14 '24 12:03 aimixsaka