diff options
author | Bernhard M. Wiedemann <githubbmw@lsmod.de> | 2018-01-24 21:26:18 (GMT) |
---|---|---|
committer | Brett Cannon <brettcannon@users.noreply.github.com> | 2018-01-24 21:26:18 (GMT) |
commit | ccbe5818af20f8c12043f5c30c277a74714405e0 (patch) | |
tree | 5ca77fca24e3ec927647334dfb5e882560546039 /Doc | |
parent | 6f6eb35f9bee18f54945f09664344f2d118ed89f (diff) | |
download | cpython-ccbe5818af20f8c12043f5c30c277a74714405e0.zip cpython-ccbe5818af20f8c12043f5c30c277a74714405e0.tar.gz cpython-ccbe5818af20f8c12043f5c30c277a74714405e0.tar.bz2 |
bpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)
To support reproducible builds, the setting of of SOURCE_DATE_EPOCH triggers the py_compile module -- and by extension, compileall -- to forcibly compile with hash-based .pyc files. This eliminates the possibility of timestamp-based .pyc files which vary between builds.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/py_compile.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst index a4f06de..d720e01 100644 --- a/Doc/library/py_compile.rst +++ b/Doc/library/py_compile.rst @@ -55,7 +55,9 @@ byte-code cache files in the directory containing the source code. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` enum and controls how the generated ``.pyc`` files are invalidated at - runtime. + runtime. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, + *invalidation_mode* will be forced to + :attr:`PycInvalidationMode.CHECKED_HASH`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous @@ -71,6 +73,9 @@ byte-code cache files in the directory containing the source code. .. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. + If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, + *invalidation_mode* will be forced to + :attr:`PycInvalidationMode.CHECKED_HASH`. .. class:: PycInvalidationMode |