diff options
| author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-03-28 22:03:36 +0000 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-05-26 16:50:31 +0100 |
| commit | 8e038cec79cdfaa855ba6402ccc6463ef3a34eec (patch) | |
| tree | 230494213190416b46cc542548090d75bf16efb9 /gnu/packages/prometheus.scm | |
| parent | 9d6f82087527bb811ee95a3e72013c2c4a8520c5 (diff) | |
gnu: go-github-com-prometheus-common: Improve package style, simplify.
* gnu/packages/prometheus.scm (go-github-com-prometheus-common):
Simplify package by using go-build-system parameters.
[arguments] <skip-build?>: No go go files in project's root.
<test-subdirs>: Move them here from custom 'check phase.
<phases>: Do not delete 'build, skip it; use default 'check.
[synopsis]: Fix it according to project's About.
[description]: Add more context from the project's README.
Change-Id: I05cfd5e2635b95cd3308f5a3543f6745d6c9079a
Diffstat (limited to 'gnu/packages/prometheus.scm')
| -rw-r--r-- | gnu/packages/prometheus.scm | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm index ada59b9b25e..073c4602510 100644 --- a/gnu/packages/prometheus.scm +++ b/gnu/packages/prometheus.scm | |||
| @@ -280,35 +280,28 @@ Prometheus metrics.") | |||
| 280 | (build-system go-build-system) | 280 | (build-system go-build-system) |
| 281 | (arguments | 281 | (arguments |
| 282 | (list | 282 | (list |
| 283 | #:skip-build? #t | ||
| 283 | #:import-path "github.com/prometheus/common" | 284 | #:import-path "github.com/prometheus/common" |
| 284 | #:phases | 285 | #:test-subdirs |
| 285 | #~(modify-phases %standard-phases | 286 | #~(list |
| 286 | ;; XXX: Workaround for go-build-system's lack of Go modules support. | 287 | ;; Skipp, as it requires |
| 287 | (delete 'build) | 288 | ;; <github.com/prometheus/client_golang/prometheus>, which introduces |
| 288 | (replace 'check | 289 | ;; cycle. |
| 289 | (lambda* (#:key tests? import-path #:allow-other-keys) | 290 | ;; "./config/..." |
| 290 | (when tests? | ||
| 291 | (with-directory-excursion (string-append "src/" import-path) | ||
| 292 | (invoke "go" "test" "-v" | ||
| 293 | ;; Skipp, as it requires | ||
| 294 | ;; <github.com/prometheus/client_golang/prometheus>, | ||
| 295 | ;; which introduces cycle. | ||
| 296 | ;; "./config/..." | ||
| 297 | 291 | ||
| 298 | ;; Some tests fail on non x86_64 architecture: | 292 | ;; Some tests fail on non x86_64 architecture: Cannot use 9223372036 |
| 299 | ;; Cannot use 9223372036 (untyped int constant) as int | 293 | ;; (untyped int constant) as int value in ;; struct literal |
| 300 | ;; value in ;; struct literal (overflows). | 294 | ;; (overflows). Cannot use math.MaxInt64 (untyped int constant |
| 301 | ;; Cannot use math.MaxInt64 | 295 | ;; 9223372036854775807) as int value in argument to HumanizeTimestamp |
| 302 | ;; (untyped int constant 9223372036854775807) as int value | 296 | ;; (overflows) |
| 303 | ;; in argument to HumanizeTimestamp (overflows) | 297 | #$@(if (target-x86-64?) |
| 304 | #$@(if (target-x86-64?) | 298 | '("./helpers/...") |
| 305 | '("./helpers/...") | 299 | '()) |
| 306 | '()) | 300 | "./expfmt/..." |
| 307 | "./expfmt/..." | 301 | "./model/..." |
| 308 | "./model/..." | 302 | "./promlog/..." |
| 309 | "./promlog/..." | 303 | "./route/..." |
| 310 | "./route/..." | 304 | "./server/..."))) |
| 311 | "./server/...")))))))) | ||
| 312 | (native-inputs | 305 | (native-inputs |
| 313 | (list go-github-com-stretchr-testify)) | 306 | (list go-github-com-stretchr-testify)) |
| 314 | (propagated-inputs | 307 | (propagated-inputs |
| @@ -324,10 +317,20 @@ Prometheus metrics.") | |||
| 324 | go-google-golang-org-protobuf | 317 | go-google-golang-org-protobuf |
| 325 | go-gopkg-in-yaml-v2)) | 318 | go-gopkg-in-yaml-v2)) |
| 326 | (home-page "https://github.com/prometheus/common") | 319 | (home-page "https://github.com/prometheus/common") |
| 327 | (synopsis "Prometheus metrics") | 320 | (synopsis "Shared Prometheus Golang components") |
| 328 | (description | 321 | (description |
| 329 | "This package provides tools for reading and writing Prometheus | 322 | "This package provides Go libraries that are shared across Prometheus |
| 330 | metrics.") | 323 | components. |
| 324 | |||
| 325 | @itemize | ||
| 326 | @item @code{config} - common configuration structures | ||
| 327 | @item @code{expfmt} - decoding and encoding for the exposition format | ||
| 328 | @item @code{model} - shared data structures | ||
| 329 | @item @code{promslog} - a logging wrapper around log/slog | ||
| 330 | @item @code{route} - a routing wrapper around httprouter using context.Context | ||
| 331 | @item @code{server} - common servers | ||
| 332 | @item @code{version} version information and metrics | ||
| 333 | @end itemize") | ||
| 331 | (license license:asl2.0))) | 334 | (license license:asl2.0))) |
| 332 | 335 | ||
| 333 | (define-public go-github-com-prometheus-common-assets | 336 | (define-public go-github-com-prometheus-common-assets |
