Fixes non deterministic builds by ensuring file compilation order #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes mlua-rs/mlua#644
After much tweaking around we discovered the source of nondeterminism lies in the way mlua compiles the luau sources.
read_diris nondeterministic in the order of files it returns as it depends on disk IO. This for some reason caused different binary outputs on the final binary compiled by Rust.You can try this yourself in a Docker image or similar ubuntu machines. Compiling a crate that uses mlua and then getting the sha256 of the final Rust binary. Even though the code and environment is the same, the SHA256 output is different.
For us this caused SGX generating different signatures for the binaries we had produced. Via much tweaking of the compilation process we finally stumbled into the answer.
BTW we only need luau, but this is happening with the lua-src-rs crate as well.