1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge branch 'master' into ignore-try

This commit is contained in:
Ben Burdette 2022-07-11 11:29:22 -06:00 committed by GitHub
commit cdcc349072
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 843 additions and 291 deletions

View file

@ -987,6 +987,15 @@ static RegisterPrimOp primop_trace({
});
/* Takes two arguments and evaluates to the second one. Used as the
* builtins.traceVerbose implementation when --trace-verbose is not enabled
*/
static void prim_second(EvalState & state, const PosIdx pos, Value * * args, Value & v)
{
state.forceValue(*args[1], pos);
v = *args[1];
}
/*************************************************************
* Derivations
*************************************************************/
@ -3943,6 +3952,18 @@ void EvalState::createBaseEnv()
addPrimOp("__exec", 1, prim_exec);
}
addPrimOp({
.fun = evalSettings.traceVerbose ? prim_trace : prim_second,
.arity = 2,
.name = "__traceVerbose",
.args = { "e1", "e2" },
.doc = R"(
Evaluate *e1* and print its abstract syntax representation on standard
error if `--trace-verbose` is enabled. Then return *e2*. This function
is useful for debugging.
)",
});
/* Add a value containing the current Nix expression search path. */
mkList(v, searchPath.size());
int n = 0;