Guix weather backtrace

  • Done
  • quality assurance status badge
Details
3 participants
  • Jack Hill
  • Maxime Devos
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Jack Hill
Severity
normal
J
J
Jack Hill wrote on 28 Jun 2021 22:15
(address . bug-guix@gnu.org)
alpine.DEB.2.21.2106281611160.2109@marsh.hcoop.net
I get the following output when running `guix weather icecat` on
aarch64-linux with Guix:

$ guix describe
Generation 1 Jun 28 2021 01:11:59 (current)
guix 364b561
branch: master
commit: 364b56124b88398c199aacbfd4fdfc9a1583e634

$ guix weather icecat
computing 0 package derivations for aarch64-linux...
looking for 0 store items on https://ci.guix.gnu.org...
Backtrace:
7 (primitive-load "/home/jackhill/.config/guix/current/bi…")
In guix/ui.scm:
2147:12 6 (run-guix-command _ . _)
In ice-9/boot-9.scm:
1752:10 5 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/weather.scm:
577:9 4 (_)
In guix/build/utils.scm:
569:23 3 (every* #<procedure d88f240 at guix/scripts/weather.sc…> …)
In guix/scripts/weather.scm:
579:21 2 (_ "https://ci.guix.gnu.org")
212:22 1 (_ _ () 0)
In ice-9/boot-9.scm:
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f
#f)'.

Best,
Jack
M
M
Maxime Devos wrote on 29 Jun 2021 00:12
bad19196a4cf3f00a1988eb77d4fee183afa4d99.camel@telenet.be
Jack Hill schreef op ma 28-06-2021 om 16:15 [-0400]:
Toggle quote (4 lines)
> computing 0 package derivations for aarch64-linux...
> [...]
> Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.

A division by zero problem?
Also, this seems architecture-dependent:

$ guix weather icecat --system=x86_64-linux icecat

2 pakketdistillaties aan het berekenen voor x86_64-linux...
op zoek naar 2 depotobjecten op https://ci.guix.gnu.org...
100.0% substituten beschikbaar (2 van de 2)
ten minste 355,2 MiB aan narbestanden (gecomprimeerd)
377,9 MiB op schijf (ongecomprimeerd)
0,379 seconden per verzoek (0,8 seconden in totaal)
2,6 verzoeken per seconde

$ guix weather icecat --system=aarch64-linux icecat

0 pakketdistillaties aan het berekenen voor aarch64-linux...
op zoek naar 0 depotobjecten op https://ci.guix.gnu.org...
Backtrace: [...]
Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.

Seems like the definition of icecat or some dependency of icecat does
not support aarch64. Anyway, here is a patch. Could you confirm it works?

Greetings,
Maxime.
From 1d87e33360c9897a77b7e172f16e3cd1973c959d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 29 Jun 2021 00:06:34 +0200
Subject: [PATCH] weather: Handle zero requested store items gracefully.

This can happen if the weather information of a package
is requested for an unsupported system. For example,
try "guix weather icecat --system=aarch64-linux".

* guix/scripts/weather.scm
(report-server-coverage): Do not divide by zero when zero
store items are requested from a server.

Reported-By: Jack Hill <jackhill@jackhill.us>
---
guix/scripts/weather.scm | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

Toggle diff (53 lines)
diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 6d925d416c..06312d65a2 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -185,9 +186,12 @@ or #f if it could not be determined."
#:key display-missing?)
"Report the subset of ITEMS available as substitutes on SERVER.
When DISPLAY-MISSING? is true, display the list of missing substitutes.
-Return the coverage ratio, an exact number between 0 and 1."
+Return the coverage ratio, an exact number between 0 and 1.
+In case ITEMS is an empty list, return 1 instead."
(define MiB (* (expt 2 20) 1.))
+ ;; TRANSLATORS: it is quite possible zero store items are
+ ;; looked for.
(format #t (G_ "looking for ~h store items on ~a...~%")
(length items) server)
@@ -208,9 +212,10 @@ Return the coverage ratio, an exact number between 0 and 1."
narinfos))
(time (+ (time-second time)
(/ (time-nanosecond time) 1e9))))
- (format #t (G_ " ~,1f% substitutes available (~h out of ~h)~%")
- (* 100. (/ obtained requested 1.))
- obtained requested)
+ (when (> requested 0)
+ (format #t (G_ " ~,1f% substitutes available (~h out of ~h)~%")
+ (* 100. (/ obtained requested 1.))
+ obtained requested))
(let ((total (/ (reduce + 0 sizes) MiB)))
(match (length sizes)
((? zero?)
@@ -299,7 +304,9 @@ are queued~%")
;; Return the coverage ratio.
(let ((total (length items)))
- (/ (- total (length missing)) total)))))
+ (if (> total 0)
+ (/ (- total (length missing)) total)
+ 1)))))
;;;
--
2.32.0
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNpJSxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gFRAP9n0l+Hm4zbAdrcevEwbdkF+1xf
NT1nYNVLPRdb/flPZgD/SE/piznh3IsV4j/o5zwP9X5m3eDiATDv0mEsJt3LAQc=
=HW/V
-----END PGP SIGNATURE-----


J
J
Jack Hill wrote on 29 Jun 2021 05:29
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 49263@debbugs.gnu.org)
alpine.DEB.2.21.2106282322490.2109@marsh.hcoop.net
On Tue, 29 Jun 2021, Maxime Devos wrote:

Toggle quote (8 lines)
> Jack Hill schreef op ma 28-06-2021 om 16:15 [-0400]:
>> computing 0 package derivations for aarch64-linux...
>> [...]
>> Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.
>
> A division by zero problem?
> Also, this seems architecture-dependent:

[…]

Toggle quote (3 lines)
> Seems like the definition of icecat or some dependency of icecat does
> not support aarch64. Anyway, here is a patch. Could you confirm it works?

Thanks for taking a look. Yeah, I guess it's not a aarch64 problem
per-say, but that it's easier to run into unsupported packages over here.

Yes, with the path applied, I can find out what the weather is:

$ ./pre-inst-env guix weather icecat
computing 0 package derivations for aarch64-linux...
looking for 0 store items on https://ci.guix.gnu.org...
unknown substitute sizes
0.0 MiB on disk (uncompressed)

14 queued builds
x86_64-linux: 2 (14.3%)
i686-linux: 10 (71.4%)
aarch64-linux: 2 (14.3%)
build rate: .00 builds per hour
aarch64-linux: 0.00 builds per hour
i686-linux: 0.00 builds per hour
x86_64-linux: 0.00 builds per hour
looking for 0 store items on https://bordeaux.guix.gnu.org...
unknown substitute sizes
0.0 MiB on disk (uncompressed)
(continuous integration information unavailable)

Some of the output doesn't quite make sense anymore in the context where
we don't expect to find anything, but this is still much improved.

Thank you!
Jack
M
M
Maxime Devos wrote on 29 Jun 2021 10:12
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 49263@debbugs.gnu.org)
13e1641335cb77db8c894a44c46d2e1c806456dd.camel@telenet.be
Jack Hill schreef op ma 28-06-2021 om 23:29 [-0400]:
Toggle quote (14 lines)
> On Tue, 29 Jun 2021, Maxime Devos wrote:
> > Seems like the definition of icecat or some dependency of icecat does
> > not support aarch64. Anyway, here is a patch. Could you confirm it works?
>
> Thanks for taking a look. Yeah, I guess it's not a aarch64 problem
> per-say, but that it's easier to run into unsupported packages over here.
>
> Yes, with the path applied, I can find out what the weather is:
>
> [...]
>
> Some of the output doesn't quite make sense anymore in the context where
> we don't expect to find anything, but this is still much improved.

Just to be clear, I don't have commit access, so you'll have to wait
for a committer to verify the patch works well and commit it.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNrV4BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vrkAQDeZdb+pNPWvacGN4VdOXHRZRck
XGZDlVFoWawDKRq1+wEAl2+IcR5xC7+4pNRsOgw6X5HqyO49kM6QBcP+liHbowE=
=2tNf
-----END PGP SIGNATURE-----


M
M
Mathieu Othacehe wrote on 29 Jun 2021 20:22
(name . Maxime Devos)(address . maximedevos@telenet.be)
874kdgil8y.fsf@gnu.org
Hello,

Toggle quote (3 lines)
> Seems like the definition of icecat or some dependency of icecat does
> not support aarch64. Anyway, here is a patch. Could you confirm it works?

Applied as 5ef96ecaaeeabd5500e406f0103ca52ec079fdb9.

Thanks,

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 49263@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 49263
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch