Skip to content

phar: honor SOURCE_DATE_EPOCH for timestamps #6564

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

Closed
wants to merge 8 commits into from
Closed

phar: honor SOURCE_DATE_EPOCH for timestamps #6564

wants to merge 8 commits into from

Conversation

arjendekorte
Copy link
Contributor

In order to build reproducible phars, honor SOURCE_DATE_EPOCH
if set

Signed-off-by: Arjen de Korte build+github@de-korte.org

In order to build reproducible phars, honor SOURCE_DATE_EPOCH
if set

Signed-off-by: Arjen de Korte <build+github@de-korte.org>
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmb69 Does the general idea here seem reasonable?

@cmb69
Copy link
Member

cmb69 commented Jan 4, 2021

At least partially, this looks like a workaround for https://bugs.php.net/77229 and related issues. The problem is that the timestamp of phar entries should be the mtime of the file, but we're using the current time which is wrong anyway.

Signed-off-by: Arjen de Korte <build+github@de-korte.org>
Signed-off-by: Arjen de Korte <build+github@de-korte.org>
Sorry for the mess I created, rookie GitHub user here. Finally figured out how to build locally before submitting.
@arjendekorte
Copy link
Contributor Author

At least partially, this looks like a workaround for https://bugs.php.net/77229 and related issues. The problem is that the timestamp of phar entries should be the mtime of the file, but we're using the current time which is wrong anyway.

Using the mtime of the files would probably also fix the reproducible build. The thing that slightly worries me, is that the existing (wrong) timestamps have been used for as long as I can trace back and fixing this might break applications that rely on this. The change to just honor SOURCE_DATE_EPOCH would limit the exposure, as this usually is only set during packaging PHP where this is an intentional change and doesn't change the behavior if not set.

Apparently this sneaked in again in one of my commits. Fixing again.

Signed-off-by: Arjen de Korte <build+github@de-korte.org>
@arjendekorte arjendekorte requested a review from nikic January 6, 2021 08:14
@arjendekorte arjendekorte closed this by deleting the head repository Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants