FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.7] bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) by miss-islington · Pull Request #10775 · python/cpython · GitHub

/ cpython Public

[3.7] bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) - #10775

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-a6b3ec5-3.7
Nov 28, 2018
Merged

[3.7] bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)#10775
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-a6b3ec5-3.7

Conversation

miss-islington commented Nov 28, 2018
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Unconditional forcing of CHECKED_HASH invalidation was introduced in
3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides
invalidation_mode, even if it was passed as an explicit argument to
py_compile.compile() or compileall. An environment variable
should never override an explicit argument to a library function.
That change leads to multiple test failures if the SOURCE_DATE_EPOCH
environment variable is set.

This changes py_compile.compile() to only look at
SOURCE_DATE_EPOCH if no explicit invalidation_mode was specified.
I also made various relevant tests run with explicit control over the
value of SOURCE_DATE_EPOCH.

While looking at this, I noticed that zipimport does not work
with hash-based .pycs at all, though I left the fixes for
subsequent commits.
(cherry picked from commit a6b3ec5)

Co-authored-by: Elvis Pranskevichus elvis@magic.io

https://bugs.python.org/issue34022

…POCH (pythonGH-9607)

Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in
3.7.0 in bpo-29708.  The change is bad, as it unconditionally overrides
*invalidation_mode*, even if it was passed as an explicit argument to
``py_compile.compile()`` or ``compileall``.  An environment variable
should *never* override an explicit argument to a library function.
That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH``
environment variable is set.

This changes ``py_compile.compile()`` to only look at
``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified.
I also made various relevant tests run with explicit control over the
value of ``SOURCE_DATE_EPOCH``.

While looking at this, I noticed that ``zipimport`` does not work
with hash-based .pycs _at all_, though I left the fixes for
subsequent commits.
(cherry picked from commit a6b3ec5)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

Copy link
Copy Markdown
Contributor Author

@elprans and @vstinner: Status check is done, and it's a success ✅ .

miss-islington merged commit 24b51b1 into python:3.7 Nov 28, 2018
miss-islington deleted the backport-a6b3ec5-3.7 branch November 28, 2018 17:45
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL