guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sanitizer of record fields?


From: bokr
Subject: Re: Sanitizer of record fields?
Date: Thu, 8 Sep 2022 13:35:48 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hi Simon, et al

On +2022-09-08 09:59:15 +0200, zimoun wrote:
> Hi,
> 
> The website is currently failing [1] to build because a typo in some
> package declaration.  The error message is not very helpful,
> 
>         srfi/srfi-1.scm:241:2: In procedure map:
>         In procedure map: Wrong type argument: "https://www.qt.io/";
>         building pages in '/tmp/gnu.org/software/guix'...
>

ISTM this "wrong type argument" is an infuriatingly common
and typically useless error message.

Would it be possible to have a debugging hook where the message is output
which if activated would show the call stack, so one could see where in
the user code it happened?

Activation could I imagine be by guile checking e.g.
"GUILE_THROW_DEBUG_WRONG_ARGUMENT" on invocation, to turn on the hook
in a way that would have zero performance effect if not activated.

Alternatively, could a wrapper start one's problem code using GDB
to put a break point at the hook place, pre-setting up the call
args etc and starting GDB so you could type run or step etc.?

Can geiser trace stuff? IWBN to have something analogous to bash's
shopt for printing expression sources as they are read and/or executed.
Does something like that exist?

Thoughts? :)

> and it was not straightforward to find the issue.  Using some ’pk’ in
> the website builder restricted the origin of the failure; but still.
> Thanks to Florian, they found this commit [2] introducing the package
> qtshadertools where a field is unexpected,
> 
>         +    (license (package-home-page qtbase))))
> 
> and boum!
> 
> It seems impossible to detect that typo at compile-time because fields
> do not have a specific type (except by convention).  Therefore, how can
> we detect such typo?
> 
> We could add a lint checker.  Is it a “good” idea?
> 
> Because lint is not always applied, a check should be done when running
> ’make’ or a special target.  Is it a “good” idea?
> 
> 
> 1: <http://issues.guix.gnu.org/issue/57581>
> 2: 
> <https://git.savannah.gnu.org/cgit/guix.git/diff/?id=1d65ff8fdeb20cc2db956093f0ecb1f3f72afc0e>
> 
> 
> Cheers,
> simon
>
--
Regards,
Bengt Richter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]