kpcyrd / rebuilderd

Independent verification of binary packages - reproducible builds
GNU General Public License v3.0
352 stars 23 forks source link

Test failure when building rebuilderd #138

Closed Vekhir closed 11 months ago

Vekhir commented 11 months ago

Hi, when I'm building rebuilderd 0.19.0 in a clean chroot on Arch Linux, I get the following two test failures during check():

failures:

---- decompress::tests::decompress_bzip2_compression stdout ----
thread 'decompress::tests::decompress_bzip2_compression' panicked at tools/src/decompress.rs:91:9:
assertion `left == right` failed
  left: Unknown
 right: Bzip2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- decompress::tests::detect_bzip2_compression stdout ----
thread 'decompress::tests::detect_bzip2_compression' panicked at tools/src/decompress.rs:84:9:
assertion `left == right` failed
  left: Unknown
 right: Bzip2

failures:
    decompress::tests::decompress_bzip2_compression
    decompress::tests::detect_bzip2_compression

test result: FAILED. 32 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `-p rebuildctl --bin rebuildctl`

This seems rather odd to me, as the tests are - from my limited understanding - correct and should pass. The issue is clearly in detect_compression (source), so either tree_magic_mini somehow doesn't recognize the magic bytes or the mapping from mime to CompressedWith fails.

This quick test

touch hello.txt
bzip2 hello.txt
mv hello.txt.bz2 hello
xdg-mime query filetype hello

prints out application/x-bzip2 for me. Maybe it's related.

Are you able to reproduce the issue? It is reliably reproducible on my side.

System information

OS: Arch Linux Kernel: Linux 6.5.6-arch2-1 Rebuilderd: 0.19.0-2 Rust: 1:1.73.0-1 tree_magic_mini: v3.0.3 (via cargo) bzip2: v0.4.3 (via cargo) bzip2-sys: v0.1.11+1.0.8 (via cargo)

kpcyrd commented 11 months ago

Thanks for your report, this is a simple one: you're missing the shared-mime-info dependency :)

Vekhir commented 11 months ago

Interesting, because shared-mime-info-2.3-1 gets installed.

Vekhir commented 11 months ago

@kpcyrd I think I have the solution. shared-mime-info just got a new version a few days ago. Running my quick test above with the old version correctly yields application/x-bzip, the new version 2.3 instead returns application/x-bzip2.

This then isn't matched correctly, and leads to failure. Edit: Just confirmed that passing in the old version via -I builds fine.