I am trying to compile a plugin on FreeBSD (the OpenSearch plugin) but the build process insists on producing binaries for Linux and Darwin.
I am sure I am missing something stupid. Any hints? I have go 1.19.5 and the required bits. And the compilation works, apparently, but it is actually cross compiling.
I installed Go, Mage and Yarn. Grafana 9 of course. All of them from the FreeBSD ports.
I downloaded the latest release of the plugin source from Github. Unpacked the directory and ran:
go mod tidy
Once all the Go dependencies were downlodaded I patched:
~/go/pkg/mod/github.com/grafana/grafana-plugin-sdk-go@v0.138.0/build/common.go in order to include a FreeBSD build configuration.
Just adding the lines:
// FreeBSDAMD64 builds the back-end plugin for OSX on ARM (M1).
func (Build) FreeBSDAMD64() error {
return buildBackend(newBuildConfig("freebsd", "amd64"))
}
below the definition for Darwin, and adding FreeBSDAMD64 to the list of targets to build below: