CosmWasm/optimizer

ARM build not published

webmaster128 opened this issue · 6 comments

In 0.12.2 / #56 an ARM build of this project was created. This makes the CosmWasm development experience of ARM users much smother as the contract compilation does not need to go through an emulator. However, during our testing it was discovered that this ARM build produces different compilation results than the Intel build. As a consequence the build is not proproducible.

I see a few things to move forward:

  1. Ignore reproducible builds (probably bad)
  2. Find a way to ensure both images produce the same results
  3. Have different image names in order to make explicit on which system a contract is built on

Input welcome. For now, the ARM build is not published to DockerHub.

This is probably obvious, but I would also list for completeness:

  1. Stick to using Intel emulation in ARM machines for reproducibility (and in spite of performance). We just document how to do it, and that's it.

My impression is that it will be a really long shot to achieve reproducible wasm builds across different processor architectures. In fact, we're currently using docker as an "isolation chamber" to achieve reproducible builds in a single architecture. By fixing things like the OS, compiler, installed libs and their versions, etc. We are breaking some (if not all) of those when switching to a different arch.

What about
5. Publish the ARM build of rust-optimizer (let's say, as a tool for aiding testing / development), stating clearly that it does not produce the same builds than the Intel rust-optimizer. And, that for release / production use, only contracts built with the Intel one must be used.

Probably a recipe for trouble... perhaps your option 3., adding a suffix to ARM built artifacts, it's the best we can do for the moment.

Created #63.

Perhaps we can close this with #64. And create another, to document progress in the "reproducibility" area.

Doing a diff -a between (optimized) Intel and Arm artifacts, they differ by intermediate objects suffixes (among other things).

Will check the same with un-optimized artifacts, and publish in a "reproducibility" branch.

Based on #64, the following four images are published now:

# Default
cosmwasm/rust-optimizer:0.12.4
cosmwasm/workspace-optimizer:0.12.4

# ARM
cosmwasm/rust-optimizer-arm64:0.12.4
cosmwasm/workspace-optimizer-arm64:0.12.4