From b69049948a4fd38aacebb608ce44cfcfd6fcb8e6 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 4 Jun 2023 23:52:56 +0200 Subject: Add mising protobuf subpackage --- tw/packages/monitoring.scm | 85 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 10 deletions(-) (limited to 'tw/packages') diff --git a/tw/packages/monitoring.scm b/tw/packages/monitoring.scm index 7a21296f..54bacfd5 100644 --- a/tw/packages/monitoring.scm +++ b/tw/packages/monitoring.scm @@ -145,7 +145,6 @@ buffer developer guide} for more information about protocol buffers themselves.") (license license:bsd-3))) -;; TODO: github.com/golang/protobuf/ptypes/timestamp required by github.com/prometheus/exporter-toolkit/web (define-public go-github-com-golang-protobuf-proto-latest (package (inherit go-github-com-golang-protobuf-proto) @@ -162,6 +161,51 @@ themselves.") (sha256 (base32 "1mh5fyim42dn821nsd3afnmgscrzzhn3h8rag635d2jnr23r1zhk")))) (arguments '(#:import-path "github.com/golang/protobuf/proto" #:unpack-path "github.com/golang/protobuf")) + (propagated-inputs + (cons* + (map protobuf-subpackage + '("encoding/prototext" + "encoding/protowire" + "internal/descfmt" + "internal/descopts" + "internal/detrand" + "internal/encoding/defval" + "internal/encoding/messageset" + "internal/encoding/tag" + "internal/encoding/text" + "internal/errors" + "internal/filedesc" + "internal/filetype" + "internal/flags" + "internal/genid" + "internal/impl" + "internal/order" + "internal/pragma" + "internal/set" + "internal/strs" + "internal/version" + "reflect/protodesc" + "reflect/protoreflect" + "reflect/protoregistry" + "runtime/protoiface" + "runtime/protoimpl" + "types/descriptorpb" + "proto")))) + (native-inputs + (cons* go-github-com-google-go-cmp-cmp + (map protobuf-subpackage + '("testing/protopack" + "types/known/anypb" + "types/known/timestamppb")))))) + +;; Apparently deprecated and removed from google.golang.org/protobuf, but +;; still required by github.com/prometheus/exporter-toolkit/web. +(define-public go-github-com-golang-protobuf-ptypes-timestamp + (package + (inherit go-github-com-golang-protobuf-proto-latest) + (name "go-github-com-golang-protobuf-ptypes-timestamp") + (arguments '(#:import-path "github.com/golang/protobuf/ptypes/timestamp" + #:unpack-path "github.com/golang/protobuf")) (propagated-inputs (map protobuf-subpackage '("encoding/prototext" @@ -184,19 +228,13 @@ themselves.") "internal/set" "internal/strs" "internal/version" - "reflect/protodesc" "reflect/protoreflect" "reflect/protoregistry" "runtime/protoiface" "runtime/protoimpl" - "types/descriptorpb" + "types/known/timestamppb" "proto"))) - (native-inputs - (cons* go-github-com-google-go-cmp-cmp - (map protobuf-subpackage - '("testing/protopack" - "types/known/anypb" - "types/known/timestamppb")))))) + (native-inputs (list)))) (define-public go-github-com-prometheus-client-model-latest (package @@ -233,9 +271,34 @@ themselves.") (modify-inputs (package-propagated-inputs go-github-com-prometheus-common) (replace "go-github-com-prometheus-client-model" go-github-com-prometheus-client-model-latest) + ;; Really, go-github-com-mwitkow-go-conntrack should go here, but that + ;; causes a symlink duplication or similar ("In procedure copy-file: + ;; Permission denied"). (append go-golang-org-x-oauth2) (append go-golang-org-x-text))))) +;; TODO: Build errors; possibly from depending on go-github-com-golang-protobuf-proto-latest + go-github-com-golang-protobuf-ptypes-timestamp? +;; # github.com/golang/protobuf/proto +;; src/github.com/golang/protobuf/proto/decode.go:57:6: DecodeVarint redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/buffer.go:39:38: previous declaration +;; src/github.com/golang/protobuf/proto/deprecated.go:24:2: ErrInternalBadWireType redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/decode.go:49:5: previous declaration +;; src/github.com/golang/protobuf/proto/encode.go:53:2: ErrNil redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/deprecated.go:18:2: previous declaration +;; src/github.com/golang/protobuf/proto/encode.go:57:2: ErrTooLarge redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/deprecated.go:21:2: previous declaration +;; src/github.com/golang/protobuf/proto/encode.go:72:6: EncodeVarint redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/buffer.go:26:31: previous declaration +;; src/github.com/golang/protobuf/proto/encode.go:98:6: SizeVarint redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/buffer.go:32:27: previous declaration +;; src/github.com/golang/protobuf/proto/lib.go:349:6: Buffer redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/buffer.go:49:6: previous declaration +;; src/github.com/golang/protobuf/proto/lib.go:358:6: NewBuffer redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/buffer.go:57:29: previous declaration +;; src/github.com/golang/protobuf/proto/lib.go:465:6: EnumName redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/deprecated.go:57:44: previous declaration +;; src/github.com/golang/protobuf/proto/lib.go:479:6: UnmarshalJSONEnum redeclared in this block +;; /tmp/guix-build-go-github-com-prometheus-exporter-toolkit-web-0.8.2.drv-0/src/github.com/golang/protobuf/proto/deprecated.go:66:82: previous declaration (define-public go-github-com-prometheus-exporter-toolkit-web (package (name "go-github-com-prometheus-exporter-toolkit-web") @@ -259,7 +322,9 @@ themselves.") go-github-com-coreos-go-systemd-v22-activation go-github-com-mwitkow-go-conntrack ;; The version from (gnu packages syncthing) is much too old, so update. - go-github-com-prometheus-common-latest)) + go-github-com-prometheus-common-latest + go-github-com-golang-protobuf-proto-latest + go-github-com-golang-protobuf-ptypes-timestamp)) (synopsis "Utility package to build Prometheus exporters") (description "This is a Go library for @url{https://prometheus.io/docs/introduction/glossary/#exporter, Prometheus -- cgit v1.2.3