Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/kernel-doc.py: don't create *.pyc files

As reported by Andy, kernel-doc.py is creating a __pycache__
directory at build time.

Disable creation of __pycache__ for the libraries used by
kernel-doc.py, when excecuted via the build system or via
scripts/find-unused-docs.sh.

Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Closes: https://lore.kernel.org/linux-doc/Z_zYXAJcTD-c3xTe@black.fi.intel.com/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <158b962ed7cd104f7bbfe69f499ec1cc378864db.1745453655.git.mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
5c5c32d7 110214e4

+5 -5
+1 -1
drivers/gpu/drm/Makefile
··· 236 236 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) 237 237 cmd_hdrtest = \ 238 238 $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \ 239 - $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ 239 + PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ 240 240 touch $@ 241 241 242 242 $(obj)/%.hdrtest: $(src)/%.h FORCE
+1 -1
drivers/gpu/drm/i915/Makefile
··· 408 408 # 409 409 # Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build 410 410 ifdef CONFIG_DRM_I915_WERROR 411 - cmd_checkdoc = $(srctree)/scripts/kernel-doc -none -Werror $< 411 + cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $< 412 412 endif 413 413 414 414 # header test
+1 -1
include/drm/Makefile
··· 11 11 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) 12 12 cmd_hdrtest = \ 13 13 $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \ 14 - $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ 14 + PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ 15 15 touch $@ 16 16 17 17 $(obj)/%.hdrtest: $(src)/%.h FORCE
+1 -1
scripts/Makefile.build
··· 83 83 endif 84 84 85 85 ifneq ($(KBUILD_EXTRA_WARN),) 86 - cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $(KDOCFLAGS) \ 86 + cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \ 87 87 $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \ 88 88 $< 89 89 endif
+1 -1
scripts/find-unused-docs.sh
··· 54 54 if [[ ${FILES_INCLUDED[$file]+_} ]]; then 55 55 continue; 56 56 fi 57 - str=$(scripts/kernel-doc -export "$file" 2>/dev/null) 57 + str=$(PYTHONDONTWRITEBYTECODE=1 scripts/kernel-doc -export "$file" 2>/dev/null) 58 58 if [[ -n "$str" ]]; then 59 59 echo "$file" 60 60 fi