Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow SOURCE_DATE_EPOCH=0 again #2756

Merged

Conversation

dmnks
Copy link
Contributor

@dmnks dmnks commented Nov 8, 2023

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
1 check passed
@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