python3{5,6}: Reintroduce bytecode determinism #59796
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Originally introduced in #22585, patches to lock down CPython bytecode mtime timestamps were lost in #53123 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.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Due to the scope of this change, I've only tested it on my NUR Python packages / applications, but tests passed and the
nix-build --check
came up clean on python3-3.6.8, python3.6-setuptools-40.8.0, python3.6-dnspython-1.16.0, python3.6-namedlist-1.7, python3.6-certifi-2018.11.29, python3.6-six-1.12.0, python3.6-webencodings-0.5.1, python3.6-html5lib-1.0.1, python3.6-SQLAlchemy-1.2.14, python3.6-Yapsy-1.12.0, python3.6-singledispatch-3.4.0.3, python3.6-backports_abc-0.5, python3.6-tornado-4.5.3, python3.6-chardet-3.0.4, and python3.6-wpull-2.0.3.It's the same patch as before; I'm not sure how much more testing it needs. Applied to staging because I think that's where large rebuild PRs go?