python: fix slow startup time

Closes #315
This commit is contained in:
Dylan Araps 2021-08-10 16:00:58 +00:00
parent a95ba8739b
commit 42f4937f70
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

View File

@ -1,5 +1,14 @@
#!/bin/sh -e
# Without this environment variable being set to some arbitrary value,
# python's module loader uses timestamps for cache invalidation. Something
# goes wrong here and all pyc files are seen as stale.
#
# By setting this value, python uses checksums for cache invalidation which
# (on my machine) drops startup time from 3 seconds to 0.060s. Further
# investigation is needed.
export SOURCE_DATE_EPOCH=1628593994
# Remove util-linux dependency among other things.
cat >> Modules/Setup <<EOF
*disabled*