forked from lix-project/lix
* Turn build errors during evaluation into EvalErrors.
This commit is contained in:
parent
8bcdd36f10
commit
89865da76d
|
@ -15,6 +15,7 @@ MakeError(AssertionError, EvalError)
|
||||||
MakeError(ThrownError, AssertionError)
|
MakeError(ThrownError, AssertionError)
|
||||||
MakeError(Abort, EvalError)
|
MakeError(Abort, EvalError)
|
||||||
MakeError(TypeError, EvalError)
|
MakeError(TypeError, EvalError)
|
||||||
|
MakeError(ImportError, EvalError) // error building an imported derivation
|
||||||
|
|
||||||
|
|
||||||
/* Position objects. */
|
/* Position objects. */
|
||||||
|
|
|
@ -37,7 +37,11 @@ static void prim_import(EvalState & state, Value * * args, Value & v)
|
||||||
throw EvalError(format("cannot import `%1%', since path `%2%' is not valid")
|
throw EvalError(format("cannot import `%1%', since path `%2%' is not valid")
|
||||||
% path % *i);
|
% path % *i);
|
||||||
if (isDerivation(*i))
|
if (isDerivation(*i))
|
||||||
|
try {
|
||||||
store->buildDerivations(singleton<PathSet>(*i));
|
store->buildDerivations(singleton<PathSet>(*i));
|
||||||
|
} catch (Error & e) {
|
||||||
|
throw ImportError(e.msg());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.evalFile(path, v);
|
state.evalFile(path, v);
|
||||||
|
|
|
@ -267,7 +267,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
MakeError(SubstError, Error)
|
MakeError(SubstError, Error)
|
||||||
MakeError(BuildError, Error) /* denoted a permanent build failure */
|
MakeError(BuildError, Error) /* denotes a permanent build failure */
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -16,8 +16,6 @@ namespace nix {
|
||||||
typedef std::map<Path, Path> Roots;
|
typedef std::map<Path, Path> Roots;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct GCOptions
|
struct GCOptions
|
||||||
{
|
{
|
||||||
/* Garbage collector operation:
|
/* Garbage collector operation:
|
||||||
|
|
Loading…
Reference in a new issue