From 260cc9477282f860ec85bf6abf1d239113caf82e Mon Sep 17 00:00:00 2001 From: emattiza Date: Tue, 2 Apr 2024 01:29:39 +0000 Subject: [PATCH] otel-cli: 0.4.4 -> 0.4.5 see [otel-cli release notes](https://github.com/equinix-labs/otel-cli/releases/tag/v0.4.5) --- pkgs/tools/misc/otel-cli/default.nix | 10 +++++---- .../otel-cli/patches/bin-echo-patch.patch | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 pkgs/tools/misc/otel-cli/patches/bin-echo-patch.patch diff --git a/pkgs/tools/misc/otel-cli/default.nix b/pkgs/tools/misc/otel-cli/default.nix index 1330188a3ee4..65f97c75f7d2 100644 --- a/pkgs/tools/misc/otel-cli/default.nix +++ b/pkgs/tools/misc/otel-cli/default.nix @@ -2,24 +2,26 @@ buildGoModule rec { pname = "otel-cli"; - version = "0.4.4"; + version = "0.4.5"; src = fetchFromGitHub { owner = "equinix-labs"; repo = pname; rev = "v${version}"; - hash = "sha256-XVhnDtt2FhYgfGWDPFkneZTboeHGaIbiF5YdHoqB8N8="; + hash = "sha256-JYi9CbP4mUhX0zNjhi6QlBzLKcj2zdPwlyBSIYKp6vk="; }; - vendorHash = "sha256-HwbEqWtOqiTe5Z/MtMAs63Lzvll/vgmbCpMTREXgtXA="; + vendorHash = "sha256-fWQz7ZrU8gulhpOHSN8Prn4EMC0KXy942FZD/PMsLxc="; preCheck = '' ln -s $GOPATH/bin/otel-cli . '' + lib.optionalString (!stdenv.isDarwin) '' substituteInPlace main_test.go \ - --replace 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`' + --replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`' ''; + patches = [ ./patches/bin-echo-patch.patch ]; + passthru.updateScript = nix-update-script {}; meta = with lib; { diff --git a/pkgs/tools/misc/otel-cli/patches/bin-echo-patch.patch b/pkgs/tools/misc/otel-cli/patches/bin-echo-patch.patch new file mode 100644 index 000000000000..236672860585 --- /dev/null +++ b/pkgs/tools/misc/otel-cli/patches/bin-echo-patch.patch @@ -0,0 +1,21 @@ +diff --git a/data_for_test.go b/data_for_test.go +index c0b8980..691e270 100644 +--- a/data_for_test.go ++++ b/data_for_test.go +@@ -555,14 +555,14 @@ var suites = []FixtureSuite{ + "--endpoint", "{{endpoint}}", + "--verbose", "--fail", + "--attrs", "zy=ab", // ensure CLI args still propagate +- "--", "/bin/echo", "a", "z", ++ "--", "echo", "a", "z", + }, + }, + Expect: Results{ + SpanCount: 1, + CliOutput: "a z\n", + SpanData: map[string]string{ +- "attributes": "/^process.command=/bin/echo,process.command_args=/bin/echo,a,z,process.owner=\\w+,process.parent_pid=\\d+,process.pid=\\d+,zy=ab/", ++ "attributes": "/^process.command=echo,process.command_args=echo,a,z,process.owner=\\w+,process.parent_pid=\\d+,process.pid=\\d+,zy=ab/", + }, + }, + },