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

Archive checksums change on every commit, even if the files inside are not changed #11823

Closed
acuteenvy opened this issue Dec 23, 2023 · 0 comments · Fixed by #11825
Closed

Archive checksums change on every commit, even if the files inside are not changed #11823

acuteenvy opened this issue Dec 23, 2023 · 0 comments · Fixed by #11825
Labels
tooling Helper tools, scripts and automated processes.

Comments

@acuteenvy
Copy link
Member

acuteenvy commented Dec 23, 2023

The checksum file was added in #9669 to enable clients to download archives only if they have been changed. However, that is not possible as of now, because zip archives store the modification time of each file. Since Git does not record these timestamps, mtime is set to the current date and time on checkout. Different metadata means different hashes, and so the client downloads the exact same archive once again.

Knowing the checksums, clients can only know if there has been a commit since the last cache update. Even if the commit in question changes the README, for example.

Here is an example. The only change in that commit was the deletion of id_ed25519_tldr_asset_upload.enc, yet all the hashes have changed.


I tried to create a zip without modification times, but I don't think that's possible.

  • zip has no option to change that.
  • 7z does have it (7z a -mtm=off), but using it on a zip archive produces an error:
System ERROR:
E_INVALIDARG

The best way to fix this would be to not build archives when the files have not been changed , but I have no idea where to even begin. I tried to do that (#11825)

@acuteenvy acuteenvy added the tooling Helper tools, scripts and automated processes. label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Helper tools, scripts and automated processes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant