-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 #2641
Comments
Why is |
Anyway, pigeons was looking at that, and will find his old notes about it so it can be done. Or at least some more work done towards it. |
i could help if needed pigeons, he should just PM me |
LINE is not deterministic according to the chromium project (https://www.chromium.org/developers/testing/isolated-testing/deterministic-builds), all these macro are implemented differently on each platform (windows, linux, macos) and each compiler. Example for FILE see http://blog.mindfab.net/2013/12/on-way-to-deterministic-binariy-gcc.html it is a huge topic that will need more than one person to complete: it took debian lots of time but we should be able to profit from their experience https://wiki.debian.org/ReproducibleBuilds |
Thanks @cedricwalter are you on freenode? |
@danrmiller not yet, but on which channel monero-dev? |
The link doesn't give any info, but OK. We can cross that bridge if and when we end up needing to. #monero-dev is a good channel for discussing this, yes. |
@TheCharlatan Also mentioned an interest in helping out with deterministic builds. |
The version control metadata should not be a problem, if the build is done similar to bitcoin's gitian. Gitian checks out the source tree for every build for every platform in the same way.
|
For the record, I tried compiling simplewallet.cpp twice, and I got identical object files (after stripping debug info), so it's looking like we're in a good starting position :) |
+proposal |
This issue should be moved to the meta repo as it will affect all applicable monero umbrella projects. |
Some updates: I managed to static compile a linux binary with all important dependencies linked from a modified version of bitcoin's depends system and an additional cmake toolchain file. It might be a good idea to break this into smaller pieces, since I cannot really estimate the time required to get it running on all platforms. It would be nice to get a minimal set of requirements (e.g. which platforms should be supported, what manual interaction is acceptable) in order to open a pull request for this so more people can start working on it.
|
Are you still working on this (or planning to) ? |
Still working on it. The cross compilation is a bit problematic, since the current build system expects vendored sources from external/ to be built. Not quite sure how to properly ship around this while keeping native compilation intact. This is why I will probably focus on getting the deterministic build done now on Linux, and think about the cross compilation again at a later stage. |
Getting there in steps is certainly fine. Thanks for doing this. |
I now opened #3430 to get depends on monero. This should at least take care of deterministically getting dependencies for all platforms. |
Any status updates on the progress? Need any support with something? |
The pr is still open, I will continue work on it once it is merged. If you want to move ahead, checkout my depends branch and try to setup a gitian descriptor, probably for a 64bit linux to start out, like here in bitcoin. |
actually, monero can be (re-)build in a deterministic way, if the same build path is used. see https://tests.reproducible-builds.org/monero (the sun icons on the left...) :-) |
@h01ger yes, it can and I have achieved reproducibility in the past on linux amd64. The hard thing is to make an easy as possible recipe for all architectures and target hosts (including mac and windows). |
right. I guess it would be very nice to have some generic way/toolchain for that, maybe even a tool. and documentation... |
#3430 has been merged now. This adds a generic toolchain for some targets; mac, windows, linux 64 bit and arm 32 bit. Looking at getting a gitian build script for it going now. |
Now that the builds are more or less stable https://travis-ci.org/TheCharlatan/monero/builds/433563684 (hooray!) , I'll post a list of issues that still remain and need to be dealt with. Support/input on any of the items is welcome.
Optional, once the above is taken care of:
|
Progress on the gitian build script (gitian-build.py) can be tracked here: https://github.com/TheCharlatan/monero/tree/gitian/contrib/gitian . if you want to participate, checkout that branch and submit improvements there. |
I now opened #4526 to add a gitian build script to monero. |
The gitian builds are running stable now and seem to produced reproducible outputs. I also opened monero-project/unbound#12 and #4929 to ensure that binaries compiled by gitian are portable across linux distributions. |
Now that docker support has been merged, building has become quite easy. Just run a docker daemon on ubuntu pass an additional |
Thanks to hyc's #5633 we now have full reproducibility for all compiled binaries. The pull request also seems to have fixed the crashes on macOS. I will close the issue once reproducible builds are used to build a monero release and at least two other participants achieve the same hashes. |
Awesome - thank you for your hard work! I’ll tag today or tomorrow, and then we can build:) |
@fluffypony - Please don't forget to merge #5633 and #5631 for the |
@fluffypony - Those PRs have been merged. When would you be able to create a "prep for v0.14.1" PR (similar to #5170) + tag? |
Already on it, will let you know when it’s done and then we can do some reproducible builds :) |
Thanks! |
+resolved |
1 similar comment
+resolved |
It seems that builds of Monero are non deterministic. Since this is a difficult goal and there is many way to achieve it, I want first to open the discussion here before opening a new PR
I've checked how Bitcoin and Tor is doing it, they use Gitian. I would recommend doing something similar...
Bitcoin
TorBrowser
Code base
I want through the source code and checked already that Non-determinism is not originating from the code base itself:
Timestamps: for example, use of C/C++ macros DATE, TIME, TIMESTAMP, embedding the compilation time in the binary, etc. If the gyp define DONT_EMBED_BUILD_METADATA is set, these won't be embedded.
I'm open to any ideas or solutions, lets have a good discussion!
The text was updated successfully, but these errors were encountered: