-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make a deterministic build system #136
Comments
We have build containers now for the .dylib, .so and .a builds. Rust strives towards reproducible builds in general and is doing pretty good. I think the only thing that is really missing here is that we should not mount the host's target folder into the guest, which happens as part of
|
https://github.com/yihuang/cosmwasm-plus-plus/blob/integration-tests/nix/default.nix |
I think the main issue is the compilation step of wasmvm returns a different dll each time. Maybe if we limit it to one compiler thread (and 4-8x slower), it will produce deterministic output, as with the smart contracts. Nix is a good idea if we have dependency issues (like linking native C libs causing issues). It may also be a more efficient solution to the Docker files we use now. |
Interesting. My take is that it should be possible to instruct the compiler / linker to produce deterministic output. Maybe with some compiler flags, disabling some optimizations, or something like that. I can take a look at this at some point if you want. |
Is there an issue in the rust side? I was only aware of un-deterministic caused by working path, which should be fixed with option |
I second that. For Rust, deterministic builds are considered standard and when builds are not deterministic, we can file this as a bug. It is well possible that this does not work here for the shared libs that are a bit exotic for Rust, but we should have all the community support to get this fixed. |
I believe it is due to multiple compiler threads and varying linking order. I know I set I have not tried building the |
Some relevant links, after a quick search for "rustc deterministic":
Some info may be outdated. According to the last link, and particularly if we keep the same build system, deterministic builds are very likely. |
Integrate contract migrations
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This seems to work well for the .so and .dylib builds. But the .dll on Windows changes even without changes to the libwasmvm source code (ba3ecc0). |
See CosmWasm/wasmd#268
Multiple compiles of the same code should give us the same dlls.
I think this requires removing all concurrency from compilation and a few other tricks... definitely increasing build times a lot, so it should be an option, not default. But we should do this for tagged releases, so we can get deterministic (and signable) go binaries
The text was updated successfully, but these errors were encountered: