summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Gerbet <thomas@gerbet.me>2023-08-12 13:54:11 +0200
committerThomas Gerbet <thomas@gerbet.me>2023-08-12 13:54:11 +0200
commitd395dbee943550a1b637e3b7551c9d166620cea6 (patch)
tree561b423cedafd9e7dd86fdb9d68ac89c908a5cdc
parente2fdf4411b157997e38bc1569cd0e631afb11de5 (diff)
downloadnixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar.gz
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar.bz2
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar.lz
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar.xz
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.tar.zst
nixpkgs-d395dbee943550a1b637e3b7551c9d166620cea6.zip
ssm-agent: 3.0.755.0 -> 3.2.1297.0
Release notes:
https://github.com/aws/amazon-ssm-agent/blob/3.2.1297.0/RELEASENOTES.md

Fixes #226907
-rw-r--r--pkgs/applications/networking/cluster/ssm-agent/default.nix30
1 files changed, 17 insertions, 13 deletions
diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix
index baf85847875..5a0dc0d2d97 100644
--- a/pkgs/applications/networking/cluster/ssm-agent/default.nix
+++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix
@@ -3,7 +3,6 @@
 , buildGoPackage
 , makeWrapper
 , fetchFromGitHub
-, fetchpatch
 , coreutils
 , nettools
 , dmidecode
@@ -28,7 +27,7 @@ let
 in
 buildGoPackage rec {
   pname = "amazon-ssm-agent";
-  version = "3.0.755.0";
+  version = "3.2.1297.0";
 
   goPackagePath = "github.com/aws/${pname}";
 
@@ -38,7 +37,7 @@ buildGoPackage rec {
     rev = version;
     owner = "aws";
     repo = "amazon-ssm-agent";
-    hash = "sha256-yVQJL1MJ1JlAndlrXfEbNLQihlbLhSoQXTKzJMRzhao=";
+    hash = "sha256-zRs7RsShZPH3hb5MsADUNrTfHbJVwCELE9mCqEWaTng=";
   };
 
   patches = [
@@ -48,16 +47,25 @@ buildGoPackage rec {
     # They used constants from another package that I couldn't figure
     # out how to resolve, so hardcoded the constants.
     ./0002-version-gen-don-t-use-unnecessary-constants.patch
+  ];
+
+  # See the list https://github.com/aws/amazon-ssm-agent/blob/3.2.1297.0/makefile#L120-L138
+  # The updater is not built because it cannot work on NixOS
+  subPackages = [
+    "core"
+    "agent"
+    "agent/cli-main"
+    "agent/framework/processor/executer/outofproc/worker"
+    "agent/session/logging"
+    "agent/framework/processor/executer/outofproc/sessionworker"
+  ];
 
-    (fetchpatch {
-      name = "CVE-2022-29527.patch";
-      url = "https://github.com/aws/amazon-ssm-agent/commit/0fe8ae99b2ff25649c7b86d3bc05fc037400aca7.patch";
-      sha256 = "sha256-5g14CxhsHLIgs1Vkfw8FCKEJ4AebNqZKf3ZzoAN/T9U=";
-    })
+  ldflags = [
+    "-s"
+    "-w"
   ];
 
   preConfigure = ''
-    rm -r ./Tools/src/goreportcard
     printf "#!/bin/sh\ntrue" > ./Tools/src/checkstyle.sh
 
     substituteInPlace agent/platform/platform_unix.go \
@@ -78,8 +86,6 @@ buildGoPackage rec {
   '';
 
   preBuild = ''
-    cp -r go/src/${goPackagePath}/vendor/src go
-
     pushd go/src/${goPackagePath}
 
     # Note: if this step fails, please patch the code to fix it! Please only skip
@@ -95,8 +101,6 @@ buildGoPackage rec {
   postBuild = ''
     pushd go/bin
 
-    rm integration-cli versiongenerator generator
-
     mv core amazon-ssm-agent
     mv agent ssm-agent-worker
     mv cli-main ssm-cli