bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
91 stars 13 forks source link

CGO build issue #43

Closed randomthingsandstuff closed 2 years ago

randomthingsandstuff commented 2 years ago

The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling. You can control this by setting the CGO_ENABLED environment variable when running the go tool: set it to 1 to enable the use of cgo, and to 0 to disable it. The go tool will set the build constraint "cgo" if cgo is enabled. The special import "C" implies the "cgo" build constraint, as though the file also said "// +build cgo". Therefore, if cgo is disabled, files that import "C" will not be built by the go tool. (For more about build constraints see https://golang.org/pkg/go/build/#hdr-Build_Constraints).

https://github.com/bgp/stayrtr/runs/4011014697?check_suite_focus=true

Basically, some libs have // +build cgo and the default is to do it. Stuff should work in straight Go. Go make the makefile set CGO_ENABLED=0 for CI/docker and test against that.