-
Notifications
You must be signed in to change notification settings - Fork 746
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
Reproducible builds #6393
Comments
Unlikely to completely solve our issues but this might explain some of the Mac vs Linux differences:
-- https://doc.rust-lang.org/rustc/codegen-options/index.html#split-debuginfo Furthering this, is that Cargo's default |
Okay, the current state of things for me locally:
Note that this uses a build profile called diff --git a/Cargo.toml b/Cargo.toml
index d8c6f487c..55fa92c53 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -248,5 +248,13 @@ lto = "fat"
codegen-units = 1
incremental = false
+[profile.reproducible]
+inherits = "release"
+lto = "fat"
+codegen-units = 1
+incremental = false
+split-debuginfo = "unpacked"
+strip = "symbols"
+
[patch.crates-io]
quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" } Edit: Here's my system information:
|
Nice! Similar on my end but with My binary diff is: 59,60c59,60
< 000003a0: 2f20 d09e 0f13 5ee7 5c1b da73 a1eb 940b / ....^.\..s....
< 000003b0: 1bf2 fd62 0400 0000 1000 0000 0100 0000 ...b............
---
> 000003a0: 62bd 4cc3 45d3 1ae7 e9b7 7b7d 8ae6 a950 b.L.E.....{}...P
> 000003b0: ad8b 4953 0400 0000 1000 0000 0100 0000 ..IS............
3278243c3278243
< 03205a20: 7020 3133 2030 343a 3130 3a32 3420 3230 p 13 04:10:24 20
---
> 03205a20: 7020 3133 2030 343a 3138 3a33 3920 3230 p 13 04:18:39 20 |
Yeah, I sense the |
The timestamp seems to be coming from OpenSSL:
|
Compiling with 59,60c59,60
< 000003a0: 62bd 4cc3 45d3 1ae7 e9b7 7b7d 8ae6 a950 b.L.E.....{}...P
< 000003b0: ad8b 4953 0400 0000 1000 0000 0100 0000 ..IS............
---
> 000003a0: b5bf 1986 dab0 e917 dc3b d710 d421 04dd .........;...!..
> 000003b0: ff2f 4d24 0400 0000 1000 0000 0100 0000 ./M$............
3278242,3278244c3278242,3278244
< 03205a10: 6275 696c 7420 6f6e 3a20 4672 6920 5365 built on: Fri Se
< 03205a20: 7020 3133 2030 343a 3138 3a33 3920 3230 p 13 04:18:39 20
< 03205a30: 3234 2055 5443 0000 454e 4749 4e45 5344 24 UTC..ENGINESD
---
> 03205a10: 6275 696c 7420 6f6e 3a20 5468 7520 4a61 built on: Thu Ja
> 03205a20: 6e20 2031 2030 303a 3030 3a30 3120 3139 n 1 00:00:01 19
> 03205a30: 3730 2055 5443 0000 454e 4749 4e45 5344 70 UTC..ENGINESD |
Ooh, that seemed to fix it completely once I accounted for unclean working directory:
|
One trick we've been using to set the
|
@metachris We are putting this on pause for now as we don't have time to test it and get it ready for v6.0.0. If you or someone from Flashbots would like to update our build scripts with the changes you need, we can review a PR. |
My WIP PR is here: The main issue is that building on different machines, including under Docker vs outside, results in different binaries. |
Description
There is some desire to build Lighthouse in a reproducible way. Making Lighthouse reproducible means that two source builds of Lighthouse at the same commit and with the same toolchain would produce bit-identical binaries.
This issue is an umbrella issue to track progress towards this goal, and document cases where Lighthouse can already be built reproducibly.
Working Reproducible Builds
make reproducible
results in identical binaries.Failing Reproducible Builds
make build-x86_64
) doesn't produce an identical binary.make reproducible
) doesn't produce an identical binary.Steps to resolve
Unclear.
I have no idea why the Cross builds are more variable than the macOS builds, when one would naively expect the Docker image to provide a stable toolchain/etc. Perhaps the default Linux linker is more random by default than the macOS linker?
The text was updated successfully, but these errors were encountered: