aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-03-07 11:33:03 +0100
committerGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-03-07 11:33:03 +0100
commit13c4dc65327c9654c47e6d80c0f4e1797b999f97 (patch)
tree7ec88137a4bdc971522920a27c046082e32c1d2d /src/nix
parent1b5a8db148dd4403c64bc058ce1a4a5e46d52031 (diff)
more fixes
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/eval.cc2
-rw-r--r--src/nix/flake.cc4
-rw-r--r--src/nix/main.cc2
-rw-r--r--src/nix/prefetch.cc16
-rw-r--r--src/nix/repl.cc8
-rw-r--r--src/nix/upgrade-nix.cc2
6 files changed, 17 insertions, 17 deletions
diff --git a/src/nix/eval.cc b/src/nix/eval.cc
index 8ee3ba45b..1d66d457c 100644
--- a/src/nix/eval.cc
+++ b/src/nix/eval.cc
@@ -107,7 +107,7 @@ struct CmdEval : MixJSON, InstallableCommand
else if (raw) {
stopProgressBar();
- std::cout << *state->coerceToString(noPos, *v, context, "While generating the eval command output");
+ std::cout << *state->coerceToString(noPos, *v, context, "While generating the eval command output: ");
}
else if (json) {
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 356f89713..9ba6e5be1 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -126,12 +126,12 @@ static void enumerateOutputs(EvalState & state, Value & vFlake,
std::function<void(const std::string & name, Value & vProvide, const Pos & pos)> callback)
{
auto pos = vFlake.determinePos(noPos);
- state.forceAttrs(vFlake, pos, "While evaluating a flake to get its outputs");
+ state.forceAttrs(vFlake, pos, "While evaluating a flake to get its outputs: ");
auto aOutputs = vFlake.attrs->get(state.symbols.create("outputs"));
assert(aOutputs);
- state.forceAttrs(*aOutputs->value, pos, "While evaluating the outputs of a flake");
+ state.forceAttrs(*aOutputs->value, pos, "While evaluating the outputs of a flake: ");
auto sHydraJobs = state.symbols.create("hydraJobs");
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 0c6286686..3ba7ce8b6 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -196,7 +196,7 @@ static void showHelp(std::vector<std::string> subcommand, MultiCommand & topleve
if (!attr)
throw UsageError("Nix has no subcommand '%s'", concatStringsSep("", subcommand));
- auto markdown = state.forceString(*attr->value, noPos, "While evaluating the lowdown help text");
+ auto markdown = state.forceString(*attr->value, noPos, "While evaluating the lowdown help text: ");
RunPager pager;
std::cout << renderMarkdownToTerminal(markdown) << "\n";
diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc
index 4376da896..a4a8ab605 100644
--- a/src/nix/prefetch.cc
+++ b/src/nix/prefetch.cc
@@ -28,17 +28,17 @@ std::string resolveMirrorUrl(EvalState & state, const std::string & url)
Value vMirrors;
// FIXME: use nixpkgs flake
state.eval(state.parseExprFromString("import <nixpkgs/pkgs/build-support/fetchurl/mirrors.nix>", "."), vMirrors);
- state.forceAttrs(vMirrors, noPos, "While evaluating the set of all mirrors");
+ state.forceAttrs(vMirrors, noPos, "While evaluating the set of all mirrors: ");
auto mirrorList = vMirrors.attrs->find(state.symbols.create(mirrorName));
if (mirrorList == vMirrors.attrs->end())
throw Error("unknown mirror name '%s'", mirrorName);
- state.forceList(*mirrorList->value, noPos, "While evaluating this mirror configuration");
+ state.forceList(*mirrorList->value, noPos, "While evaluating this mirror configuration: ");
if (mirrorList->value->listSize() < 1)
throw Error("mirror URL '%s' did not expand to anything", url);
- std::string mirror(state.forceString(*mirrorList->value->listElems()[0], noPos, "While evaluating the first available mirror"));
+ std::string mirror(state.forceString(*mirrorList->value->listElems()[0], noPos, "While evaluating the first available mirror: "));
return mirror + (hasSuffix(mirror, "/") ? "" : "/") + s.substr(p + 1);
}
@@ -196,27 +196,27 @@ static int main_nix_prefetch_url(int argc, char * * argv)
Value vRoot;
state->evalFile(path, vRoot);
Value & v(*findAlongAttrPath(*state, attrPath, autoArgs, vRoot).first);
- state->forceAttrs(v, noPos, "While evaluating the source attribute to prefetch");
+ state->forceAttrs(v, noPos, "While evaluating the source attribute to prefetch: ");
/* Extract the URL. */
auto & attr = v.attrs->need(state->symbols.create("urls"));
- state->forceList(*attr.value, noPos, "While evaluating the urls to prefetch");
+ state->forceList(*attr.value, noPos, "While evaluating the urls to prefetch: ");
if (attr.value->listSize() < 1)
throw Error("'urls' list is empty");
- url = state->forceString(*attr.value->listElems()[0], noPos, "While evaluating the first url from the urls list");
+ url = state->forceString(*attr.value->listElems()[0], noPos, "While evaluating the first url from the urls list: ");
/* Extract the hash mode. */
auto attr2 = v.attrs->get(state->symbols.create("outputHashMode"));
if (!attr2)
printInfo("warning: this does not look like a fetchurl call");
else
- unpack = state->forceString(*attr2->value, noPos, "While evaluating the outputHashMode of the source to prefetch") == "recursive";
+ unpack = state->forceString(*attr2->value, noPos, "While evaluating the outputHashMode of the source to prefetch: ") == "recursive";
/* Extract the name. */
if (!name) {
auto attr3 = v.attrs->get(state->symbols.create("name"));
if (!attr3)
- name = state->forceString(*attr3->value, noPos, "While evaluating the name of the source to prefetch");
+ name = state->forceString(*attr3->value, noPos, "While evaluating the name of the source to prefetch: ");
}
}
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index 0cb68552c..038ed4911 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -342,7 +342,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
Expr * e = parseString(expr);
Value v;
e->eval(*state, *env, v);
- state->forceAttrs(v, noPos, "nevermind, it is ignored anyway");
+ state->forceAttrs(v, noPos, "nevermind, it is ignored anyway: ");
for (auto & i : *v.attrs) {
std::string name = i.name;
@@ -461,7 +461,7 @@ bool NixRepl::processLine(std::string line)
if (v.type() == nPath || v.type() == nString) {
PathSet context;
- auto filename = state->coerceToString(noPos, v, context, "While evaluating the filename to edit");
+ auto filename = state->coerceToString(noPos, v, context, "While evaluating the filename to edit: ");
pos.file = state->symbols.create(*filename);
} else if (v.isLambda()) {
pos = v.lambda.fun->pos;
@@ -675,7 +675,7 @@ void NixRepl::reloadFiles()
void NixRepl::addAttrsToScope(Value & attrs)
{
- state->forceAttrs(attrs, [&]() { return attrs.determinePos(noPos); }, "While evaluating an attribute set to be merged in the global scope");
+ state->forceAttrs(attrs, [&]() { return attrs.determinePos(noPos); }, "While evaluating an attribute set to be merged in the global scope: ");
if (displ + attrs.attrs->size() >= envSize)
throw Error("environment full; cannot add more variables");
@@ -780,7 +780,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
Bindings::iterator i = v.attrs->find(state->sDrvPath);
PathSet context;
if (i != v.attrs->end())
- str << state->store->printStorePath(state->coerceToStorePath(*i->pos, *i->value, context, "While evaluating the drvPath of a derivation"));
+ str << state->store->printStorePath(state->coerceToStorePath(*i->pos, *i->value, context, "While evaluating the drvPath of a derivation: "));
else
str << "???";
str << "ยป";
diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc
index 1f433a199..ae314a7c6 100644
--- a/src/nix/upgrade-nix.cc
+++ b/src/nix/upgrade-nix.cc
@@ -144,7 +144,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand
Bindings & bindings(*state->allocBindings(0));
auto v2 = findAlongAttrPath(*state, settings.thisSystem, bindings, *v).first;
- return store->parseStorePath(state->forceString(*v2, noPos, "While evaluating the path tho latest nix version"));
+ return store->parseStorePath(state->forceString(*v2, noPos, "While evaluating the path tho latest nix version: "));
}
};