Skip to contentSkip to conversation

manual: do not generate .pyc files

PATCH New Yann E. MORIN 2 participants 2 messages Dec 5, 2013 – Dec 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 manual: do not generate .pyc files

From: "Yann E. MORIN" <[email protected]>

Python saves a pre-compiled support/scripts/kconfiglib.pyc file side-to-side with the corresponding .py file.

This does not work if the Buildroot source tree is read-only (but this is not an error for Python, which keep going OK).

But this may cause issues for out-of-tree builds in case the same Buildroot source tree is shared by many builds.

Also, 'make clean' currently does not clean this file, and out-of-tree builds can remove it either, at the risk of causing issues for other out-of-tree builds running at the same time.

Just tell Python not to generate .pyc files:
- call the script via python, don't use the sha-bang
- thus, make the script non-executable, and remove the sha-bang

Cc Arnout Vandecappelle <[email protected]>
Cc Samuel Martin <[email protected]>

---
Changes v1->v2:
- fix typo in commit log (Samuel)

---
 docs/manual/manual.mk               | 2 +-
 support/scripts/gen-manual-lists.py | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
 mode change 100755 => 100644 support/scripts/gen-manual-lists.py
docs/manual/manual.mk +1 -1
index 0926566..f0bbff8 100644
@@ -1,7 +1,7 @@
 manual-update-lists: manual-check-dependencies-lists
 	$(Q)$(call MESSAGE,"Updating the manual lists...")
 	$(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(O)/docs/manual/.build \
-		$(TOPDIR)/support/scripts/gen-manual-lists.py
+		python -B $(TOPDIR)/support/scripts/gen-manual-lists.py
 
 # we can't use suitable-host-package here because that's not available in
 # the context of 'make release'
support/scripts/gen-manual-lists.py +0 -2
old mode 100755
new mode 100644
index 4546e07..4562d7e
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-##
 ## gen-manual-lists.py
 ##
 ## This script generates the following Buildroot manual appendices:
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 manual: do not generate .pyc files

Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: "Yann E. MORIN" <[email protected]> Python saves a pre-compiled support/scripts/kconfiglib.pyc file side-to-side with the corresponding .py file.

This does not work if the Buildroot source tree is read-only (but this is not an error for Python, which keep going OK).

But this may cause issues for out-of-tree builds in case the same Buildroot source tree is shared by many builds.

Also, 'make clean' currently does not clean this file, and out-of-tree builds can remove it either, at the risk of causing issues for other out-of-tree builds running at the same time.

Just tell Python not to generate .pyc files:
- call the script via python, don't use the sha-bang
- thus, make the script non-executable, and remove the sha-bang

Quoted 6 lines
Cc Arnout Vandecappelle <[email protected]>
Cc Samuel Martin <[email protected]>

---
Changes v1->v2:
- fix typo in commit log (Samuel)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard