#ReproducibleBuilds bug of the week:
We noticed our rootfs wouldn't reproduce between systems with different file systems. Diffing two rootfs tarballs led us to a diff in packed certificate bundle files.
All packages installed by the rpm-based package manager were pinned by hash, so how could these files differ? We noticed that the total file length was the same, so we assumed an ordering problem. Looking into the SPEC file of the ca-certificates package, we saw that these files were generated in a post install hook with p11-kit.
Checking the code, we noticed that p11-kit would get the certs files using readdir(). But the order in which readdir() returns files is undefined! (and likely depends on the inode numbers of the fs)
So here is our fix, sorting the input files by paths to extract a reproducible bundle output: https://github.com/p11-glue/p11-kit/pull/656
token: sort paths for reproducible extract by katexochen · Pull Request #656 · p11-glue/p11-kit
There is no defined order in which readdir will return the entries of a directory. In practice, order can depend on inode number or similar. If we run p11-kit on different files systems with simila...



