-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deterministic / Reproducible Builds #8
Comments
For example:
Using cmake to build the library we see ar and ranlib execution:
This results in timestamps in the library archive: $ diff -ru libdatetime.a.3.od libdatetime.a.4.od
Interestingly, the library has a parallel autotools build system that executes ar but not ranlib:
man ar(1)
This library's CMake and autotools systems appear to be out of sync. |
Using the autotools system, we can try to remove the timestamp:
man ar(1)
That executes as:
Comparing two binaries built by autotools, we see that timestamp can be removed:
|
For CMake, we can do:
$ diff -ru libdatetime.a.4.od libdatetime.a.9.od
|
CMake source code (https://github.com/Kitware/CMake.git) contains Modules/CMakeFortranInformation.cmake:
|
The variable name is:
where, ${lang} is C, CUDA, CXX, Fortran, HIP, ISPC, OBJC, OBJCXX or Swift.
|
A very detailed explanation, with historical context, of ar and ranlib: |
Fascinating. This has been lodged as an issue with Kitware (CMake developers) but there is no obvious move on their part https://gitlab.kitware.com/cmake/cmake/-/issues/19852 As noted in this SO post, your solution above can be added to the CMake build:
I would suggest this be raised as an issue with datetime-fortran and offer a PR to make the behaviour consistent between CMake and autotools. |
|
Notes https://gitlab.kitware.com/cmake/cmake/-/issues/19852
&
|
[Updated 30/08/2023]
|
The goal is to build identical binaries from identical source code. This involves not embedding unnecessary metadata. e.g. Timestamps. Initial testing involving build infrastructure changes have demonstrated that the builds are not deterministic / reproducible.
Explanation of Deterministic / Reproducible Builds:
https://reproducible-builds.org/
https://wiki.debian.org/ReproducibleBuilds
The text was updated successfully, but these errors were encountered: