Subject: Re: bug#61322: [PATCH] status: Print a hint when a 'package-cache' hook fails to build.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 11 Feb 2023 00:13:53 +0100

Hello!

zimoun <[email-masked]> skribis:

>> In this case the relevant bit in the build log is:
>>
>> --8<---------------cut here---------------start------------->8---
>> In inria/hiepacs.scm:
>>    879:41  3 (inputs #<package [email-masked] inria/hi?>)
>> In ice-9/boot-9.scm:
>>   1685:16  2 (raise-exception _ #:continuable? _)
>>   1780:13  1 (_ #<&compound-exception components: (#<&undefined-vari?>)
>> In unknown file:
>>            0 (backtrace #<undefined>)
>>
>> (exception unbound-variable (value #f) (value "Unbound variable: ~S") (value (python2-numpy)) (value #f))
>> --8<---------------cut here---------------end--------------->8---
>
> [...]
>
>> +     (let ((properties (and=> (false-if-exception
>> +                               (read-derivation-from-file drv))
>> +                              derivation-properties)))
>> +       (when (and (pair? properties)
>> +                  (eq? (assq-ref properties 'type) 'profile-hook)
>> +                  (eq? (assq-ref properties 'hook) 'package-cache))
>> +         (display-hint (format #f (G_ "This usually indicates a bug in one of
>> +the channels you are pulling from, or some incompatibility among them.  You
>> +can check the build log and report the issue to the channel developers.
>> +
>> +The channels you are pulling from are: ~a.")
>> +                               (string-join
>> +                                (map symbol->string
>> +                                     (or (assq-ref properties 'channels)
>> +                                         '(guix))))))))
>
> Would it be possible to also detect and also display the unbound
> variable, e.g., python2-numpy?

Nope.  As I wrote, I agree it would be nicer, but I don’t see how we
could reliably “extract” the actual error from the build log.

Pushed as 3ab8559436356ef89aa60135d3558681d64443ae.

Thanks for taking a look!

Ludo’.