Skip to content

Instantly share code, notes, and snippets.

@Jyothsnasrinivas
Last active August 19, 2018 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jyothsnasrinivas/6bd76ced972c92fb83a4deb23fdad41f to your computer and use it in GitHub Desktop.
Save Jyothsnasrinivas/6bd76ced972c92fb83a4deb23fdad41f to your computer and use it in GitHub Desktop.
Reproducible Builds/Deterministic Compilation in Eta

Reproducible Builds/Deterministic Compilation in Eta

A reproducible build means the following (as quoted from the reproducible builds official site):

Reproducible builds are a set of software development practices that create a verifiable path from human readable source code to the binary code used by computers.

Reproducible builds provide value by enabling verification of software artifacts and supporting automated build tools in the industry.

Eta aims to support reproducible builds by default with zero additional work.

This gist helps those who want to reproduce the deterministic compilation in Eta.

Step 1

Let’s open up a terminal inside any Eta project and type in the following commands:

$ etlas clean && etlas build

$ shasum dist/build/[eta-version]/[project-name]/build/[project-name]-inplace-jar.jar

[eta-version]: Take the version of Eta you are using currently on your system. For example, I'm currently using eta-0.8.6b1 on my system. [project-name]: Name of the project you are building. For example, I'm currently building lens-4.17 on my system.

My version of the SHA checksum command is:

$ shasum dist/build/eta-0.8.6b1/lens-4.17/build/lens-4.17-inplace-jar.jar

Step 2

We repeat Step 1 again.

$ etlas clean && etlas build

$ shasum dist/build/[eta-version]/[project-name]/build/[project-name]-inplace-jar.jar

Conclusion

If you have followed these steps, you will note that the two SHA checksums are exactly the same.

If you ever find a case where this is not happening, please file an issue here with the prefix [reproducible-builds].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment