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
Build not reproducible #5521
Comments
|
Are there tools / tutorials to reproduce this locally? I see that there's https://reproducible-builds.org/docs/ that somewhat documents that, but I was wondering if there's an easy way for a random person interested in contributing to this (maybe me) to get up to speed and finally make sure the build is deterministic. And add a test to the CI to make sure this does not regress. |
|
Hi @lhchavez,
There's I can give you push access to my fork of https://salsa.debian.org/debian/libgit2 so you can check via CI, if you want to? |
oh i was hoping to avoid relying on CI. that's slow (well, slower vs. doing it locally) and more difficult to debug when things go wrong :( if that's the case, maybe I won't be able to help. |
|
On Thu, May 14, 2020 at 03:53:08PM -0700, Utkarsh Gupta wrote:
Whilst working on the [Reproducible Builds](https://reproducible-builds.org/) front, I came across that libgit2 doesn't build reproducibly.
Here are the CI logs: https://salsa.debian.org/debian/libgit2/-/jobs/661147
It'd be nice if we can have a fix for this? :)
Did you try building with `-DENABLE_REPRODUCIBLE_BUILDS=ON`? I've done
some work on this a few years ago, and with this option it builds
reproducible for me.
|
Curious: what's the downside of making this the default? |
|
On Fri, May 15, 2020 at 08:28:14AM -0700, Edward Thomson wrote:
> Did you try building with `-DENABLE_REPRODUCIBLE_BUILDS=ON`? I've done some work on this a few years ago, and with this option it builds reproducible for me.
Curious: what's the downside of making this the default?
We're fiddling with some internal of CMake to make it word in order to
get reproducible behaviour of both ar and ranlib which is not portable
across platforms:
```CMake
IF (ENABLE_REPRODUCIBLE_BUILDS)
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
ENDIF()
```
As this rather looks like magic to me and we'd probably open a can of
worms where we have to implement stuff for each platform, I'm not too
thrilled to make it the default.
|
|
Hi Patrick,
I did now, but unfortunately, it doesn't seem to work. I am not really good at intercepting them so can't make out much out of this^ :/ |
|
Huh, I just tried it and the resulting shared object has the same hash on both runs. Different in your build setup is that you're building the library in different paths, though, and indeed: if I use two different build directories, then the resulting hashes are different. Interestingly, this doesn't happen if building with Even though this doesn't seem to be true, either, cause I can't reproduce anymore. :/ So this is an intermittent error. One thing I've found that's different between CMake runs is the order of files because we use So I did a test and added |
|
Please give #5523 a go |
|
Thanks for your work, I just uploaded 1.0.1 to the Debian archive. Please let me know if you can make out anything from it or if there's anything I can help to make the build reproducible. |
|
🤔 I see a lot of file paths in there. If you set eg, |
|
On a side note, can we have reproducible builds enabled by default? |
|
Well, we don't have reproducible builds yet. I think it probably makes sense to enable this by default. But I'd like to see what's involved in making a truly reproducible build before we make that decision. If we turn reproducible builds on by default, and actually making them reproducible has some onerous settings that aren't good defaults, then we'll regret it. |
Ah, okay, makes sense. Let me try to enable repro builds in Debian and in case I get that working, I'll send a patch maybe :)
With this, the new log file is here: reprotest.log |
Whilst working on the Reproducible Builds front, I came across that libgit2 doesn't build reproducibly.
Here are the CI logs: https://salsa.debian.org/debian/libgit2/-/jobs/661147
It'd be nice if we can have a fix for this? :)
The text was updated successfully, but these errors were encountered: