Skip to content

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Apr 9, 2024

In the initial implementation of reproducible tarballs, they were
missing directory entries, while .zip archives had them. It meant
that on extracting the tarball, on-disk directory entries got the
current timestamp.

This patch fixes this by including directory entries in the tarball,
with reproducible timestamps. It also moves sorting inside tar,
to ensure reproducible directory entry timestamps on extract
(without the need of --delay-directory-restore option, when
extracting with GNU tar. BSD tar got that right by default.)

GNU tar 1.28 (2014-07-28) introduced --sort=.

Follow-up to d52fe1b #1357
Closes #1359

In the initial implementation of reproducible tarballs, they were
missing directory entries, while .zip archives had them. It meant
that on extracting the tarball, directory entries got the current
timestamp.

This patch fixes this by including directory entries in the tarball,
with reproducible timestamps. It also moves sorting inside tar,
to ensure reproducible directory entry timestamps on extract
(without the need of `--delay-directory-restore` option, when
extracting with GNU tar. BSD tar got that right by default.)

`--sort=` option was introduced in GNU tar 1.28 (2014-07-28)

Follow-up to d52fe1b libssh2#1357
Closes #xxxx
@vszakats vszakats added the build label Apr 9, 2024
@vszakats vszakats closed this in 9dbc9e2 Apr 9, 2024
@vszakats vszakats deleted the tarballdir branch April 9, 2024 09:16
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
In the initial implementation of reproducible tarballs, they were
missing directory entries, while .zip archives had them. It meant
that on extracting the tarball, on-disk directory entries got the
current timestamp.

This patch fixes this by including directory entries in the tarball,
with reproducible timestamps. It also moves sorting inside tar,
to ensure reproducible directory entry timestamps on extract
(without the need of `--delay-directory-restore` option, when
extracting with GNU tar. BSD tar got that right by default.)

GNU tar 1.28 (2014-07-28) introduced `--sort=`.

Follow-up to d52fe1b libssh2#1357
Closes libssh2#1359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant