aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-09-13 22:00:22 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-11-09 21:33:42 +0000
commit449fa18bf60907a7625ff6eeb037ecbb3a00be77 (patch)
treed196d15334c22818bd305ee08c298a5f73707555
parentf40fde0e85da80c6801f5affbd52e6cb84625eec (diff)
downloadguix-449fa18bf60907a7625ff6eeb037ecbb3a00be77.tar.gz
guix-449fa18bf60907a7625ff6eeb037ecbb3a00be77.zip
gnu: go-github-com-prometheus-exporter-toolkit: Fix build.
* gnu/packages/prometheus.scm (go-github-com-prometheus-exporter-toolkit): Fix build [arguments]: <#:phases>: Add 'fix-embed-editions-defaults-binpb phase; remove 'disable-failing-tests in favor of "-skip" test flags. [native-inputs]: Add go-google-golang-org-protobuf. Change-Id: If573aa261adc3a136a4907267d1427a9f9cfb4d9
-rw-r--r--gnu/packages/prometheus.scm29
1 files changed, 21 insertions, 8 deletions
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index 6204eba5df..c3267a234b 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -405,20 +405,33 @@ from the default AWS credential chain.")
#:import-path "github.com/prometheus/exporter-toolkit"
#:phases
#~(modify-phases %standard-phases
- (add-after 'unpack 'disable-failing-tests
- (lambda* (#:key tests? import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (substitute* (find-files "." "\\_test.go$")
- ;; Some tests require network set up.
- (("TestServerBehaviour") "OffTestServerBehaviour")
- (("TestConfigReloading") "OffTestConfigReloading")))))
+ (add-after 'unpack 'fix-embed-editions-defaults-binpb
+ (lambda _
+ (let* ((import-path "google.golang.org/protobuf")
+ (subdir "internal/editiondefaults")
+ (embed-file "editions_defaults.binpb")
+ (embed-file-path
+ (string-append "src/"
+ import-path "/"
+ subdir "/"
+ embed-file)))
+ (delete-file-recursively embed-file-path)
+ (copy-file
+ (string-append
+ #$(this-package-native-input "go-google-golang-org-protobuf")
+ "/" embed-file-path)
+ embed-file-path))))
;; XXX: Workaround for go-build-system's lack of Go modules support.
(delete 'build)
(replace 'check
(lambda* (#:key tests? import-path #:allow-other-keys)
(when tests?
(with-directory-excursion (string-append "src/" import-path)
- (invoke "go" "test" "-v" "./..."))))))))
+ (invoke "go" "test" "-v"
+ "-skip" "TestServerBehaviour|TestConfigReloading"
+ "./..."))))))))
+ (native-inputs
+ (list go-google-golang-org-protobuf))
(propagated-inputs
(list go-github-com-alecthomas-kingpin-v2
go-github-com-coreos-go-systemd-v22