Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3{5,6}: Reintroduce bytecode determinism
Originally introduced in 8970a9c and 1531b5e, these patches were lost in efbe87f when the CPython version files were merged, likely due to CPython 3.7 not needing them anymore. These patches should remain in-tree until CPython 3.5 and 3.6 support is dropped completely. Found with the diffoscope ( https://diffoscope.org/ ).
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
pkgs/development/interpreters/python/cpython/3.5/force_bytecode_determinism.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- a/Lib/py_compile.py | ||
+++ b/Lib/py_compile.py | ||
@@ -139,3 +139,4 @@ | ||
source_stats = loader.path_stats(file) | ||
+ source_mtime = 1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'] | ||
bytecode = importlib._bootstrap_external._code_to_bytecode( | ||
- code, source_stats['mtime'], source_stats['size']) | ||
+ code, source_mtime, source_stats['size']) | ||
--- a/Lib/importlib/_bootstrap_external.py | ||
+++ b/Lib/importlib/_bootstrap_external.py | ||
@@ -485,5 +485,5 @@ | ||
if source_stats is not None: | ||
try: | ||
- source_mtime = int(source_stats['mtime']) | ||
+ source_mtime = 1 | ||
except KeyError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters