aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/build.cc27
-rw-r--r--nix/libstore/builtins.cc5
-rw-r--r--nix/libstore/globals.cc9
-rw-r--r--nix/libstore/globals.hh12
-rw-r--r--nix/libstore/worker-protocol.hh2
-rw-r--r--nix/libutil/archive.cc31
-rw-r--r--nix/libutil/archive.hh5
7 files changed, 21 insertions, 70 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index c7f32494d0..b2c319f00b 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -2466,13 +2466,13 @@ void DerivationGoal::registerOutputs()
/* Check the hash. */
Hash h2 = recursive ? hashPath(ht, actualPath).first : hashFile(ht, actualPath);
- if (h != h2)
- throw BuildError(
- format("%1% hash mismatch for output path `%2%'\n"
- " expected: %3%\n"
- " actual: %4%")
- % i->second.hashAlgo % path
- % printHash16or32(h) % printHash16or32(h2));
+ if (h != h2) {
+ if (settings.printBuildTrace)
+ printMsg(lvlError, format("@ hash-mismatch %1% %2% %3% %4%")
+ % path % i->second.hashAlgo
+ % printHash16or32(h) % printHash16or32(h2));
+ throw BuildError(format("hash mismatch for store item '%1%'") % path);
+ }
}
/* Get rid of all weird permissions. This also checks that
@@ -3157,11 +3157,14 @@ void SubstitutionGoal::finished()
throw Error(format("unknown hash algorithm in `%1%'") % expectedHashStr);
Hash expectedHash = parseHash16or32(hashType, string(expectedHashStr, n + 1));
Hash actualHash = hashType == htSHA256 ? hash.first : hashPath(hashType, destPath).first;
- if (expectedHash != actualHash)
- throw SubstError(format("hash mismatch in downloaded path `%1%'\n"
- " expected: %2%\n"
- " actual: %3%")
- % storePath % printHash(expectedHash) % printHash(actualHash));
+ if (expectedHash != actualHash) {
+ if (settings.printBuildTrace)
+ printMsg(lvlError, format("@ hash-mismatch %1% %2% %3% %4%")
+ % storePath % "sha256"
+ % printHash16or32(expectedHash)
+ % printHash16or32(actualHash));
+ throw SubstError(format("hash mismatch for substituted item `%1%'") % storePath);
+ }
}
} catch (SubstError & e) {
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index a5ebb47737..1f52511c80 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -1,5 +1,5 @@
/* GNU Guix --- Functional package management for GNU
- Copyright (C) 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+ Copyright (C) 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix.
@@ -47,6 +47,9 @@ static void builtinDownload(const Derivation &drv,
content-addressed mirrors) works correctly. */
setenv("NIX_STORE", settings.nixStore.c_str(), 1);
+ /* Tell it about options such as "print-extended-build-trace". */
+ setenv("_NIX_OPTIONS", settings.pack().c_str(), 1);
+
/* XXX: Hack our way to use the 'download' script from 'LIBEXECDIR/guix'
or just 'LIBEXECDIR', depending on whether we're running uninstalled or
not. */
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index fcafac2df6..94c2e516f8 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -42,7 +42,6 @@ Settings::Settings()
syncBeforeRegistering = false;
useSubstitutes = true;
useChroot = false;
- useSshSubstituter = false;
impersonateLinux26 = false;
keepLog = true;
#if HAVE_BZLIB_H
@@ -60,7 +59,6 @@ Settings::Settings()
envKeepDerivations = false;
lockCPU = getEnv("NIX_AFFINITY_HACK", "1") == "1";
showTrace = false;
- enableImportNative = false;
}
@@ -142,11 +140,6 @@ void Settings::update()
_get(gcKeepDerivations, "gc-keep-derivations");
_get(autoOptimiseStore, "auto-optimise-store");
_get(envKeepDerivations, "env-keep-derivations");
- _get(sshSubstituterHosts, "ssh-substituter-hosts");
- _get(useSshSubstituter, "use-ssh-substituter");
- _get(logServers, "log-servers");
- _get(enableImportNative, "allow-unsafe-native-code-during-evaluation");
- _get(useCaseHack, "use-case-hack");
string subs = getEnv("NIX_SUBSTITUTERS", "default");
if (subs == "default") {
@@ -157,8 +150,6 @@ void Settings::update()
#endif
substituters.push_back(nixLibexecDir + "/nix/substituters/download-using-manifests.pl");
substituters.push_back(nixLibexecDir + "/nix/substituters/download-from-binary-cache.pl");
- if (useSshSubstituter)
- substituters.push_back(nixLibexecDir + "/nix/substituters/download-via-ssh");
} else
substituters = tokenizeString<Strings>(subs, ":");
}
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 1293625e1f..4c142e6933 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -161,12 +161,6 @@ struct Settings {
/* Whether to build in chroot. */
bool useChroot;
- /* Set of ssh connection strings for the ssh substituter */
- Strings sshSubstituterHosts;
-
- /* Whether to use the ssh substituter at all */
- bool useSshSubstituter;
-
/* Whether to impersonate a Linux 2.6 machine on newer kernels. */
bool impersonateLinux26;
@@ -212,12 +206,6 @@ struct Settings {
/* Whether to show a stack trace if Nix evaluation fails. */
bool showTrace;
- /* A list of URL prefixes that can return Nix build logs. */
- Strings logServers;
-
- /* Whether the importNative primop should be enabled */
- bool enableImportNative;
-
private:
SettingsMap settings, overrides;
diff --git a/nix/libstore/worker-protocol.hh b/nix/libstore/worker-protocol.hh
index efe9eadf23..103d60a8c2 100644
--- a/nix/libstore/worker-protocol.hh
+++ b/nix/libstore/worker-protocol.hh
@@ -6,7 +6,7 @@ namespace nix {
#define WORKER_MAGIC_1 0x6e697863
#define WORKER_MAGIC_2 0x6478696f
-#define PROTOCOL_VERSION 0x161
+#define PROTOCOL_VERSION 0x162
#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
diff --git a/nix/libutil/archive.cc b/nix/libutil/archive.cc
index 4e3d99356a..2599030454 100644
--- a/nix/libutil/archive.cc
+++ b/nix/libutil/archive.cc
@@ -21,14 +21,6 @@
namespace nix {
-
-bool useCaseHack =
-#if __APPLE__
- true;
-#else
- false;
-#endif
-
static string archiveVersion1 = "nix-archive-1";
static string caseHackSuffix = "~nix~case~hack~";
@@ -85,19 +77,7 @@ static void dump(const Path & path, Sink & sink, PathFilter & filter)
the case hack applied by restorePath(). */
std::map<string, string> unhacked;
for (auto & i : readDirectory(path))
- if (useCaseHack) {
- string name(i.name);
- size_t pos = i.name.find(caseHackSuffix);
- if (pos != string::npos) {
- printMsg(lvlDebug, format("removing case hack suffix from `%1%'") % (path + "/" + i.name));
- name.erase(pos);
- }
- if (unhacked.find(name) != unhacked.end())
- throw Error(format("file name collision in between `%1%' and `%2%'")
- % (path + "/" + unhacked[name]) % (path + "/" + i.name));
- unhacked[name] = i.name;
- } else
- unhacked[i.name] = i.name;
+ unhacked[i.name] = i.name;
for (auto & i : unhacked)
if (filter(path + "/" + i.first)) {
@@ -251,15 +231,6 @@ static void parse(ParseSink & sink, Source & source, const Path & path)
if (name <= prevName)
throw Error("NAR directory is not sorted");
prevName = name;
- if (useCaseHack) {
- auto i = names.find(name);
- if (i != names.end()) {
- printMsg(lvlDebug, format("case collision between `%1%' and `%2%'") % i->first % name);
- name += caseHackSuffix;
- name += std::to_string(++i->second);
- } else
- names[name] = 0;
- }
} else if (s == "node") {
if (s.empty()) throw badArchive("entry name missing");
parse(sink, source, path + "/" + name);
diff --git a/nix/libutil/archive.hh b/nix/libutil/archive.hh
index c216e9768f..9b83a5f288 100644
--- a/nix/libutil/archive.hh
+++ b/nix/libutil/archive.hh
@@ -71,9 +71,4 @@ void parseDump(ParseSink & sink, Source & source);
void restorePath(const Path & path, Source & source);
-
-// FIXME: global variables are bad m'kay.
-extern bool useCaseHack;
-
-
}