From 5727fbea4a5beff4bede3f01a03e6087685c6737 Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Wed, 7 Dec 2022 12:20:28 +0000 Subject: [PATCH 1/2] datadog-agent: build with go118 If using go119, the agent throws an error at startup: ``` panic: Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the go1.19 runtime ``` I believe this needs a fix in the datadog package itself, similar to: https://github.com/DataDog/datadog-agent/pull/11455 but for go1.19 --- pkgs/tools/networking/dd-agent/datadog-agent.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/dd-agent/datadog-agent.nix b/pkgs/tools/networking/dd-agent/datadog-agent.nix index 741ef0834223..f2013c4889ee 100644 --- a/pkgs/tools/networking/dd-agent/datadog-agent.nix +++ b/pkgs/tools/networking/dd-agent/datadog-agent.nix @@ -1,7 +1,7 @@ { lib , stdenv , cmake -, buildGoModule +, buildGo118Module , makeWrapper , fetchFromGitHub , pythonPackages @@ -35,7 +35,7 @@ let cmakeFlags = ["-DBUILD_DEMO=OFF" "-DDISABLE_PYTHON2=ON"]; }; -in buildGoModule rec { +in buildGo118Module rec { pname = "datadog-agent"; inherit src version; From 845e54e94b4bfba4b99ce636f35415e4d5d86d08 Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Wed, 7 Dec 2022 12:06:54 +0000 Subject: [PATCH 2/2] datadog-agent: add rtloader to LD_LIBRARY_PATH This fixes the python init error mentioned here: https://github.com/NixOS/nixpkgs/issues/105221#issuecomment-1251150900 However, there are still issues with the derived python environment - for some reason datadog_checks.base is not present in the env's site-packages, which all the other checks depend on, so python loading still isn't working fully (but I believe this is an improvement over what's there already at least). --- pkgs/tools/networking/dd-agent/datadog-agent.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/tools/networking/dd-agent/datadog-agent.nix b/pkgs/tools/networking/dd-agent/datadog-agent.nix index f2013c4889ee..b83083936a31 100644 --- a/pkgs/tools/networking/dd-agent/datadog-agent.nix +++ b/pkgs/tools/networking/dd-agent/datadog-agent.nix @@ -100,8 +100,7 @@ in buildGo118Module rec { wrapProgram "$out/bin/agent" \ --set PYTHONPATH "$out/${python.sitePackages}"'' + lib.optionalString withSystemd '' \ - --prefix LD_LIBRARY_PATH : ${lib.getLib systemd}/lib - ''; + --prefix LD_LIBRARY_PATH : '' + lib.makeLibraryPath [ (lib.getLib systemd) rtloader ]; meta = with lib; { description = ''