Skip to content
Snippets Groups Projects

storage.Directory.export_to_tar: default mtime=utils._magic_timestamp

Merged Angelos Evripiotis requested to merge aevri/mtime1 into master

Change the default value of mtime when doing export_to_tar() from '0' to _magic_timestamp. This avoids problems in other software, which assume that an mtime of '0' means the file does not exist.

There is more than one example where files with an mtime of zero are treated as non-existant by other software. e.g. ninja and Template Toolkit.

The OSTree project also express an intention to move from an mtime of 0 to an mtime of 1:

For this reason, OSTree acts as though all timestamps are set to time_t 0, so that comparisons will be considered up-to-date. Note that for a few releases, OSTree used 1 to fix warnings such as GNU Tar emitting "implausibly old time stamp" with 0; however, until we have a mechanism to transition cleanly to 1, for compatibilty OSTree is reverted to use zero again.

From the comments on export_to_tar(), the motivation for having an mtime of 0 was to have reproducible results, rather than it specifically being the value 0.

Additionally, the reproducible builds project has a page on archives; it mentions the benefits of setting all the files to have the same mtime, or clamping the mtime. It makes no mention of a motivation for the mtime to be specifically 0.

Fixes #914 (closed)

Edited by Angelos Evripiotis

Merge request reports

Pipeline #47671286 passed

Pipeline passed for 39febfda on aevri/mtime1

Test coverage 86.20% (0.00%) from 1 job

Merged by Angelos EvripiotisAngelos Evripiotis 6 years ago (Feb 15, 2019 12:25pm UTC)

Loading

Pipeline #47682800 passed

Pipeline passed for 8b34e356 on master

Test coverage 86.20% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading