NixOS / NixOS/nixpkgs

Unreproducible Package: bcachefs-tools

Open
#458,071 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0.kind: enhancement 2.status: stale 6.topic: reproducible builds
Dominant language
Nix
Stars
26.2k
Forks
20.1k
PR merge metrics
PR metrics pending

Description

Nixpkgs Revision

2fb006b87f04

Introduction

Building bcachefs-tools multiple times does not yield bit-by-bit identical
results, complicating the detection of Continuous Integration (CI) breaches. For
more information on this issue, visit reproducible-builds.org.

Fixing bit-by-bit reproducibility also has additional advantages, such as
avoiding hard-to-reproduce bugs, making content-addressed storage more effective
and reducing rebuilds in such systems.

Steps to reproduce
1. Build the package

This step will build the package. Specific arguments are passed to the command
to keep the build artifacts so we can compare them in case of differences.

Execute the following command:

nix-build '<nixpkgs>' -A bcachefs-tools && nix-build '<nixpkgs>' -A bcachefs-tools --check --keep-failed

Or using the new command line style:

nix build nixpkgs#bcachefs-tools && nix build nixpkgs#bcachefs-tools --rebuild --keep-failed
2. Compare the build artifacts

If the previous command completes successfully, no differences were found and
there's nothing to do, builds are reproducible.
If it terminates with the error message error: derivation '<X>' may not be deterministic: output '<Y>' differs from '<Z>', use diffoscope to investigate
the discrepancies between the two build outputs. You may need to add the
--exclude-directory-metadata recursive option to ignore files and directories
metadata (e.g. timestamp) differences.

nix run nixpkgs#diffoscopeMinimal -- --exclude-directory-metadata recursive <Y> <Z>
3. Examine the build log

To examine the build log, use:

nix-store --read-log $(nix-instantiate '<nixpkgs>' -A bcachefs-tools)

Or with the new command line style:

nix log $(nix path-info --derivation nixpkgs#bcachefs-tools)
Diffoscope log
--- /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11
+++ /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11.check/
│   --- /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11/bin
├── +++ /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11.check/bin
│ │   --- /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11/bin/bcachefs
│ ├── +++ /nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11.check/bin/bcachefs
│ │ ├── readelf --wide --dynamic {}
│ │ │ @@ -10,15 +10,15 @@
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libzstd.so.1]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libudev.so.1]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libkeyutils.so.1]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libaio.so.1]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
│ │ │   0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
│ │ │ + 0x000000000000001d (RUNPATH)            Library runpath: [/nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11/lib:/nix/store/g21s2hd086gcbg3kmpdkhllrsg6f136a-liburcu-0.15.3/lib:/nix/store/rdj3lfinsxmfzyjgnmbgnir188jkg32b-keyutils-1.6.3-lib/lib:/nix/store/vpjl3qrh47xmm79wbdl5ixas71wv5x3f-systemd-minimal-libs-258/lib:/nix/store/askfb782m1yvq898cyra7i5vq2v406rk-libaio-0.3.113/lib:/nix/store/ig6a9qcxa2rxr0xrbgiclk8rsv4bnvhz-lz4-1.10.0-lib/lib:/nix/store/i74fk40miw9py84pqilsrr2awwrd091k-libsodium-1.0.20/lib:/nix/store/2ygdmv2n5z3xz29j9bb6982adwq2vq5p-util-linux-minimal-2.41.2-lib/lib:/nix/store/mmfrs9gzbhrfgv12ff68a056yv942s21-zstd-1.5.7/lib:/nix/store/z55x0q74zldi64iwamqf8wgrm2iza5rk-zlib-1.3.1/lib:/nix/store/daamdpmaz2vjvna55ccrc30qw3qb8h6d-glibc-2.40-66/lib:/nix/store/z7a34j3xnp66rpddayyxrxwsahxccbip-gcc-14.3.0-lib/lib]
│ │ │ - 0x000000000000001d (RUNPATH)            Library runpath: [/nix/store/g21s2hd086gcbg3kmpdkhllrsg6f136a-liburcu-0.15.3/lib:/nix/store/rdj3lfinsxmfzyjgnmbgnir188jkg32b-keyutils-1.6.3-lib/lib:/nix/store/vpjl3qrh47xmm79wbdl5ixas71wv5x3f-systemd-minimal-libs-258/lib:/nix/store/askfb782m1yvq898cyra7i5vq2v406rk-libaio-0.3.113/lib:/nix/store/ig6a9qcxa2rxr0xrbgiclk8rsv4bnvhz-lz4-1.10.0-lib/lib:/nix/store/i74fk40miw9py84pqilsrr2awwrd091k-libsodium-1.0.20/lib:/nix/store/2ygdmv2n5z3xz29j9bb6982adwq2vq5p-util-linux-minimal-2.41.2-lib/lib:/nix/store/mmfrs9gzbhrfgv12ff68a056yv942s21-zstd-1.5.7/lib:/nix/store/z55x0q74zldi64iwamqf8wgrm2iza5rk-zlib-1.3.1/lib:/nix/store/daamdpmaz2vjvna55ccrc30qw3qb8h6d-glibc-2.40-66/lib:/nix/store/z7a34j3xnp66rpddayyxrxwsahxccbip-gcc-14.3.0-lib/lib]
│ │ │   0x000000000000000c (INIT)               0x29000
│ │ │   0x000000000000000d (FINI)               0x2d16e8
│ │ │   0x0000000000000019 (INIT_ARRAY)         0x399350
│ │ │   0x000000000000001b (INIT_ARRAYSZ)       80 (bytes)
│ │ │   0x000000000000001a (FINI_ARRAY)         0x3993a0
│ │ │   0x000000000000001c (FINI_ARRAYSZ)       32 (bytes)
│ │ │   0x0000000000000004 (HASH)               0x3a8
│ │ ├── strings --all --bytes=8 {}
│ │ │ @@ -262,16 +262,15 @@
│ │ │  GLIBC_2.34
│ │ │  GLIBC_2.9
│ │ │  GLIBC_2.2.5
│ │ │  BLKID_2.21
│ │ │  BLKID_2.17
│ │ │  BLKID_1.0
│ │ │  BLKID_2.15
│ │ │ +/nix/store/v432wy1mvhlys52h5pk36892d7hwagy6-bcachefs-tools-1.31.11/lib:/nix/store/g21s2hd086gcbg3kmpdkhllrsg6f136a-liburcu-0.15.3/lib:/nix/store/rdj3lfinsxmfzyjgnmbgnir188jkg32b-keyutils-1.6.3-lib/lib:/nix/store/vpjl3qrh47xmm79wbdl5ixas71wv5x3f-systemd-minimal-libs-258/lib:/nix/store/askfb782m1yvq898cyra7i5vq2v406rk-libaio-0.3.113/lib:/nix/store/ig6a9qcxa2rxr0xrbgiclk8rsv4bnvhz-lz4-1.10.0-lib/lib:/nix/store/i74fk40miw9py84pqilsrr2awwrd091k-libsodium-1.0.20/lib:/nix/store/2ygdmv2n5z3xz29j9bb6982adwq2vq5p-util-linux-minimal-2.41.2-lib/lib:/nix/store/mmfrs9gzbhrfgv12ff68a056yv942s21-zstd-1.5.7/lib:/nix/store/z55x0q74zldi64iwamqf8wgrm2iza5rk-zlib-1.3.1/lib:/nix/store/daamdpmaz2vjvna55ccrc30qw3qb8h6d-glibc-2.40-66/lib:/nix/store/z7a34j3xnp66rpddayyxrxwsahxccbip-gcc-14.3.0-lib/lib
│ │ │ -/nix/store/g21s2hd086gcbg3kmpdkhllrsg6f136a-liburcu-0.15.3/lib:/nix/store/rdj3lfinsxmfzyjgnmbgnir188jkg32b-keyutils-1.6.3-lib/lib:/nix/store/vpjl3qrh47xmm79wbdl5ixas71wv5x3f-systemd-minimal-libs-258/lib:/nix/store/askfb782m1yvq898cyra7i5vq2v406rk-libaio-0.3.113/lib:/nix/store/ig6a9qcxa2rxr0xrbgiclk8rsv4bnvhz-lz4-1.10.0-lib/lib:/nix/store/i74fk40miw9py84pqilsrr2awwrd091k-libsodium-1.0.20/lib:/nix/store/2ygdmv2n5z3xz29j9bb6982adwq2vq5p-util-linux-minimal-2.41.2-lib/lib:/nix/store/mmfrs9gzbhrfgv12ff68a056yv942s21-zstd-1.5.7/lib:/nix/store/z55x0q74zldi64iwamqf8wgrm2iza5rk-zlib-1.3.1/lib:/nix/store/daamdpmaz2vjvna55ccrc30qw3qb8h6d-glibc-2.40-66/lib:/nix/store/z7a34j3xnp66rpddayyxrxwsahxccbip-gcc-14.3.0-lib/lib
│ │ │ -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
│ │ │  posix_spawn_file_actions_addchdir
│ │ │  UAWAVAUATSH
│ │ │  H[A\A]A^A_]
│ │ │  UAWAVAUATSH
│ │ │  H[A\A]A^A_]
│ │ │  AWAVAUATSH
│ │ │  [A\A]A^A_]
│ │ ├── readelf --wide --decompress --hex-dump=.dynstr {}
│ │ │ @@ -323,60 +323,60 @@
│ │ │    0x000045a8 332e3200 474c4942 435f322e 332e3400 3.2.GLIBC_2.3.4.
│ │ │    0x000045b8 474c4942 435f322e 31370047 4c494243 GLIBC_2.17.GLIBC
│ │ │    0x000045c8 5f322e31 3600474c 4942435f 322e3334 _2.16.GLIBC_2.34
│ │ │    0x000045d8 00474c49 42435f32 2e390047 4c494243 .GLIBC_2.9.GLIBC
│ │ │    0x000045e8 5f322e32 2e350042 4c4b4944 5f322e32 _2.2.5.BLKID_2.2
│ │ │    0x000045f8 3100424c 4b49445f 322e3137 00424c4b 1.BLKID_2.17.BLK
│ │ │    0x00004608 49445f31 2e300042 4c4b4944 5f322e31 ID_1.0.BLKID_2.1
│ │ │ +  0x00004618 35002f6e 69782f73 746f7265 2f763433 5./nix/store/v43
│ │ │ +  0x00004628 32777931 6d76686c 79733532 6835706b 2wy1mvhlys52h5pk
│ │ │ +  0x00004638 33363839 32643768 77616779 362d6263 36892d7hwagy6-bc
│ │ │ +  0x00004648 61636865 66732d74 6f6f6c73 2d312e33 achefs-tools-1.3
│ │ │ +  0x00004658 312e3131 2f6c6962 3a2f6e69 782f7374 1.11/lib:/nix/st
│ │ │ +  0x00004668 6f72652f 67323173 32686430 38366763 ore/g21s2hd086gc
│ │ │ +  0x00004678 6267336b 6d70646b 686c6c72 73673666 bg3kmpdkhllrsg6f
│ │ │ +  0x00004688 31333661 2d6c6962 75726375 2d302e31 136a-liburcu-0.1
│ │ │ +  0x00004698 352e332f 6c69623a 2f6e6978 2f73746f 5.3/lib:/nix/sto
│ │ │ +  0x000046a8 72652f72 646a336c 66696e73 786d667a re/rdj3lfinsxmfz
│ │ │ +  0x000046b8 796a676e 6d62676e 69723138 386a6b67 yjgnmbgnir188jkg
│ │ │ +  0x000046c8 3332622d 6b657975 74696c73 2d312e36 32b-keyutils-1.6
│ │ │ +  0x000046d8 2e332d6c 69622f6c 69623a2f 6e69782f .3-lib/lib:/nix/
│ │ │ +  0x000046e8 73746f72 652f7670 6a6c3371 72683437 store/vpjl3qrh47
│ │ │ +  0x000046f8 786d6d37 39776264 6c356978 61733731 xmm79wbdl5ixas71
│ │ │ +  0x00004708 77763578 33662d73 79737465 6d642d6d wv5x3f-systemd-m
│ │ │ +  0x00004718 696e696d 616c2d6c 6962732d 3235382f inimal-libs-258/
│ │ │ +  0x00004728 6c69623a 2f6e6978 2f73746f 72652f61 lib:/nix/store/a
│ │ │ +  0x00004738 736b6662 3738326d 31797671 38393863 skfb782m1yvq898c
│ │ │ +  0x00004748 79726137 69357671 32763430 36726b2d yra7i5vq2v406rk-
│ │ │ +  0x00004758 6c696261 696f2d30 2e332e31 31332f6c libaio-0.3.113/l
│ │ │ +  0x00004768 69623a2f 6e69782f 73746f72 652f6967 ib:/nix/store/ig
│ │ │ +  0x00004778 36613971 63786132 72787230 78726267 6a9qcxa2rxr0xrbg
│ │ │ +  0x00004788 69636c6b 38727376 34626e76 687a2d6c iclk8rsv4bnvhz-l
│ │ │ +  0x00004798 7a342d31 2e31302e 302d6c69 622f6c69 z4-1.10.0-lib/li
│ │ │ +  0x000047a8 623a2f6e 69782f73 746f7265 2f693734 b:/nix/store/i74
│ │ │ +  0x000047b8 666b3430 6d697739 70793834 7071696c fk40miw9py84pqil
│ │ │ +  0x000047c8 73727232 61777772 64303931 6b2d6c69 srr2awwrd091k-li
│ │ │ +  0x000047d8 62736f64 69756d2d 312e302e 32302f6c bsodium-1.0.20/l
│ │ │ +  0x000047e8 69623a2f 6e69782f 73746f72 652f3279 ib:/nix/store/2y
│ │ │ +  0x000047f8 67646d76 326e357a 33787a32 396a3962 gdmv2n5z3xz29j9b
│ │ │ +  0x00004808 62363938 32616477 71327671 35702d75 b6982adwq2vq5p-u
│ │ │ +  0x00004818 74696c2d 6c696e75 782d6d69 6e696d61 til-linux-minima
│ │ │ +  0x00004828 6c2d322e 34312e32 2d6c6962 2f6c6962 l-2.41.2-lib/lib
│ │ │ +  0x00004838 3a2f6e69 782f7374 6f72652f 6d6d6672 :/nix/store/mmfr
│ │ │ +  0x00004848 7339677a 62687266 67763132 66663638 s9gzbhrfgv12ff68
│ │ │ +  0x00004858 61303536 79763934 32733231 2d7a7374 a056yv942s21-zst
│ │ │ +  0x00004868 642d312e 352e372f 6c69623a 2f6e6978 d-1.5.7/lib:/nix
│ │ │ +  0x00004878 2f73746f 72652f7a 35357830 7137347a /store/z55x0q74z
│ │ │ +  0x00004888 6c646936 34697761 6d716638 7767726d ldi64iwamqf8wgrm
│ │ │ +  0x00004898 32697a61 35726b2d 7a6c6962 2d312e33 2iza5rk-zlib-1.3
│ │ │ +  0x000048a8 2e312f6c 69623a2f 6e69782f 73746f72 .1/lib:/nix/stor
│ │ │ +  0x000048b8 652f6461 616d6470 6d617a32 766a766e e/daamdpmaz2vjvn
│ │ │ +  0x000048c8 61353563 63726333 30717733 71623868 a55ccrc30qw3qb8h
│ │ │ +  0x000048d8 36642d67 6c696263 2d322e34 302d3636 6d-glibc-2.40-66
│ │ │ +  0x000048e8 2f6c6962 3a2f6e69 782f7374 6f72652f /lib:/nix/store/
│ │ │ +  0x000048f8 7a376133 346a3378 6e703636 72706464 z7a34j3xnp66rpdd
│ │ │ +  0x00004908 61797978 72787773 61687863 63626970 ayyxrxwsahxccbip
│ │ │ +  0x00004918 2d676363 2d31342e 332e302d 6c69622f -gcc-14.3.0-lib/
│ │ │ +  0x00004928 6c696200 706f7369 785f7370 61776e5f lib.posix_spawn_
│ │ │ -  0x00004618 35002f6e 69782f73 746f7265 2f673231 5./nix/store/g21
│ │ │ -  0x00004628 73326864 30383667 63626733 6b6d7064 s2hd086gcbg3kmpd
│ │ │ -  0x00004638 6b686c6c 72736736 66313336 612d6c69 khllrsg6f136a-li
│ │ │ -  0x00004648 62757263 752d302e 31352e33 2f6c6962 burcu-0.15.3/lib
│ │ │ -  0x00004658 3a2f6e69 782f7374 6f72652f 72646a33 :/nix/store/rdj3
│ │ │ -  0x00004668 6c66696e 73786d66 7a796a67 6e6d6267 lfinsxmfzyjgnmbg
│ │ │ -  0x00004678 6e697231 38386a6b 67333262 2d6b6579 nir188jkg32b-key
│ │ │ -  0x00004688 7574696c 732d312e 362e332d 6c69622f utils-1.6.3-lib/
│ │ │ -  0x00004698 6c69623a 2f6e6978 2f73746f 72652f76 lib:/nix/store/v
│ │ │ -  0x000046a8 706a6c33 71726834 37786d6d 37397762 pjl3qrh47xmm79wb
│ │ │ -  0x000046b8 646c3569 78617337 31777635 7833662d dl5ixas71wv5x3f-
│ │ │ -  0x000046c8 73797374 656d642d 6d696e69 6d616c2d systemd-minimal-
│ │ │ -  0x000046d8 6c696273 2d323538 2f6c6962 3a2f6e69 libs-258/lib:/ni
│ │ │ -  0x000046e8 782f7374 6f72652f 61736b66 62373832 x/store/askfb782
│ │ │ -  0x000046f8 6d317976 71383938 63797261 37693576 m1yvq898cyra7i5v
│ │ │ -  0x00004708 71327634 3036726b 2d6c6962 61696f2d q2v406rk-libaio-
│ │ │ -  0x00004718 302e332e 3131332f 6c69623a 2f6e6978 0.3.113/lib:/nix
│ │ │ -  0x00004728 2f73746f 72652f69 67366139 71637861 /store/ig6a9qcxa
│ │ │ -  0x00004738 32727872 30787262 6769636c 6b387273 2rxr0xrbgiclk8rs
│ │ │ -  0x00004748 7634626e 76687a2d 6c7a342d 312e3130 v4bnvhz-lz4-1.10
│ │ │ -  0x00004758 2e302d6c 69622f6c 69623a2f 6e69782f .0-lib/lib:/nix/
│ │ │ -  0x00004768 73746f72 652f6937 34666b34 306d6977 store/i74fk40miw
│ │ │ -  0x00004778 39707938 34707169 6c737272 32617777 9py84pqilsrr2aww
│ │ │ -  0x00004788 72643039 316b2d6c 6962736f 6469756d rd091k-libsodium
│ │ │ -  0x00004798 2d312e30 2e32302f 6c69623a 2f6e6978 -1.0.20/lib:/nix
│ │ │ -  0x000047a8 2f73746f 72652f32 7967646d 76326e35 /store/2ygdmv2n5
│ │ │ -  0x000047b8 7a33787a 32396a39 62623639 38326164 z3xz29j9bb6982ad
│ │ │ -  0x000047c8 77713276 7135702d 7574696c 2d6c696e wq2vq5p-util-lin
│ │ │ -  0x000047d8 75782d6d 696e696d 616c2d32 2e34312e ux-minimal-2.41.
│ │ │ -  0x000047e8 322d6c69 622f6c69 623a2f6e 69782f73 2-lib/lib:/nix/s
│ │ │ -  0x000047f8 746f7265 2f6d6d66 72733967 7a626872 tore/mmfrs9gzbhr
│ │ │ -  0x00004808 66677631 32666636 38613035 36797639 fgv12ff68a056yv9
│ │ │ -  0x00004818 34327332 312d7a73 74642d31 2e352e37 42s21-zstd-1.5.7
│ │ │ -  0x00004828 2f6c6962 3a2f6e69 782f7374 6f72652f /lib:/nix/store/
│ │ │ -  0x00004838 7a353578 30713734 7a6c6469 36346977 z55x0q74zldi64iw
│ │ │ -  0x00004848 616d7166 38776772 6d32697a 6135726b amqf8wgrm2iza5rk
│ │ │ -  0x00004858 2d7a6c69 622d312e 332e312f 6c69623a -zlib-1.3.1/lib:
│ │ │ -  0x00004868 2f6e6978 2f73746f 72652f64 61616d64 /nix/store/daamd
│ │ │ -  0x00004878 706d617a 32766a76 6e613535 63637263 pmaz2vjvna55ccrc
│ │ │ -  0x00004888 33307177 33716238 6836642d 676c6962 30qw3qb8h6d-glib
│ │ │ -  0x00004898 632d322e 34302d36 362f6c69 623a2f6e c-2.40-66/lib:/n
│ │ │ -  0x000048a8 69782f73 746f7265 2f7a3761 33346a33 ix/store/z7a34j3
│ │ │ -  0x000048b8 786e7036 36727064 64617979 78727877 xnp66rpddayyxrxw
│ │ │ -  0x000048c8 73616878 63636269 702d6763 632d3134 sahxccbip-gcc-14
│ │ │ -  0x000048d8 2e332e30 2d6c6962 2f6c6962 00585858 .3.0-lib/lib.XXX
│ │ │ -  0x000048e8 58585858 58585858 58585858 58585858 XXXXXXXXXXXXXXXX
│ │ │ -  0x000048f8 58585858 58585858 58585858 58585858 XXXXXXXXXXXXXXXX
│ │ │ -  0x00004908 58585858 58585858 58585858 58585858 XXXXXXXXXXXXXXXX
│ │ │ -  0x00004918 58585858 58585858 58585858 58585858 XXXXXXXXXXXXXXXX
│ │ │ -  0x00004928 58585800 706f7369 785f7370 61776e5f XXX.posix_spawn_
│ │ │    0x00004938 66696c65 5f616374 696f6e73 5f616464 file_actions_add
│ │ │    0x00004948 63686469 7200                       chdir.
Notify maintainers

@davidak @JohnRTitor


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs
Is this issue important to you?

Add a 👍 reaction to issues you find important.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the bcachefs-tools build with the provided nix-build or nix build commands, then inspect the differing outputs with diffoscope and read the derivation log. Trace the package's build configuration from the Nix package definition; done means repeated builds produce identical artifacts without the reported runpath difference.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.