Closed hannesm closed 4 years ago
//cc @mirage/core any objections to this change (including the API change to avoid global mutable state)? It'd be great to get this released soon
LGTM
What about the date? Does it still make sense to include it in the generated file?
the date embedded into a crunched module is either Unix.time ()
or SOURCE_DATE_EPOCH
, which is fine with me (and the reproducible builds people https://reproducible-builds.org/specs/source-date-epoch/).
it is nice to have a last_modified
(as required in our mirage-kv interface). another solution would be to use the modification time of individual files and directories (but then, reproducibility is depending on the mtime), thus the current approach is fine with me.
Definitely fine by me
I checked the clients of ocaml-crunch
(which are released to opam), and none of them use the API of crunch directly (this PR changes that API), but execute the command-line utility.
In addition, it is noteworthy that if you'd used the API before and wanted to crunch multiple separate artifacts, you'd get the wrong output after the first one, since the hash tables were not cleared between runs. This PR fixes this as well (by making the state explicit).
this is crucial for reproducible builds of unikernels that use crunch