public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: kernel-doc -Werror regression
Date: Mon, 12 Jan 2026 09:10:53 +0100	[thread overview]
Message-ID: <20260112091053.00cee29a@foz.lan> (raw)
In-Reply-To: <98717d6e2d2505c253f511ea78968b5adb079a7e@intel.com>

Hi Jani,

Em Fri, 09 Jan 2026 13:07:02 +0200
Jani Nikula <jani.nikula@intel.com> escreveu:

> Mauro, Jon -
> 
> It seems to me with the kernel-doc conversion from perl to python we've
> lost a huge amount of -Werror handling. AFAICS none of the warnings from
> kdoc_parser.py using emit_msg() lead to a non-zero exit status from
> kernel-doc.

The culprit was not the conversion, but this change:
 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded")

which effectively broke most of -W<foo> command line arguments.

I mentioned it back then:
	https://lore.kernel.org/linux-doc/3fnulqi7hfplggfqevab525clikq7fnsnt72lauddzy32sepyq@maux2bgqa3np/

-

After the conversion, the errors detected during the parsing
phase were moved to be displayed/handled at the output phase.
There, when an error occurs, self.errors is incremented at:

	tools/lib/python/kdoc/kdoc_files.py

Then, at kernel-doc.py, we have:

    error_count = kfiles.errors
    if not error_count:
        sys.exit(0)

    if args.werror:
        print("%s warnings as errors" % error_count)    # pylint: disable=C0209
        sys.exit(error_count)

Patch 469c1c9eb6c9 broke it, among other things, as it now emits
errors at parsing time, breaking the logic that inhibits errors
with -W<foo>, and breaking -Werror as well, as the error is not
counted anymore.

That's said, there is another issue there as well, which I hadn't
time yet to fix: we can't do sys.exit(error_count), as the return
code is an 8-bit value.

I'll work on a patch series to address such issues along the week.

Thanks,
Mauro

      reply	other threads:[~2026-01-12  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 11:07 kernel-doc -Werror regression Jani Nikula
2026-01-12  8:10 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260112091053.00cee29a@foz.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox