diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-01-27 14:46:10 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-01-27 14:46:10 +0100 |
commit | 12de0466fea6558ccb0dd5b98b72d7a068c9b5e8 (patch) | |
tree | 237c2b188016930a7b2dac2a52309ab25865e2eb /src/libexpr/primops.cc | |
parent | 965dc6070a1b7dc582d90039c670d436f4a2e9f6 (diff) |
Add trace to build errors during import-from-derivation
Example:
error: builder for '/nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv' failed with exit code 1;
last 1 log lines:
> FAIL
For full logs, run 'nix log /nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv'.
… while importing '/nix/store/pfp4a4bjh642ylxyipncqs03z6kkgfvy-failing'
at /nix/store/25wgzr2qrqqiqfbdb1chpiry221cjglc-source/flake.nix:58:15:
57|
58| ifd = import self.hydraJobs.broken;
| ^
59|
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index a470ed6df..13565b950 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -118,6 +118,9 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS .msg = hintfmt("cannot import '%1%', since path '%2%' is not valid", path, e.path), .errPos = pos }); + } catch (Error & e) { + e.addTrace(pos, "while importing '%s'", path); + throw e; } Path realPath = state.checkSourcePath(state.toRealPath(path, context)); |