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

Wrong hash of debian-minimal-rootfs? #83

Open
giordano opened this issue Jan 28, 2022 · 1 comment
Open

Wrong hash of debian-minimal-rootfs? #83

giordano opened this issue Jan 28, 2022 · 1 comment

Comments

@giordano
Copy link
Member

https://github.com/staticfloat/Sandbox.jl/blob/ed87f079edb1cef60c32ad5fbfbcd38c70a1314a/Artifacts.toml#L17-L23

julia> using CodecZlib, Downloads, Tar

julia> tarball = Downloads.download("https://github.com/JuliaCI/rootfs-images/releases/download/v4.4/debian_minimal.x86_64.tar.gz");

julia> bytes2hex(open(io -> sha256(io), tarball))
"7e5f2625e6ca9a105430e0a505896184b503dfc3a7ce15916d2b8dca0391e65d"

julia> tar_gz = open(tarball);

julia> tar = GzipDecompressorStream(tar_gz);

julia> Tar.tree_hash(tar)
"97fd72e5d9f3d8902dca83ed3182c7b12a9ce446"

julia> close(tar)

julia> close(tar_gz)

julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, haswell)

The sha256 checksum is the same, but the git tree hash is different

@giordano
Copy link
Member Author

giordano commented Jan 28, 2022

Tests on macOS fail for me when downloading this tarball, but interestingly enough I get yet another tree hash:

  Downloaded artifact: debian-minimal-rootfs
 Downloading artifact: debian-minimal-rootfs
┌ Error: Tree Hash Mismatch!
│   Expected git-tree-sha1:   f2dd967ccbf4ab29781388f5848f8d17a4a4e0bc
│   Calculated git-tree-sha1: 056f475c25cf8da6bcdbbe018a57a89225f13907
  Downloaded artifact: debian-minimal-rootfs
Internet access: Error During Test at /Users/mose/.julia/dev/Sandbox/test/Sandbox.jl:297
  Got exception outside of a @test
  Unable to automatically install 'debian-minimal-rootfs' from '/Users/mose/.julia/dev/Sandbox/Artifacts.toml'

but running the script above gives me the same output as above (git tree hash = 97fd72e5d9f3d8902dca83ed3182c7b12a9ce446), which confuses me more and more.

Edit: maybe I'm confused about how the git tree hash is computed because I get a different result also for the alpine rootfs, but the fact that the download of the Debian image on macOS fails because of the hash still stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant