Re: Timestamp of installed files
![](https://secure.gravatar.com/avatar/7a8bcd06f8cad23d1e57ea9e65caceaf.jpg?s=120&d=mm&r=g)
On 2018-08-04 00:02, Chris Jerdonek wrote:
I'm not sure how relevant it is, but this issue was recently filed on pip's issue tracker ("Reproducible installs"): https://github.com/pypa/pip/issues/5648
This seems to be about preserving timestamps when extracting wheel files.
There is also an older (closed) pip issue that might be relevant ("Preserving timestamps on copy"): https://github.com/pypa/pip/issues/3201
This is a different issue about preserving timestamps from the source directory to the temporary build directory. So both are different issues, and I agree with both: during the source extraction and build process, you want to preserve timestamps as much as possible. But for the installation, you do NOT want to preserve timestamps.
![](https://secure.gravatar.com/avatar/d995b462a98fea412efa79d17ba3787a.jpg?s=120&d=mm&r=g)
On Sat, 4 Aug 2018 at 08:35, Jeroen Demeyer <J.Demeyer@ugent.be> wrote:
So both are different issues, and I agree with both: during the source extraction and build process, you want to preserve timestamps as much as possible. But for the installation, you do NOT want to preserve timestamps.
If this is about the distutils install command, it's worth noting that pip is moving to a situation where we'll never use the distutils/setuptools "install" command, bur rather we'll build wheels and install from wheel. The new PEP 517 installation code will use that route exclusively (there's not even a provision in PEP 517 for direct installs from source). So the behaviour of the "setup.py install" command won't affect pip installs at all in the longer term. (How long, I don't know - it depends on how soon we feel we can switch fully to PEP 517, and it's a bit premature to decide on that, as the PEP 517 code isn't even released yet!) Paul
![](https://secure.gravatar.com/avatar/9b513ee7cc400c9b7374f4697a1e69ad.jpg?s=120&d=mm&r=g)
On Sat, Aug 4, 2018 at 1:08 AM, Paul Moore <p.f.moore@gmail.com> wrote:
On Sat, 4 Aug 2018 at 08:35, Jeroen Demeyer <J.Demeyer@ugent.be> wrote:
So both are different issues, and I agree with both: during the source extraction and build process, you want to preserve timestamps as much as possible. But for the installation, you do NOT want to preserve timestamps.
If this is about the distutils install command, it's worth noting that pip is moving to a situation where we'll never use the distutils/setuptools "install" command, bur rather we'll build wheels and install from wheel. The new PEP 517 installation code will use that route exclusively (there's not even a provision in PEP 517 for direct installs from source). So the behaviour of the "setup.py install" command won't affect pip installs at all in the longer term. (How long, I don't know - it depends on how soon we feel we can switch fully to PEP 517, and it's a bit premature to decide on that, as the PEP 517 code isn't even released yet!)
How is the new pip code path slated to behave with respect to Jeroen's question / preference? Is it already specified or does it fall out of the behavior of existing components, or is it still TBD? --Chris
![](https://secure.gravatar.com/avatar/d995b462a98fea412efa79d17ba3787a.jpg?s=120&d=mm&r=g)
On Sat, 4 Aug 2018 at 09:18, Chris Jerdonek <chris.jerdonek@gmail.com> wrote:
On Sat, Aug 4, 2018 at 1:08 AM, Paul Moore <p.f.moore@gmail.com> wrote:
On Sat, 4 Aug 2018 at 08:35, Jeroen Demeyer <J.Demeyer@ugent.be> wrote:
So both are different issues, and I agree with both: during the source extraction and build process, you want to preserve timestamps as much as possible. But for the installation, you do NOT want to preserve timestamps.
If this is about the distutils install command, it's worth noting that pip is moving to a situation where we'll never use the distutils/setuptools "install" command, bur rather we'll build wheels and install from wheel. The new PEP 517 installation code will use that route exclusively (there's not even a provision in PEP 517 for direct installs from source). So the behaviour of the "setup.py install" command won't affect pip installs at all in the longer term. (How long, I don't know - it depends on how soon we feel we can switch fully to PEP 517, and it's a bit premature to decide on that, as the PEP 517 code isn't even released yet!)
How is the new pip code path slated to behave with respect to Jeroen's question / preference? Is it already specified or does it fall out of the behavior of existing components, or is it still TBD?
For files extracted from wheels, this is the subject of https://github.com/pypa/pip/issues/5648, as noted earlier in the thread by Jeroen (and the commenters on that issue seem to favour preserving timestamps - Jeroen seemed to say he agreed with this, but I'm not sure I see how that matches his stated requirement for installs to not preserve timestamps...). Whether timestamps are preserved by the wheel building process depends on the build system - so the question boils down to "does setup.py bdist_wheel preserve timestamps?" in the case of the setuptools backend - which is really a question for the wheel project. In the more general case, you'd have to ask the same question of flit, and any other backends you cared about. So: * wheel -> installed: Currently under discussion, with (as far as I can see) conflicting preferences. From the comments in issue 5648 it seems like pip currently alters timestamps, but the commenters there think it would be a "rather uncontroversial patch" (https://github.com/pypa/pip/issues/5648#issuecomment-408439568) to change that * source -> wheel: the backend's responsibility Personally, I have no opinion on the matter. Paul
![](https://secure.gravatar.com/avatar/90a3b7816edd170b002641ade072b52a.jpg?s=120&d=mm&r=g)
On Sat, Aug 4, 2018, at 9:34 AM, Paul Moore wrote:
Whether timestamps are preserved by the wheel building process depends on the build system - so the question boils down to "does setup.py bdist_wheel preserve timestamps?" in the case of the setuptools backend - which is really a question for the wheel project. In the more general case, you'd have to ask the same question of flit, and any other backends you cared about.
IIRC, Flit will preserve the timestamps of the files when you build a wheel, unless you use SOURCE_DATE_EPOCH to override them for a reproducible build. I think this is the norm for adding files to a zipfile from a regular filesystem. Thomas
participants (4)
-
Chris Jerdonek
-
Jeroen Demeyer
-
Paul Moore
-
Thomas Kluyver