Skip to content

Allow SOURCE_DATE_EPOCH=0 again - #2756

Merged
pmatilai merged 1 commit into
rpm-software-management:masterfrom
dmnks:fix-source-date-epoch
Nov 9, 2023
Merged

Allow SOURCE_DATE_EPOCH=0 again#2756
pmatilai merged 1 commit into
rpm-software-management:masterfrom
dmnks:fix-source-date-epoch

Conversation

@dmnks

@dmnks dmnks commented Nov 8, 2023

Copy link
Copy Markdown
Member

Commit 11132fc assumed that the value of 0 is never used in practice and thus used it to indicate "disabled", however that assumption has turned out to be wrong because ostree uses precisely that value as mtime in inodes, which in turn breaks existing workflows in this space (see the associated ticket).

Fix this by reverting the above commit (except leaving source_date_epoch initialized to 0, to prevent GCC warnings as mentioned in that commit).

As to why not just initialize source_date_epoch to -1: time_t happens to be a signed integer on most platforms but POSIX doesn't specify its signed-ness.

Add some accompanying tests too.

Fixes: #2679

Commit 11132fc assumed that the value
of 0 is never used in practice and thus used it to indicate "disabled",
however that assumption has turned out to be wrong because ostree uses
precisely that value as mtime in inodes, which in turn breaks existing
workflows in this space (see the associated ticket).

Fix this by reverting the above commit (except leaving source_date_epoch
initialized to 0, to prevent GCC warnings as mentioned in that commit).

As to why not just initialize source_date_epoch to -1: time_t happens to
be a signed integer on most platforms but POSIX doesn't specify its
signed-ness.

Add some accompanying tests too.

Fixes: rpm-software-management#2679
@pmatilai
pmatilai merged commit bb1eeb4 into rpm-software-management:master Nov 9, 2023
@dmnks dmnks added the fileformat Matters concerning package (file) format label Nov 23, 2023
@dmnks dmnks added REGRESSION packaging Package building, SPEC files, etc. and removed fileformat Matters concerning package (file) format labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packaging Package building, SPEC files, etc. REGRESSION

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SOURCE_DATE_EPOCH=0 not clamping file mtime

2 participants