aboutsummaryrefslogtreecommitdiff
path: root/nix/libstore/globals.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-12-08 22:50:18 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-08 23:58:12 +0100
commitb23b4d394a39b60188ed74ecdf1027bc7dd5b9b3 (patch)
tree1be78e8e089d88a4c553a5d328a4a6ebc58338ed /nix/libstore/globals.cc
parent7fbee931a5565a009e23f785c5874a55a905626f (diff)
downloadpatches-b23b4d394a39b60188ed74ecdf1027bc7dd5b9b3.tar
patches-b23b4d394a39b60188ed74ecdf1027bc7dd5b9b3.tar.gz
daemon: Allow builds to be repeated.
This makes it easy to detect non-deterministic builds. * nix/libstore/build.cc (DerivationGoal): Remove 'InodesSeen'; add 'curRound', 'nrRound', and 'prevInfos'. (DerivationGoal::inputsRealised): Initialize 'nrRound'. (NotDeterministic): New error type. (DerivationGoal::buildDone): Check whether we need to repeat. (DerivationGoal::startBuilder): Adjust message. (DerivationGoal::registerOutputs): Check whether we get the same result. * nix/libstore/globals.cc (Settings::get(const string & name, int def)): New method. * nix/libstore/globals.hh (Settings): Add it. * nix/libstore/store-api.hh (ValidPathInfo): Add operator ==. * nix/nix-daemon/nix-daemon.cc (performOp): Allow "build-repeat" for "untrusted" users. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix/libstore/globals.cc')
-rw-r--r--nix/libstore/globals.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 07f23d469c..84fc885eba 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -137,6 +137,13 @@ bool Settings::get(const string & name, bool def)
return res;
}
+int Settings::get(const string & name, int def)
+{
+ int res = def;
+ _get(res, name);
+ return res;
+}
+
void Settings::update()
{