Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect --keep-going when a substituter fails. #994

Merged
merged 1 commit into from
Jul 23, 2016

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Jul 23, 2016

Fixes #977

@shlevy
Copy link
Member Author

shlevy commented Jul 23, 2016

Note not yet verified to solve the issue, waiting on @obadz to test.

@obadz
Copy link

obadz commented Jul 23, 2016

Trying now. Thanks a lot @shlevy.

@obadz
Copy link

obadz commented Jul 23, 2016

@shlevy, I don't think it's working :-(

*** Downloading ‘https://cache.nixos.org/nar/0jfbqscy61g9cgabcznq48f1rhjfnr622cqqfsckmw1c3ynjvwmx.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/4cf5sa69a2yrjjq4mc6q28ycqa7wa068-libe-book-0.1.2.tar.bz2’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
curl: (28) Connection timed out after 4001 milliseconds
/nix/store/ca12bylrlmkdlzhi0k729xkrv68qx306-xz-5.2.2-bin/bin/xz: (stdin): File format not recognized
error: unexpected end-of-file
download of ‘https://cache.nixos.org/nar/1n8d1h27zm8nq0i397l9vlscya58mwshpn7ycqdjk387mjyv7y3j.nar.xz’ failed: No such file or directory
could not download ‘/nix/store/6yvzyyb44x04gr57fhs7cn8vrz7ccjhb-libbluray-0.9.2’ from any binary cache
fetching path ‘/nix/store/6yvzyyb44x04gr57fhs7cn8vrz7ccjhb-libbluray-0.9.2’ failed with exit code 1
fetching path ‘/nix/store/gmn1gxq7v94s2h5piiag8dh90d513hds-libeot-0.01.tar.bz2’...
killing process 16507
killing process 17021
killing process 17016
killing process 17011
killing process 17001
killing process 16880
killing process 16516
killing process 16514

@obadz
Copy link

obadz commented Jul 23, 2016

(applied over 1.11.2 with this patch)

diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index bf3f8ae..0fe5270 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -11,6 +11,11 @@ let

     outputs = [ "dev" "out" "man" "doc" ];

+    patches = [ (fetchurl {
+      url    = "https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/994.patch";
+      sha256 = "1yn60pk1jszrfvg8c2dy31j1xvjxgbn8gp4sxn601k5mfx6bx9sh";
+    }) ];
+
     nativeBuildInputs = [ perl pkgconfig ];

     buildInputs = [ curl openssl sqlite xz ]

@obadz
Copy link

obadz commented Jul 23, 2016

Happens when building nix from git as well:

 30 50.5M   30 15.5M    0     0   194k      0  0:04:25  0:01:21  0:03:04  303k
  1  158M    1 3054k    0     0   201k      0  0:13:25  0:00:15  0:13:10  133k
  0  124M    0 1033k    0     0   197k      0  0:10:43  0:00:05  0:10:38  205k
 64 35.7M   64 23.0M    0     0   225k      0  0:02:42  0:01:44  0:00:58
  201k
100 22.8M  100 22.8M    0     0   223k      0  0:01:45  0:01:45 --:--:--  331k
fetching path ‘/nix/store/w66p9wkr42ns1kizd698sh64sd6x4awy-icu4c-54_1-src.tgz’ failed with exit code 1
fetching path ‘/nix/store/p87f49ihj997jpalqy5nyjbcs544x7kl-librepository-1.1.6.zip’...
killing process 13678
killing process 14134
killing process 14119
killing process 14109
killing process 13710
killing process 13709
killing process 13852
killing process 13847
error: some substitutes for the outputs of derivation ‘/nix/store/9346q9j2gsbx45a66y1kdkkiahzrpinz-icu4c-54_1-src.tgz.drv’ failed (usually happens due to networking issues); try ‘--fallback’ to build derivation from source 

@obadz
Copy link

obadz commented Jul 23, 2016

New error

$ NIX_REMOTE= sudo -E /nix/store/pm3jgvbv50wf24rnncyq3l0yfqx65wy2-nix-1.12pre1234_abcdef/bin/nix-build --keep-going --no-out-link --expr 'with (import <nixpkgs> {}); with (import <nixos> {}); [ system mainEnv haskellEnv ]'

[…lots of fetching…]
fetching path ‘/nix/store/8vim2pfxkk0psra0l3ay1q0859lwcp17-xz-5.2.2-bin’...
fetching path ‘/nix/store/y9cn2p4digngmypaz5f6lihfw0znic0k-yasm-1.3.0’...
fetching path ‘/nix/store/ll8njd67jbng7b8zc19rl6sxdvg1p1h0-stdenv’...
fetching path ‘/nix/store/yi3mqspgxg4rd4indzcdc654mp74gr9j-zlib-1.2.8.tar.gz’...
building path(s) ‘/nix/store/acwarm2gfghpkiqap4gd3540hip4gp35-chromium-51.0.2704.103’
error (ignored): bad_weak_ptr
killing process 16273
error: while setting up the build environment: unable to make filesystem ‘/run/user/1000/gvfs’ private: Permission denied

@obadz
Copy link

obadz commented Jul 23, 2016

Retrying leads to a similar error on a different package:

  /nix/store/kzjw6jb24z4sl40a0mzzisgdm6r42isk-main-env-git.pkgs-0ad8d0b.conf-648d01f.drv
  /nix/store/p21drn73d733fih7r8wcayvn1351k8rr-initrd.drv
  /nix/store/yxvbsnv879s2i2cignybfx1l9fahkmcn-nixos-system-bernadette-16.09.git.pkgs-0ad8d0b.conf-648d01f.drv
these paths will be fetched (124.78 MiB download, 127.57 MiB unpacked):
  /nix/store/2apcbv4d4nb01ywhqz1jg5m23ni7k2al-libreoffice-translations-5.0.6.3.tar.xz
  /nix/store/hjx44ssm6hnsk9njbgf0pm0fwvpg7cci-gitg-3.20.0
building path(s) ‘/nix/store/h5wkda2kyfx6srikvnygf6zzxsx10kzj-client.conf’
error (ignored): bad_weak_ptr
killing process 16393
error: while setting up the build environment: unable to make filesystem ‘/run/user/1000/gvfs’ private: Permission denied

@obadz
Copy link

obadz commented Jul 23, 2016

$ sudo -i NIX_PATH=$NIX_PATH NIX_REMOTE="" /nix/store/pm3jgvbv50wf24rnncyq3l0yfqx65wy2-nix-1.12pre1234_abcdef/bin/nix-build --keep-going --no-out-link --expr 'with (import <nixpkgs> {}); with (import <nixos> {}); [ system mainEnv haskellEnv ]'
warning: Nix search path entry ‘/etc/nixos/configuration.nix’ does not exist, ignoring
error: file ‘nixos-config’ was not found in the Nix search path (add it using $NIX_PATH or -I), at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/default.nix:1:60
(use ‘--show-trace’ to show detailed location information)

(I don't have /etc/nixos/configuration.nix in my $NIX_PATH but I do have a nixos-config)

@obadz
Copy link

obadz commented Jul 23, 2016

DAY AND NIGHT!

I'm testing this over 1.11.2 again. It has a phenomenal impact on my user experience! Thanks @shlevy!

Example of the impact:

$ nix-build something_big

[… bunch of downloads and builds…]

fetching path ‘/nix/store/c1rsj39h56ka6wnvw3ackdihy04j38lx-network-uri-2.6.1.0’...

*** Downloading ‘https://cache.nixos.org/nar/1rjjgmyq9x2m6dn64zvm07ykv35i1f6pzg0bafv4ishw9g9c1z08.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/sjfyjydzvfpjazh6gpcsj5zpa5c4cycs-http2-1.6.1’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
curl: (28) Operation timed out after 0 milliseconds with 0 out of 0 bytes received
/nix/store/ca12bylrlmkdlzhi0k729xkrv68qx306-xz-5.2.2-bin/bin/xz: (stdin): File format not recognized
error: unexpected end-of-file
download of ‘https://cache.nixos.org/nar/1cmvz9asq6h4q90f5hxd7d9zsdzapdibx1dx3nfgc0k2x99h08i1.nar.xz’ failed: No such file or directory
could not download ‘/nix/store/xxj3r8r0cr9n0n40zbqpivf5l6i7pg9h-exceptions-0.8.2.1’ from any binary cache
fetching path ‘/nix/store/xxj3r8r0cr9n0n40zbqpivf5l6i7pg9h-exceptions-0.8.2.1’ failed with exit code 1
fetching path ‘/nix/store/fyzjigbmgwwbaikq6iqmq4yhb7gnw2ld-hspec-core-2.2.3’...

*** Downloading ‘https://cache.nixos.org/nar/0ppc02kys9v739jvkr05z27w8p1czbcqvadc9jvkgcqknhmrv0vs.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/c1rsj39h56ka6wnvw3ackdihy04j38lx-network-uri-2.6.1.0’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

[… continues downloading and building what it can! …]

cannot build derivation ‘/nix/store/229zascbmdvp4bjyfs8dp2bx0dkrd52w-ghc-8.0.1.drv’: 34 dependencies couldn't be built
cannot build derivation ‘/nix/store/d61hfaahxmapg7h8y18hb0lz1z6frz4n-haskell-env-git.pkgs-c9a3cbb.conf-648d01f.drv’: 1 dependencies couldn't be built

[…]

error: build of ‘/nix/store/d61hfaahxmapg7h8y18hb0lz1z6frz4n-haskell-env-git.pkgs-c9a3cbb.conf-648d01f.drv’ failed

Restarting nix-build fills in the missing packages of course. No build effort was wasted.

I'm using it by fetching the patch over 1.11.2 but I assume this would be useful for others as well? Is there a way to cherry-pick this on the 1.11 branch and add it to nixpkgs?

@shlevy shlevy merged commit 18b0808 into NixOS:master Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants