Cross Compilation of Grafana (Plugin) for MacOs


I am developing the Grafana SQlite Backend plugin and want to cross compile this for a MacOS environment. Since SQLite requires CGO this is not very straightforward.

But since Grafana itself requires CGO I was hoping somebody could point me to the build process of Grafana itself (which I couldn’t find for MacOS).

Thanks in advance!

The default Magefile target should build a Darwin (macOS) binary. I noticed that the SQLite plugin runs v0.78.0 of the plugin SDK. Try updating to the latest v0.86.0 and rebuild the plugin.

I will give it a look, but my main issue is the CGO support of SQLite.

Normally Golang can be crosscompiled easily to any system (which is what the magefile target does), but since SQLite requires a CrossCompiler on the machine I think this will not work.

As Grafana itself relies on SQLite I was hoping you might have a link to the compilation script and process of Grafana itself…