git.iko.soy/typeable/nixpkgs
on master help sign in
nox: show trace for evaluation errors

Backports upstream commit 8900531.

commit8e16c57424c5462f0e4c842aac2b5f0c379559a5 authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> dateFri 3 Jul 2015, 04:52 (11 years ago) parentdfdcbb3
2 files changed+43
pkgs/tools/package-management/nox/default.nix+2 pkgs/tools/package-management/nox/show-trace.patch+41
pkgs/tools/package-management/nox/default.nix+2
@@ -10,6 +10,8 @@ pythonPackages.buildPythonPackage rec {
1010 sha256 = "1s1jhickdhym70qrb5h4qxq1mvkpwgdppqpfb2jnpfaf1az6c207";
1111 };
1212
13+ patches = [ ./show-trace.patch ];
14+
1315 buildInputs = [ pythonPackages.pbr ];
1416
1517 pythonPath = with pythonPackages; [
pkgs/tools/package-management/nox/show-trace.patchnew file+41
@@ -0,0 +1,41 @@
1+From: Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
2+Date: Tue, 2 Jun 2015 13:04:19 +0200
3+Subject: [PATCH] Run `nix-env` & `nix-shell` with `--show-trace`
4+
5+Evaluation is broken often enough that this seems wise.
6+Debugging such errors without a backtrace is most unpleasant.
7+
8+diff -Naur nix-nox-0.0.1/nox/nixpkgs_repo.py nix-nox-0.0.1b/nox/nixpkgs_repo.py
9+--- nox/nox/nixpkgs_repo.py 2014-10-26 21:50:33.000000000 +0100
10++++ nox/nox/nixpkgs_repo.py 2015-07-03 04:46:08.114975479 +0200
11+@@ -75,7 +75,7 @@
12+
13+ def packages(path):
14+ """List all nix packages in the repo, as a set"""
15+- output = subprocess.check_output(['nix-env', '-f', path, '-qaP', '--drv-path'],
16++ output = subprocess.check_output(['nix-env', '-f', path, '-qaP', '--drv-path', '--show-trace'],
17+ universal_newlines=True)
18+ return set(output.split('\n'))
19+
20+diff -Naur nix-nox-0.0.1/nox/search.py nix-nox-0.0.1b/nox/search.py
21+--- nox/nox/search.py 2014-09-20 14:55:33.000000000 +0200
22++++ nox/nox/search.py 2015-07-03 04:46:54.264813143 +0200
23+@@ -10,7 +10,7 @@
24+
25+ def nix_packages_json():
26+ click.echo('Refreshing cache')
27+- output = subprocess.check_output(['nix-env', '-qa', '--json'],
28++ output = subprocess.check_output(['nix-env', '-qa', '--json', '--show-trace'],
29+ universal_newlines=True)
30+ return json.loads(output)
31+
32+@@ -70,7 +70,7 @@
33+ value_proc=parse_input)
34+ attributes = [p.attribute for p in packages]
35+ if action == 'install':
36+- subprocess.check_call(['nix-env', '-iA'] + attributes)
37++ subprocess.check_call(['nix-env', '-iA', '--show-trace'] + attributes)
38+ elif action == 'shell':
39+ attributes = [a[len('nixpkgs.'):] for a in attributes]
40+- subprocess.check_call(['nix-shell', '-p'] + attributes)
41++ subprocess.check_call(['nix-shell', '-p', '--show-trace'] + attributes)