lix/src/libstore
Eelco Dolstra 1aa19b24b2 Add a flag ‘--check’ to verify build determinism
The flag ‘--check’ to ‘nix-store -r’ or ‘nix-build’ will cause Nix to
redo the build of a derivation whose output paths are already valid.
If the new output differs from the original output, an error is
printed.  This makes it easier to test if a build is deterministic.
(Obviously this cannot catch all sources of non-determinism, but it
catches the most common one, namely the current time.)

For example:

  $ nix-build '<nixpkgs>' -A patchelf
  ...
  $ nix-build '<nixpkgs>' -A patchelf --check
  error: derivation `/nix/store/1ipvxsdnbhl1rw6siz6x92s7sc8nwkkb-patchelf-0.6' may not be deterministic: hash mismatch in output `/nix/store/4pc1dmw5xkwmc6q3gdc9i5nbjl4dkjpp-patchelf-0.6.drv'

The --check build fails if not all outputs are valid.  Thus the first
call to nix-build is necessary to ensure that all outputs are valid.

The current outputs are left untouched: the new outputs are either put
in a chroot or diverted to a different location in the store using
hash rewriting.
2014-02-18 01:01:14 +01:00
..
build.cc Add a flag ‘--check’ to verify build determinism 2014-02-18 01:01:14 +01:00
derivations.cc Only substitute wanted outputs of a derivation 2012-11-26 17:15:09 +01:00
derivations.hh Only substitute wanted outputs of a derivation 2012-11-26 17:15:09 +01:00
gc.cc Fix some clang warnings 2014-01-21 18:29:55 +01:00
globals.cc Minor style fixes 2014-02-14 11:48:42 +01:00
globals.hh Minor style fixes 2014-02-14 11:48:42 +01:00
local-store.cc Heuristically detect if a build may have failed due to a full disk 2014-02-17 14:15:56 +01:00
local-store.hh Add a flag ‘--check’ to verify build determinism 2014-02-18 01:01:14 +01:00
local.mk Fix "make dist" 2014-02-01 14:38:12 +01:00
misc.cc Don't substitute derivations that have preferLocalBuild set 2013-06-20 19:26:31 +02:00
misc.hh Don't set $preferLocalBuild and $requiredSystemFeatures in builders 2013-06-20 18:07:27 +00:00
optimise-store.cc Revert "Prevent config.h from being clobbered" 2013-03-08 01:24:59 +01:00
pathlocks.cc Set the close-on-exec flag on file descriptors 2012-03-05 20:29:00 +01:00
pathlocks.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
references.cc Use data() instead of c_str() where appropriate 2012-02-09 18:27:45 +01:00
references.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
remote-store.cc Add a flag ‘--check’ to verify build determinism 2014-02-18 01:01:14 +01:00
remote-store.hh Add a flag ‘--check’ to verify build determinism 2014-02-18 01:01:14 +01:00
schema.sql * Store the size of a store path in the database (to be precise, the 2010-11-16 17:11:46 +00:00
store-api.cc Move StoreApi::serve into opServe 2014-02-10 06:52:48 -05:00
store-api.hh Add a flag ‘--check’ to verify build determinism 2014-02-18 01:01:14 +01:00
worker-protocol.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00