Building Grafana from source on Mac fails with tar exit code 1

Hey there,

I decided to adjust grafana’s codebase a little to fit my needs. This has worked well; I could locally test my changes and now I want to build a binary from it so I can deploy it to a production server.

The Documentation tells me to run this command:
go run build.go build package

Which I do, but it fails on my Mac. More specifically, the tar -C command produces an exit code 1. Calling man tar on Mac reveals that this may be due to an implementation detail with the -C flag:
The -C dir option may differ from historic implementations.

Are you aware of this error? Do you have any solutions or suggestions?

The packaging build task is only for Linux and Windows binaries.

To build on MacOS, is a different process. It is just a normal build from source and then copy the files to the right places.

Homebrew takes care of that for us:

This part copies the files to the correct folders (grafana_server to bin, the ini files to etc/grafana etc.) See this part of the script:

What sort of package are you trying to build?