From 5b232943b609b9191c4680de8614554fb1fdb401 Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Wed, 1 Mar 2023 12:29:07 +0100 Subject: [PATCH 1/3] netdata-go-d-plugin: 0.50.0 -> 0.51.2 + expose --- pkgs/tools/system/netdata/default.nix | 9 ++++----- pkgs/tools/system/netdata/go.d.plugin.nix | 8 ++++---- pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index d5612331e829..62cb3022d904 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, callPackage, fetchFromGitHub, autoreconfHook, pkg-config, makeWrapper , CoreFoundation, IOKit, libossp_uuid , nixosTests +, netdata-go-d-plugin , curl, jemalloc, libuv, zlib , libcap, libuuid, lm_sensors, protobuf , withCups ? false, cups @@ -14,9 +15,7 @@ , withDebug ? false }: -let - go-d-plugin = callPackage ./go.d.plugin.nix {}; -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { # Don't forget to update go.d.plugin.nix as well version = "1.38.1"; pname = "netdata"; @@ -70,8 +69,8 @@ in stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = lib.optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; postInstall = '' - ln -s ${go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d - ln -s ${go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin + ln -s ${netdata-go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d + ln -s ${netdata-go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin '' + lib.optionalString (!stdenv.isDarwin) '' # rename this plugin so netdata will look for setuid wrapper mv $out/libexec/netdata/plugins.d/apps.plugin \ diff --git a/pkgs/tools/system/netdata/go.d.plugin.nix b/pkgs/tools/system/netdata/go.d.plugin.nix index 5b45ddbb3ae2..8118a480f3d2 100644 --- a/pkgs/tools/system/netdata/go.d.plugin.nix +++ b/pkgs/tools/system/netdata/go.d.plugin.nix @@ -1,16 +1,16 @@ { lib, fetchFromGitHub, buildGo119Module }: buildGo119Module rec { - pname = "netdata-go.d.plugin"; - version = "0.50.0"; + pname = "netdata-go-plugins"; + version = "0.51.2"; src = fetchFromGitHub { owner = "netdata"; repo = "go.d.plugin"; rev = "v${version}"; - sha256 = "5kDc6zszVuFTDkNMuHBRwrfDnH+AdD6ULzmywtvL8iA="; + sha256 = "sha256-u87kTNM1oAmJRtm/iEESjVvQ9qEpFCGqRT8M+iVEwlI="; }; - vendorSha256 = "sha256-Wv6xqzpQxlZCrVnS+g9t1qiYCkm3NfXfW8XDYA9Txxs="; + vendorSha256 = "sha256-QB+Sf7biNPD8/3y9pFxOJZXtc6BaBcQsUGP7y9Wukwg="; doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6312ce2bc8fc..7e5431d93e40 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9280,6 +9280,8 @@ with pkgs; netdata = callPackage ../tools/system/netdata { inherit (darwin.apple_sdk.frameworks) CoreFoundation IOKit; }; + # Exposed here so the bots can auto-upgrade it + netdata-go-plugins = callPackage ../tools/system/netdata/go.d.plugin.nix {}; netsurf = recurseIntoAttrs (callPackage ../applications/networking/browsers/netsurf { }); netsurf-browser = netsurf.browser; From 7687b4e3e129828652a4eec246ffa74f30d2a1cf Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Wed, 1 Mar 2023 12:50:28 +0100 Subject: [PATCH 2/3] netdata: fix libexec shebangs --- pkgs/tools/system/netdata/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 62cb3022d904..b6cfc448f6a6 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -2,7 +2,7 @@ , CoreFoundation, IOKit, libossp_uuid , nixosTests , netdata-go-d-plugin -, curl, jemalloc, libuv, zlib +, bash, curl, jemalloc, libuv, zlib , libcap, libuuid, lm_sensors, protobuf , withCups ? false, cups , withDBengine ? true, lz4 @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ]; - buildInputs = [ curl jemalloc libuv zlib ] + # bash is only used to rewrite shebangs + buildInputs = [ bash curl jemalloc libuv zlib ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ] ++ lib.optionals (!stdenv.isDarwin) [ libcap libuuid ] ++ lib.optionals withCups [ cups ] From ea0ab0b07c489d4268b321329010818ad217fa66 Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Fri, 3 Mar 2023 15:33:52 +0100 Subject: [PATCH 3/3] netdata: fix withDebug build --- pkgs/tools/system/netdata/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index b6cfc448f6a6..321b5ab84fa6 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -65,8 +65,9 @@ stdenv.mkDerivation rec { # to bootstrap tools: # https://github.com/NixOS/nixpkgs/pull/175719 # We pick zlib.dev as a simple canary package with pkg-config input. - disallowedReferences = [ zlib.dev ]; + disallowedReferences = if withDebug then [] else [ zlib.dev ]; + donStrip = withDebug; env.NIX_CFLAGS_COMPILE = lib.optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; postInstall = ''