Summary: | python: current .pyc check scheme causing .pyc files not reproducible | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | thssld |
Component: | Current packages | Assignee: | Python Gentoo Team <python> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | mgorny |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 913920 |
Description
thssld
2023-09-10 12:56:28 UTC
(In reply to thssld from comment #0) > Python defaults to embed build-time timestamp into .pyc. During loading, > python interpreter checks timestamp to decide if .pyc matches the .py file. > Since we ship with .pyc files in binpkgs, current we cannot have > reproducible python related packages. I don't get this. We ship both .py and .pyc, and we preserve timestamps, so th files always match. What's the problem? (In reply to Michał Górny from comment #1) > (In reply to thssld from comment #0) > > Python defaults to embed build-time timestamp into .pyc. During loading, > > python interpreter checks timestamp to decide if .pyc matches the .py file. > > Since we ship with .pyc files in binpkgs, current we cannot have > > reproducible python related packages. > > I don't get this. We ship both .py and .pyc, and we preserve timestamps, so > th files always match. What's the problem? The timestamp embedded in .pyc is the time of build rather than the mtime of .py file. So it differs across builds. That's not a problem. Python still correctly recognizes the .pyc file as being up-to-date. |