Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upReproducible builds: Non deterministic order of embedded migrations #1901
Comments
weiznich
closed this
in
#1902
Nov 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kpcyrd commentedOct 31, 2018
Setup
I'm trying to make a program pass reprotest for reproducible-builds. I've noticed that embedded_migrations introduce randomness into the binary that may prevent successful rebuilding:
This builds a small example project that has a few migrations embedded:
This currently fails since the
embed_migrations!macro depends on the dirent order, which may be undeterministic:https://github.com/diesel-rs/diesel/blob/master/diesel_migrations/migrations_internals/src/lib.rs#L264-L279
Versions
Feature Flags
Suggested solution
The list of migrations should be sorted, either directly in
migration_paths_in_directory, or in theembed_migrations!macro.I assume this list needs to be sorted at runtime anyway to ensure migrations are applied in the correct order.
Checklist
closed if this is not the case)