Build from Source

Hi, I am trying to build from source using the make file provided by running “make build”, however running into the following error. Looks like the command gcc is missing in the commands folder? Any help/guide? I want to create a standalone executable for Windows environment.

make build
GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/cortezaproject/corteza/server/pkg/version.Version=2023.9.1 " -o build/corteza-server-2023.9.1-windows-amd64.exe cmd/corteza/main.go

runtime/cgo

cgo: C compiler “gcc” not found: exec: “gcc”: executable file not found in %PATH%

github.com/cortezaproject/corteza/server/system/commands

system\commands\users.go:121:46: cannot use syscall.Stdin (variable of type “syscall”.Handle) as int value in argument to terminal.ReadPassword
system\commands\users.go:233:45: cannot use syscall.Stdin (variable of type “syscall”.Handle) as int value in argument to terminal.ReadPassword
make: *** [build/corteza-server-2023.9.1-windows-amd64.exe] Error 1

Hi,

it looks like one of our dependencies is able to compile only on linux/unix systems.

We have never tried to compile on Windows yet, your best 2 bets for now would be:

  • compile your custom(?) source on linux/unix/in container and create an image and use that in windows
  • find an alternate solution to terminal.ReadPassword (that could use something else apart from syscall.Handle) and create a PR + tests

Regards

Thanks @peter for confirmation and guidance