-
Notifications
You must be signed in to change notification settings - Fork 79
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
Reproducable Build #171
Comments
Agreed, I have it in my notes as well as one of the high impact items of importance. |
A dockerized build environment isn't enough to get reproducible builds. A virtual machine might do the trick but it's a cumbersome and inherently fragile solution. It might be worthwhile to track down the root causes for the differences and fix them directly (in the crates we're using or in rustc). What are your thoughts on this, @jennijuju / @Stebalien? |
Yeah, I think we need to do that. We can probably compile in two different containers, then compare the target directories to figure out what went wrong. I assume you:
|
Take a look at https://github.com/CosmWasm/rust-optimizer? Especially https://github.com/CosmWasm/rust-optimizer/blob/main/optimize.sh. |
Hmm, if we're okay with aarch64 and x86-64 giving different results then we might have reproducible results already. I added a |
It is the WASM build we are primarily concerned about. Also this might be of use although I'm not sure: https://github.com/cbeuw/lotus |
@lemmih any updates on this? |
I'll open a pull request. Then we can continue the discussion on the pros and cons. |
Draft PR created: #634 |
It sounds like we aren't yet sure exactly what is not reproducible about the build, so the first step is to figure out what is causing the lack of reproducibility. The ultimate goal here is to get something that con be independently built on separate systems, including third party systems, and reliable generate a consistent CID. We know that some things are already set to use specific versions (like First step is to take the docker container in the PR and run it a few times to see if it generates a repoducible CID. If it does, we might be done. It it doesn't, we have more investigation to do. |
Why do we use the |
Ok, first round of testing: I've built is sequentially mutltiple times today, and compared those CIDs to each other.
Next is to determine whether the date matters at all (because of the
|
Where do you see that? |
In the dockerfile created for #634 we are installing the |
Ok, CIDs are consistent day to day, so the differences in the CID of the build artifacts seems mostly due to differences in the underlying OS used to build it:
So I think, based on these tests, that the existing solution should result in reproducible builds if always built on an x86 architecture. I have some minor tweaks to the image in #634, but it otherwise should resolve this issue for now. |
New PR with the changes here: #865 |
Given that the built-in actors will be a critical part of the Filecoin infrastructure, and given that everyone will have to use the same pre-built actors, we really need to consider reproducible builds.
Proposal:
Provide a Dockerfile that:
The text was updated successfully, but these errors were encountered: