retina icon indicating copy to clipboard operation
retina copied to clipboard

can't build binary by `make retina-binary`

Open nayihz opened this issue 1 year ago • 2 comments

Describe the bug

# make retina-binary
package command-line-arguments
        imports github.com/microsoft/retina/pkg/plugin/packetforward
        imports github.com/microsoft/retina/pkg/plugin/packetforward/_cprog: C source files not allowed when not using cgo or SWIG: packetforward.c
package command-line-arguments
        imports github.com/microsoft/retina/pkg/plugin/packetforward
        imports github.com/microsoft/retina/pkg/plugin/packetforward/_cprog: C source files not allowed when not using cgo or SWIG: packetforward.c
prog.go:12:2: no required module provides package github.com/golang/mock/mockgen/model: go.mod file not found in current directory or any parent directory; see 'go help modules'
prog.go:14:2: no required module provides package github.com/microsoft/retina/pkg/plugin/packetforward: go.mod file not found in current directory or any parent directory; see 'go help modules'
2024/03/23 12:35:28 Loading input failed: exit status 1
exit status 1
pkg/plugin/packetforward/types_linux.go:31: running "go": exit status 1

To Reproduce Just run make retina-binary on main branch.

Expected behavior Create an output directory and build retina binary successfully.

Screenshots

Platform (please complete the following information):

  • OS: Ubuntu
  • Kubernetes Version: [e.g. 1.22]
  • Host: [e.g. AKS, KIND, self-host, etc]
  • Retina Version:

Additional context Add any other context about the problem here.

nayihz avatar Mar 23 '24 12:03 nayihz

I believe you have to disable CGO_ENABLED for this, so adding CGO_ENABLED=0 before make retina-binary should work. Can you give us addition contexts i.e the reproduce steps as well as the platform you used to build?

nddq avatar Mar 25 '24 16:03 nddq

I don't disable CGO_ENABLED manually. CGO_ENABLED=0 doesn't seem to take effect actually. I have open a pr to fix it(#129). PTAL.

nayihz avatar Mar 26 '24 01:03 nayihz