linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Restore kernel-doc support for prehistoric Python
@ 2025-07-12  8:13 Mauro Carvalho Chehab
  2025-07-12  8:13 ` [PATCH v2 1/2] docs: kernel-doc: emit warnings for ancient versions of Python Mauro Carvalho Chehab
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2025-07-12  8:13 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel,
	Akira Yokosawa

Hi Jon,

Sendind a v2 that was actually tested with versions 2.7 and 3.4.

While discussing patch v2 12/12 from your kdoc series, I realized
that kernel-doc command line should not crash with Python 3.6,
nor cause compilation breakages with older versions.

The problem mainly affect builds with CONFIG_DRM enabled, due to:

drivers/gpu/drm/Makefile:                PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
drivers/gpu/drm/i915/Makefile:    cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
include/drm/Makefile:           PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \

This small series prevent Kernel build breakages on such case,
and it is meant to be merged after your kdoc patches.

Patch 1 emits a warning wih Python 3.7 siilar to kdoc class,
but on an early stage. More importantly, it emits a warning
and exits the script for versions <= 3.6. 

We still need the kdoc warning, as it detect troubles when
calling kernel-doc as a class.

Patch 2 fix a backward-compatibility issue that otherwise
would require Python 3.9.

With that, building the Kernel with older versions won't break.

Regards,
Mauro

---

v2:
   - added a coding line to kernel-doc exec;
   - only include kdoc lib after checking version;
   - don't use f-strings at main().


Mauro Carvalho Chehab (2):
  docs: kernel-doc: emit warnings for ancient versions of Python
  scripts: kdoc: make it backward-compatible with Python 3.7

 scripts/kernel-doc.py           | 35 ++++++++++++++++++++++++++-------
 scripts/lib/kdoc/kdoc_parser.py |  4 +++-
 2 files changed, 31 insertions(+), 8 deletions(-)

-- 
2.50.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-29 15:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12  8:13 [PATCH v2 0/2] Restore kernel-doc support for prehistoric Python Mauro Carvalho Chehab
2025-07-12  8:13 ` [PATCH v2 1/2] docs: kernel-doc: emit warnings for ancient versions of Python Mauro Carvalho Chehab
2025-07-12  8:13 ` [PATCH v2 2/2] scripts: kdoc: make it backward-compatible with Python 3.7 Mauro Carvalho Chehab
2025-07-12  8:32 ` [PATCH v2 3/2] docs: changes: better document Python needs Mauro Carvalho Chehab
2025-07-12 16:31   ` Laurent Pinchart
2025-07-12 22:25     ` Mauro Carvalho Chehab
2025-07-13  9:27       ` Laurent Pinchart
2025-07-24 14:42       ` Jonathan Corbet
2025-07-24 17:43         ` Mauro Carvalho Chehab
2025-07-28  9:28           ` Jani Nikula
2025-07-28 15:33             ` Mauro Carvalho Chehab
2025-07-29 10:45               ` Jani Nikula
2025-07-29 13:44                 ` Mauro Carvalho Chehab
2025-07-29 15:04                   ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).