Improving diagnostic messages when invoking tasks involving a disabler
object
#12350
mitchgrout
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My project includes a pretty sizable number of external tools, many of which are optional (e.g. linters, formatters, bonus generation steps, ...). I make use of CI runners to run particular tasks, and I can't guarantee that all of them have the same configurations as each other. This means I have a lot of statements like, let's say...
Running
meson compile -C build doxygen
, I can have one of two outputs:doxygen
was found, then I get my output as expectedERROR: Can't invoke target
doxygen: target not found
I understand why this output is present, but it is in my opinion uninformative, as it is indistinguishable from making a simple typo, like
meson compile -C build Doxygen
. To someone who is not familiar with the build configuration, it also only adds confusion in my experience.A thought could be to attach to a
disabler
object a reason for being disabled, e.g. making thedisabler()
method signature intoand adding
disabler.reason()
to extract the specified reason, e.g.A
disabler
generated by a failedfind_program
call could then set itsreason
to something informative such as...and rather than not emitting a target due to a disabler being present, providing an always-failing task which emits the reason from the disabler.
As it stands, in order to get useful output, I need to copy-paste code blobs like...
such that if I run
meson compile -C build doxygen
without the tool available, I get understandable diagnostics.Beta Was this translation helpful? Give feedback.
All reactions