Unverified Commit f01d3e2b authored by Thomas Gerbet's avatar Thomas Gerbet Committed by GitHub
Browse files

Merge pull request #248716 from LeSuisse/ssm-agent-3.2.1297.0

ssm-agent: 3.0.755.0 -> 3.2.1297.0
parents 88d154fe d395dbee
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -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