[issue32773] distutils should NOT preserve timestamps
Jeroen Demeyer
report at bugs.python.org
Mon Feb 5 11:01:16 EST 2018
New submission from Jeroen Demeyer <jdemeyer at cage.ugent.be>:
When a Python project is installed, distutils copies the files from the build to install directory using copy_file(). In this copy operation, timestamps are preserved. In other words, the timestamp of the installed file equals the timestamp of the source file.
By contrast, autotools does not preserve timestamps: the timestamp of the installed files equals the time of installation. This makes more sense because of dependency checking: if you reinstall a package, you typically want to rebuild everything depending on that package.
This issue is mostly relevant for installing .h files: most build systems (including distutils itself) provide a way to recompile C/C++ source files if they depend on a changed header file. But that only works if the timestamp of the header is updated when it is installed.
Note that ./command/build_py.py contains a comment
# XXX copy_file by default preserves atime and mtime. IMHO this is
# the right thing to do, but perhaps it should be an option -- in
# particular, a site administrator might want installed files to
# reflect the time of installation rather than the last
# modification time before the installed release.
but without justification.
----------
components: Distutils
messages: 311673
nosy: dstufft, eric.araujo, erik.bray, jdemeyer
priority: normal
severity: normal
status: open
title: distutils should NOT preserve timestamps
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32773>
_______________________________________
More information about the Python-bugs-list
mailing list