From a94d3b30ed4abff907aba3e427837cce5a580291 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 10 May 2023 10:54:42 +0100 Subject: [PATCH] opentelemetry-collector: 0.76.1 -> 0.77.0 Removed otelcontribcol stub since it's been warning users for 2 releases Fixed description to not be self-referential Fixed aarch64-darwin build Diff: https://github.com/open-telemetry/opentelemetry-collector/compare/v0.76.1...v0.77.0 Changelog: https://github.com/open-telemetry/opentelemetry-collector/blob/v0.77.0/CHANGELOG.md --- .../misc/opentelemetry-collector/default.nix | 29 +++++------ .../update_go-m1cpu_fix_aarch64-darwin.patch | 52 +++++++++++++++++++ 2 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 pkgs/tools/misc/opentelemetry-collector/update_go-m1cpu_fix_aarch64-darwin.patch diff --git a/pkgs/tools/misc/opentelemetry-collector/default.nix b/pkgs/tools/misc/opentelemetry-collector/default.nix index 51b539a1ece2..836f357ddfe3 100644 --- a/pkgs/tools/misc/opentelemetry-collector/default.nix +++ b/pkgs/tools/misc/opentelemetry-collector/default.nix @@ -1,28 +1,27 @@ -{ buildGoModule +{ lib +, buildGoModule , fetchFromGitHub -, lib -, writeScript }: -let - otelcontribcol = writeScript "otelcontribcol" '' - echo 'ERROR: otelcontribcol is now in `pkgs.opentelemetry-collector-contrib`, call the collector with `otelcorecol` or move to `pkgs.opentelemetry-collector-contrib`' >&2 - exit 1 - ''; -in buildGoModule rec { pname = "opentelemetry-collector"; - version = "0.76.1"; + version = "0.77.0"; src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-collector"; rev = "v${version}"; - sha256 = "sha256-e+IdEGrJzDRUaAViUSyXdkYv9Hfub0ytmh3pl1f/nGM="; + hash = "sha256-koPkEOtB5KnePdx67hJ/WNBojNDqKvf9kqYb59bwh8k="; }; # there is a nested go.mod sourceRoot = "source/cmd/otelcorecol"; - vendorHash = "sha256-8OkKPrK0xLWK5hIPaI7hgCGY0g7sWbaS/1HHqoTuqxk="; + vendorHash = "sha256-M1fLrQFrcfCRCcunkgEzUicVfi5Mz/Or6tFpcGfWf4E="; + + patches = [ + # remove when fixed upstream + # https://github.com/open-telemetry/opentelemetry-collector/issues/7668 + ./update_go-m1cpu_fix_aarch64-darwin.patch + ]; preBuild = '' # set the build version, can't be done via ldflags @@ -31,14 +30,10 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; - postInstall = '' - cp ${otelcontribcol} $out/bin/otelcontribcol - ''; - meta = with lib; { homepage = "https://github.com/open-telemetry/opentelemetry-collector"; changelog = "https://github.com/open-telemetry/opentelemetry-collector/blob/v${version}/CHANGELOG.md"; - description = "OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process and export telemetry data"; + description = "A vendor-agnostic implementation on how to receive, process and export telemetry data"; longDescription = '' The OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process and export telemetry data. In addition, it removes the diff --git a/pkgs/tools/misc/opentelemetry-collector/update_go-m1cpu_fix_aarch64-darwin.patch b/pkgs/tools/misc/opentelemetry-collector/update_go-m1cpu_fix_aarch64-darwin.patch new file mode 100644 index 000000000000..0a1ea9331b06 --- /dev/null +++ b/pkgs/tools/misc/opentelemetry-collector/update_go-m1cpu_fix_aarch64-darwin.patch @@ -0,0 +1,52 @@ +--- a/go.mod ++++ b/go.mod +@@ -19,7 +19,7 @@ require ( + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.77.0 + go.opentelemetry.io/collector/receiver v0.77.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.77.0 +- golang.org/x/sys v0.7.0 ++ golang.org/x/sys v0.8.0 + ) + + require ( +@@ -60,8 +60,8 @@ require ( + github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/statsd_exporter v0.22.7 // indirect + github.com/rs/cors v1.9.0 // indirect +- github.com/shirou/gopsutil/v3 v3.23.3 // indirect +- github.com/shoenig/go-m1cpu v0.1.4 // indirect ++ github.com/shirou/gopsutil/v3 v3.23.5-0.20230505121632-e045dc75ca1c // indirect ++ github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect +--- a/go.sum ++++ b/go.sum +@@ -383,10 +383,18 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH + github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= + github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQgSEE= + github.com/shirou/gopsutil/v3 v3.23.3/go.mod h1:lSBNN6t3+D6W5e5nXTxc8KIMMVxAcS+6IJlffjRRlMU= ++github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o= ++github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8= ++github.com/shirou/gopsutil/v3 v3.23.5-0.20230505121632-e045dc75ca1c h1:ZYIGwnQEbcRHlzQRm/ns8iJQgJU+drtg4cX39shs9lE= ++github.com/shirou/gopsutil/v3 v3.23.5-0.20230505121632-e045dc75ca1c/go.mod h1:LIiQgnFqJnplML7ahhMDo0wRqv6xMPNGNxGRDObehQ0= + github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVbozs= + github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= ++github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= ++github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= ++github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= + github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= + github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= ++github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= + github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= + github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= + github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +@@ -627,6 +635,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= + golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ++golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= ++golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= + golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=