root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.66k stars 1.27k forks source link

.pcm files not deterministic/reproducible #11429

Open StefanBruens opened 2 years ago

StefanBruens commented 2 years ago

Describe the bug

The binary data of .pcm files changes each time it is generated, although sources and actual contents are unchanged.

For a complete rationale why this is wanted, see https://reproducible-builds.org/

Or if you favor a view from the LLVM developers: https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html

Expected behavior

As long as sources (including compiler or any tools) does not change, the binary representation of .pcm files stays the same.

Setup

  1. ROOT version: 6.26.06
  2. Operating system: Linux

Additional context

This is likely an issue of upstream LLVM, similar to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877359, fixed https://reviews.llvm.org/rG2751b69dd3945ef9bd1298c16dca5b59076f8f17. As the latter is already included in LLVM 9.0, the issue is likely not fixed for pcm files. This may be fixed with LLVM 13.

dpiparo commented 8 months ago

@vgvassilev is this now fixed with llvm16?

vgvassilev commented 8 months ago

I am not sure. The issue does not mention concrete examples of what gets rebuilt while it should not.

StefanBruens commented 8 months ago

This is not about unnecessary rebuilding, but unreproducible building. I.e. take a (any) pristine source tree and build it on two different computers. The created files should be identical on both computers. (Alternatively, built it twice on the same computer, from a clean source tree).

vgvassilev commented 8 months ago

I understand now. In this case I do not think that has been an explicit requirement for ROOT. Maybe it should be, but I am not sure what needs to be done concretely here.