Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #56848

[PATCH RESEND] Documentation/sphinx: prevent generation of .pyc files in the source tree

From Jani Nikula <jani.nikula@intel.com>
Newsgroups linux.debian.kernel
Subject [PATCH RESEND] Documentation/sphinx: prevent generation of .pyc files in the source tree
Date 2017-01-31 19:40 +0100
Message-ID <t5Lvs-44k-13@gated-at.bofh.it> (permalink)
References <t5KpJ-3sq-31@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


Use PYTHONDONTWRITEBYTECODE=1 to prevent python from creating .pyc files
in the source tree. Python 3.2 has a __pycache__ scheme [1], but before
that the only alternative seems to be to copy the source files to the
build tree to ensure the .pyc files are created there too. Just prevent
.pyc file generation for simplicity.

Considering the small amount of python code to compile (assuming sphinx
itself has .pyc around), the impact on build is neglible.

[1] http://stackoverflow.com/questions/3522079/changing-the-directory-where-pyc-files-are-created

References: http://lkml.kernel.org/r/CAMuHMdVxqpH7-9XJ+YE_pgoA+-fe0969cSkOehYh3uubYcrhZA@mail.gmail.com
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
References: http://lkml.kernel.org/r/1485816692.2900.17.camel@decadent.org.uk
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 Documentation/Makefile.sphinx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 707c65337ebf..91f541a52884 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -55,6 +55,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 
 quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
       cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\
+	PYTHONDONTWRITEBYTECODE=1 \
 	BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
 	$(SPHINXBUILD) \
 	-b $2 \
-- 
2.1.4

Back to linux.debian.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sphinx builds always write to the source directory Ben Hutchings <ben@decadent.org.uk> - 2017-01-31 00:00 +0100
  Re: Sphinx builds always write to the source directory Jani Nikula <jani.nikula@linux.intel.com> - 2017-01-31 09:10 +0100
    Re: Sphinx builds always write to the source directory Jonathan Corbet <corbet@lwn.net> - 2017-01-31 18:30 +0100
      [PATCH RESEND] Documentation/sphinx: prevent generation of .pyc files in the source tree Jani Nikula <jani.nikula@intel.com> - 2017-01-31 19:40 +0100
        Re: [PATCH RESEND] Documentation/sphinx: prevent generation of .pyc  files in the source tree Jonathan Corbet <corbet@lwn.net> - 2017-02-01 21:30 +0100
          Re: [PATCH RESEND] Documentation/sphinx: prevent generation of .pyc files in the source tree Jani Nikula <jani.nikula@intel.com> - 2017-02-03 16:00 +0100

csiph-web