Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: confusing "build constraints exclude all Go files" error when trying to cross-compile a package that uses CGO #29074
I executed the command
I'm really not getting what error it is. Please provide solution to go cross compilation from linux to ARM architecture binaries..
You already opened this issue as DataDog/zstd#46. Please keep the discussion there, as this isn't a bug in Go.
You can't cross-compile a package that uses CGO - that's where the error comes from. You'll see the same error if you try
I honestly don't know if cross compiling with CGO is a good idea, but you could try existing workarounds like https://github.com/karalabe/xgo.
Actually, I think the error message here could be clearer. On a first scan of the package, there are no Go files with build constraints, so it can seem like the error is wrong. Only if one is aware of CGO does the error make sense.
Perhaps the error should somehow point at CGO instead of saying "build constraints exclude all Go files".