From ef2385322a4a6a8f27a88c7041ef601d331d9443 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Thu, 26 Mar 2026 14:39:34 -0700 Subject: [PATCH] Drop embedded frontend from Pyroscope build The webpack build fails on a @grafana/ui icons glob that doesn't resolve in the Nix sandbox. Since Grafana is the primary UI via the pyroscope datasource plugin, the standalone web UI isn't needed. Build with EMBEDASSETS="" (upstream's build-dev path). Co-Authored-By: Claude Opus 4.6 (1M context) --- containers/pyroscope/default.nix | 36 +++++--------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/containers/pyroscope/default.nix b/containers/pyroscope/default.nix index 3cd62fd..40565e8 100644 --- a/containers/pyroscope/default.nix +++ b/containers/pyroscope/default.nix @@ -2,6 +2,8 @@ # Builds v1.19.1 from forge mirror # Uses stdenv + make (not buildGoModule) due to multi-module go.work workspace # with local replace directives (./api, ./lidia) +# Built without embedded frontend — Grafana is the primary UI via the +# grafana-pyroscope-datasource plugin, so the standalone web UI is not needed. # Built with dockerTools.buildLayeredImage for efficient layer caching { pkgs ? import { } }: @@ -14,29 +16,6 @@ let hash = "sha256-UPxGimkzXLFACqmAM1hNQIoNjN6OquVibwVmNvP00+s="; }; - # Build frontend assets via yarn + webpack (upstream uses Docker for this) - ui = pkgs.mkYarnPackage { - inherit version src; - pname = "pyroscope-ui"; - - buildPhase = '' - runHook preBuild - export HOME=$TMPDIR - cd deps/grafana-pyroscope - yarn --offline build - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - mkdir -p $out - cp -r deps/grafana-pyroscope/public/build/* $out/ - runHook postInstall - ''; - - distPhase = "true"; - }; - # Pre-fetch Go modules for all go.mod files in the workspace (fixed-output derivation) goModules = pkgs.stdenv.mkDerivation { pname = "pyroscope-go-modules"; @@ -89,16 +68,11 @@ let cp -r ${goModules} $GOPATH/pkg/mod chmod -R u+w $GOPATH/pkg/mod - # Copy pre-built frontend assets - mkdir -p public/build - cp -r ${ui}/* public/build/ - - # Build Go binary with embedded frontend assets - # Skip the Makefile's frontend/build target (uses Docker) and - # invoke go/bin directly with EMBEDASSETS set + # Build Go binary without embedded frontend (EMBEDASSETS="") + # Grafana queries Pyroscope via API; standalone web UI not needed # CGO_ENABLED=0 for static binary (matches upstream) CGO_ENABLED=0 \ - EMBEDASSETS=embedassets \ + EMBEDASSETS="" \ IMAGE_TAG=v${version} \ make go/bin