From ae5eab6d591217eae3be26b2702cacab1e7f755f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 2 Mar 2023 12:04:59 +0100 Subject: [PATCH] grafana: 9.3.6 -> 9.4.2 ChangeLog: https://github.com/grafana/grafana/blob/ae90f73b78e2583551402ea0a644b0b21e66d87d/CHANGELOG.md#942-2023-03-02 Also synced up the `go generate` calls from upstream's Makefile with our buildscript. Finally, I removed the `go.{mod,sum}` files from the vendored `xorm` in `pkg/util`. This was to work around the following build error: main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/pkg/util/xorm Not entirely sure why, but I guess that the presence of these files confused our build-script and it wrongly assumed that github.com/grafana/.../xorm didn't exist (while a different xorm according to the values in `go.mod` existed). --- pkgs/servers/monitoring/grafana/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index 71377d55b7a9..b0c9a538e049 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -2,7 +2,7 @@ buildGoModule rec { pname = "grafana"; - version = "9.3.6"; + version = "9.4.2"; excludedPackages = [ "alert_webhook_listener" "clean-swagger" "release_publisher" "slow_proxy" "slow_proxy_mac" "macaron" "devenv" ]; @@ -10,15 +10,15 @@ buildGoModule rec { rev = "v${version}"; owner = "grafana"; repo = "grafana"; - sha256 = "sha256-7t30AvGtCyU02fOYWHYcMWgcnmkepUpZzUMR4NjIlvw="; + sha256 = "sha256-dSKIQiav6y4P1e/7CptIdRuOrDdXdvItCaRBcbepadE="; }; srcStatic = fetchurl { url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz"; - sha256 = "sha256-jRUPrb6ocqux4SrMm/Hw/2DuG7sj2jKhSln16ynjHwM="; + sha256 = "sha256-dBp6V5ozu1koSoXIecjysSIdG0hL1K5lH9Z8yougUKo="; }; - vendorSha256 = "sha256-uGJ3D14qAvDkBUIlNxF1pCHMDYeuUoM8tPWfoEvA5o4="; + vendorSha256 = "sha256-atnlEdGDiUqQkslvRlPSi6VC5rEvRVV6R2Wxur3geew="; nativeBuildInputs = [ wire ]; @@ -28,8 +28,14 @@ buildGoModule rec { wire gen -tags oss ./pkg/server wire gen -tags oss ./pkg/cmd/grafana-cli/runner - GOARCH= CGO_ENABLED=0 go generate ./pkg/framework/coremodel - GOARCH= CGO_ENABLED=0 go generate ./public/app/plugins + GOARCH= CGO_ENABLED=0 go generate ./pkg/plugins/plugindef + GOARCH= CGO_ENABLED=0 go generate ./kinds/gen.go + GOARCH= CGO_ENABLED=0 go generate ./public/app/plugins/gen.go + GOARCH= CGO_ENABLED=0 go generate ./pkg/kindsys/report.go + + # Work around `main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/pkg/util/xorm`. + # Apparently these files confuse the dependency resolution for the go builder implemented here. + rm pkg/util/xorm/go.{mod,sum} # The testcase makes an API call against grafana.com: #