Skip to content

Restore kernel-doc support for prehistoric Python

Mauro Carvalho Chehab linux-doc lkml workflows 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 11 repliesIn review
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2docs: kernel-doc: emit warnings for ancient versions of Pythonscripts/kernel-doc.py+28 -70 replies
2/2scripts: kdoc: make it backward-compatible with Python 3.7scripts/lib/kdoc/kdoc_parser.py+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] Restore kernel-doc support for prehistoric Python

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(-)
Signature · 1 line
2.50.0