On 05/27/2013 06:02 PM, Karn Kallio wrote:
I don't know
where the non-determinism comes from, but if they just use a random
generator, it would be enough to seed it e.g. from the hash of $out
instead of the standard sources.

As I understand, GHC has many uses of unsafeInterleaveIO in its
implementation, so the order of effects such as the generation of fresh names
will depend on how the IO manager schedules evaluation of those thunks, which
could depend on eg time for receiving a filesystem response, which may depend
on installed hardware (eg amount of RAM for filesystem buffer) and state of
the machine (eg how many other processes are using IO at the moment).  So the
nondeterminism arises not via a controlled mechanism like a random generator
but from races influenced by the configuration and state of the wider machine.

I see, but then passing +RTS -V0 to the compiler might make it deterministic. I suppose it will impact build performance by increasing I/O wait time, but IMHO builders are usually so loaded that total rebuild performance won't suffer so much (all these are pure speculations, I've never tried).

[-V option]: http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html#rts-options-misc

I would suggest this only for nix builds, *not* for user-run GHC from store.


Vlada


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to