summaryrefslogtreecommitdiff
path: root/buildstream/data
diff options
context:
space:
mode:
authorMathieu Bridon <bochecha@daitauha.fr>2017-09-26 19:39:41 +0200
committerMathieu Bridon <bochecha@daitauha.fr>2017-09-29 13:30:05 +0200
commit4a29f7eb2c53cd3d06038d3cbb44d1ce835de647 (patch)
treebb3375debca7fd2da0af6b23ae4a2767483e697e /buildstream/data
parente8beece45b7de0ee0de4db2254a4e40b44bc8b58 (diff)
downloadbuildstream-4a29f7eb2c53cd3d06038d3cbb44d1ce835de647.tar.gz
Fix timestamps in Python bytecodefix-pyc-timestamps
When building Python modules, a bytecode `.pyc` file is generated from the source `.py` file. The former contains 4 bytes representing the timestamp of the latter at the time it was generated. Unfortunately, after building OSTree sets all the file timestamps to 0, which introduces a discrepency between the timestamp of the `.py` file and the 4 bytes stored inside the `.pyc` file. As a result, when running a Python module from a checkout, Python thinks the bytecode files are stale, which causes a dramatic performance penalty when starting an application. Fixes #94
Diffstat (limited to 'buildstream/data')
-rw-r--r--buildstream/data/projectconfig.yaml5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/data/projectconfig.yaml b/buildstream/data/projectconfig.yaml
index 6406f1609..2e47aa87b 100644
--- a/buildstream/data/projectconfig.yaml
+++ b/buildstream/data/projectconfig.yaml
@@ -120,6 +120,11 @@ variables:
strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
+ fix-pyc-timestamps: |
+
+ find "%{install-root}" -name '*.pyc' \
+ -exec dd if=/dev/zero of={} bs=1 count=4 seek=4 conv=notrunc ';'
+
# Base sandbox environment, can be overridden by plugins
environment: