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
checksums for source tarballs downloaded from github.com/.../.../archive can change over time #5151
Comments
|
related discussion in Homebrew: Homebrew/homebrew-core#18044 |
|
Interesting quote by someone at GitHub (from Homebrew/homebrew-core#18044 (comment)) and (from Homebrew/homebrew-core#18044 (comment)) So short-term, we can figure out which checksums we need to fix, and then figure out a better way of dealing with this. |
|
Idea by @wpoely86: we should also support |
Note that this doesn't work. But really why do this? If you're already going to use |
|
When fixing checksums, perhaps leave the old ones in place as well. Otherwise all users who already have the old files in their sources folder will be hit. Here I am assuming that the sha256 of a file just has to match one of the checksums in the checksums list. |
|
@schiotz You mean, as a comment? EasyBuild currently doesn't support specifying multiple alternatives for checksums (since it doesn't make much sense in general). |
|
@boegel No, I had misunderstood how EB does it. The checksums is a list, and I just thought that all source files needed their checksum somewhere on that list, but that extra checksums would be ignores. |
|
@boegel Follow-up to my previous comment: You are going to be hit by some people downloading the new tarballs, some people having the old ones cached. If EB cannot support alternate checksums, then maybe it should react to a wrong checksum by attempting a new download and checking again. That may however be a non-trivial change, if the download and the checksum check are well-separated in the code. It might be easier to change the checksum code, so it does not assume a specific order of the checksums but just checks that the checksums of source files are on the list. I cannot see any risk in this, since the space of sha256 checksum is beyond astronomical. There could be a minor performance issue if there are packages with hundreds of source files, but casting the checksum list to a set should fix that. |
|
I've opened a PR to fix the broken checksums that I could find in #5162. @schiotz I'm not sure if keeping multiple checksums around for a single source file is a good idea in the long run... Also, it makes it significantly more difficult to trust contributors and make sure they don't (by accident or willingly) add checksum alternatives which validate source tarballs that are somehow malicious (see for example https://mail.python.org/pipermail/security-announce/2017-September/000000.html). We should just bite the bullet and replace the checksums, and force people to re-download the sources; the new |
|
2 comments on this one (interesting thread btw):
|
|
hm, some more info on this case! |
|
closing for now, doesn't seem to be an issue anymore for the time being... |
Unfortunately, checksums for tarballs in the github archive are not stable. It seems that the checksum for this tarball has changed. See also eg. easybuilders/easybuild-easyconfigs#5151
It seems that github again delivers different archives. Therefor the checksums changed. It is maybe required to download the files from github.com/.../release/... As reference I found many reported problems: spack/spack#5411 easybuilders/easybuild-easyconfigs#5151 libgit2/libgit2#4343 As the archives are generated on the fly, they can change at any time. PR: 255423 Reported by: lysfjord.daniel@smokepit.net, pkg-fallout
|
Re-opening this, since the problem has re-emerged, see https://github.blog/changelog/2023-01-30-git-archive-checksums-may-change/ We should probably look into a different way of determining checksums, based on the unpacked sources, like Nix does - see https://nixos.wiki/wiki/Nix_Hash |
|
Related discussion: https://github.com/orgs/community/discussions/45830 |
First reported by @schiotz at #4871 (comment), several other projects have been hit by this as well:
Some more details in libgit2/libgit2#4343 (comment)
Long story short: we should try to avoid downloading from
github.com/.../.../archive(and try to usegithub.com/.../.../releases(or another located where 'packaged' tarballs are available) instead, if at all possible.If not, the alternatives I see are:
git cloneon the tagged version and creating the tarball ourselves (directly usingtar), which should always give the same tarball?github.com/.../.../archiveThe text was updated successfully, but these errors were encountered: