about summary refs log tree commit diff
path: root/pkgs/tools/package-management
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-03 04:52:06 +0200
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-03 04:52:06 +0200
commit8e16c57424c5462f0e4c842aac2b5f0c379559a5 (patch)
tree6c5f4a238b89173c09b476e6de6788206a8b3950 /pkgs/tools/package-management
parentdfdcbb3640dde3d88cbe758a8ed07a4193399aec (diff)
downloadnixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar.gz
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar.bz2
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar.lz
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar.xz
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.tar.zst
nixlib-8e16c57424c5462f0e4c842aac2b5f0c379559a5.zip
nox: show trace for evaluation errors
Backports upstream commit 8900531.
Diffstat (limited to 'pkgs/tools/package-management')
-rw-r--r--pkgs/tools/package-management/nox/default.nix2
-rw-r--r--pkgs/tools/package-management/nox/show-trace.patch41
2 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/tools/package-management/nox/default.nix b/pkgs/tools/package-management/nox/default.nix
index 32af196c46e8..bbb576400f07 100644
--- a/pkgs/tools/package-management/nox/default.nix
+++ b/pkgs/tools/package-management/nox/default.nix
@@ -10,6 +10,8 @@ pythonPackages.buildPythonPackage rec {
     sha256 = "1s1jhickdhym70qrb5h4qxq1mvkpwgdppqpfb2jnpfaf1az6c207";
   };
 
+  patches = [ ./show-trace.patch ];
+
   buildInputs = [ pythonPackages.pbr ];
 
   pythonPath = with pythonPackages; [
diff --git a/pkgs/tools/package-management/nox/show-trace.patch b/pkgs/tools/package-management/nox/show-trace.patch
new file mode 100644
index 000000000000..6b464d3a4b2c
--- /dev/null
+++ b/pkgs/tools/package-management/nox/show-trace.patch
@@ -0,0 +1,41 @@
+From: Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
+Date: Tue, 2 Jun 2015 13:04:19 +0200
+Subject: [PATCH] Run `nix-env` & `nix-shell` with `--show-trace`
+
+Evaluation is broken often enough that this seems wise.
+Debugging such errors without a backtrace is most unpleasant.
+
+diff -Naur nix-nox-0.0.1/nox/nixpkgs_repo.py nix-nox-0.0.1b/nox/nixpkgs_repo.py
+--- nox/nox/nixpkgs_repo.py	2014-10-26 21:50:33.000000000 +0100
++++ nox/nox/nixpkgs_repo.py	2015-07-03 04:46:08.114975479 +0200
+@@ -75,7 +75,7 @@
+ 
+ def packages(path):
+     """List all nix packages in the repo, as a set"""
+-    output = subprocess.check_output(['nix-env', '-f', path, '-qaP', '--drv-path'],
++    output = subprocess.check_output(['nix-env', '-f', path, '-qaP', '--drv-path', '--show-trace'],
+                                      universal_newlines=True)
+     return set(output.split('\n'))
+ 
+diff -Naur nix-nox-0.0.1/nox/search.py nix-nox-0.0.1b/nox/search.py
+--- nox/nox/search.py	2014-09-20 14:55:33.000000000 +0200
++++ nox/nox/search.py	2015-07-03 04:46:54.264813143 +0200
+@@ -10,7 +10,7 @@
+ 
+ def nix_packages_json():
+     click.echo('Refreshing cache')
+-    output = subprocess.check_output(['nix-env', '-qa', '--json'],
++    output = subprocess.check_output(['nix-env', '-qa', '--json', '--show-trace'],
+                                      universal_newlines=True)
+     return json.loads(output)
+ 
+@@ -70,7 +70,7 @@
+                                         value_proc=parse_input)
+         attributes = [p.attribute for p in packages]
+         if action == 'install':
+-            subprocess.check_call(['nix-env', '-iA'] + attributes)
++            subprocess.check_call(['nix-env', '-iA', '--show-trace'] + attributes)
+         elif action == 'shell':
+             attributes = [a[len('nixpkgs.'):] for a in attributes]
+-            subprocess.check_call(['nix-shell', '-p'] + attributes)
++            subprocess.check_call(['nix-shell', '-p', '--show-trace'] + attributes)