Olivier Dion <[email protected]> writes:

> On Fri, 20 Nov 2026, Tomas Volf <[email protected]> wrote:
>> Olivier Dion <[email protected]> writes:
>>
>>>>> Finally, note that I did some improvement on the message reporting side
>>>>> of the compiler.  Mainly in the reader and on the CPS analyze passes.
>>>>> If your program/tests rely on message layout for these, this could be
>>>>> considered a regression.  However, I think that these improvement are
>>>>> very important and much welcomed by the users.  So if you can add
>>>>> workarounds for this kind of regression, that would be great.
>>>>
>>>> I agree the new warnings/errors look pretty and are probably useful for
>>>> interactive use in a terminal, however in CI they complicate suppressing
>>>> warnings (due to every message being multiple lines).
>>>>
>>>> My current thinking is basically to put following grep before the one I
>>>> already have, but that is prone to false positives.
>>>>
>>>>     grep -vEe '^ +| +\^~+' -e '^ +[0-9]+ +|'
>>>
>>> You can disable individual warnings with `-Wno-' flags.  Also, there is
>>> a fluid that set the current warning prefix.  This is not exposed to
>>> users AFAIK but we could expose it somehow so that you can easily filter
>>> any line that start with that prefix.
>>>
>>> Could this be working for you?
>>
>> The problem is that Guile currently offers no mechanism to suppress
>> specific *instances* of a warning.  So, e.g. I in general do want the
>> `unused variable' warnings to be emitted, but some of them cannot be
>> addressed (e.g., warning: unused variable `failure'), -Wno will not
>> help.
>>
>> I have adopted similar mechanism Valgrind has, a suppression list (in my
>> case pretty much `grep -xvFf') per .scm file.  I just pipe the warnings
>> through it to see the list of "real" warnings.
>>
>> For this filtering to work, I need to be able to somehow process the
>> warnings one-by-one.  Currently that just means line-by-line, but I am
>> unsure how to do that in the new fancy format.  If the fluid would allow
>> somehow annotate the warning so that I could once again process them
>> one-by-one, that would suffice, but if it is just a prefix, I am unsure
>> how that will work.  If the fluid would allow placing a marker before
>> and after a full warning (so before first, and after last line), that
>> would be great and suffice for my needs.
>
> I have a patch ready to push if you are okay with the following:
>
>   I am adding the concept of `diagnostics flags'.  The default
>   diagnostics flags are:
>
>     '(colors hyperlink note pretty-source)
>
>   Each flag enables a feature.  For example, the `note' flag enable
>   printing a note for certain kind of warnings to give hints to the
>   user.
>
>   The current diagnostics flags is a parameter that governed what will
>   be emitted in diagnostics outputs.  The compiler will automatically
>   parameterize it around the language analyzer (if any) using either the
>   default flags (another parameter called `default-diagnostics-flags')
>   or via the #:opts like so:
>
>     #:opts (#:diagnostics-flags (flags ...))
>
>   The later is used by `guild compile' to parameterize the diagnostics
>   flags with the new `--diagnostics-flags[=FLAGS]' option.  In your
>   case, you could do `guild compile --diagnostics-flags' to disable all
>   feature, effectively having something very similar as before.  If you
>   want to enable says, colors and note, you would do
>   `--diagnostics-flags=colors,note'.
>
> WDYT?

That sound good, thank you :)

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to