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

Can't install nix on Darwin #9215

Closed
retrry opened this issue Aug 12, 2015 · 17 comments
Closed

Can't install nix on Darwin #9215

retrry opened this issue Aug 12, 2015 · 17 comments
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@retrry
Copy link
Contributor

retrry commented Aug 12, 2015

Hello,
I'm trying to install nix on my MacBook Pro with (10.10.4 version of OS X) and I get error:

$ curl https://nixos.org/nix/install | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1330  100  1330    0     0   1400      0 --:--:-- --:--:-- --:--:--  1400
unpacking Nix binary tarball for x86_64-darwin from `https://nixos.org/releases/nix/nix-1.9/nix-1.9-x86_64-darwin.tar.bz2'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27.0M  100 27.0M    0     0  1869k      0  0:00:14  0:00:14 --:--:-- 2126k
performing a single-user installation of Nix...
copying Nix to /nix/store........................
initialising Nix database...
replacing old ‘nix-1.9’
installing ‘nix-1.9’
building path(s) ‘/nix/store/306py0frikbrgyxgd476viaxz9m7hjab-user-environment’
dyld: Library not loaded: /usr/lib/libSystem.B.dylib
  Referenced from: /nix/store/kp4f6acmkhslpsy6zc9v2x7jzn9417b5-perl-5.20.1/bin/perl
  Reason: no suitable image found.  Did find:
    /usr/lib/libSystem.B.dylib: stat() failed with errno=1
    /usr/lib/libSystem.B.dylib: stat() failed with errno=1
builder for ‘/nix/store/i0nf8c7mc0dsjklrg0hl31ll33vxpikk-user-environment.drv’ failed due to signal 5 (Trace/BPT trap: 5)
error: build of ‘/nix/store/i0nf8c7mc0dsjklrg0hl31ll33vxpikk-user-environment.drv’ failed
nix-binary-tarball-unpack/nix-1.9-x86_64-darwin/install: unable to install Nix into your default profile

I have Xcode installed.

@gridaphobe gridaphobe added the 6.topic: darwin Running or building packages on Darwin label Aug 12, 2015
@ariscn
Copy link

ariscn commented Aug 13, 2015

I was able to install Nix on OS X (10.10.4, which is current), but it's failing in a few weird ways.

When running nix-channel --update, it looks like it's unable to get http://nixos.org/releases/nixpkgs/nixpkgs-15.07pre66767.dec8f59//nixexprs.tar.xz, as the curl output on screen shows 0s. However, I can curl that file directly.

When running nix-env -qas, it loops forever with: download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/qn2ajs1h9np6avqgv2cv5dwp7b8jf0hv.narinfo’ after 5 seconds...

I've tried Nix 1.9, as well as the master tarball from Hydra.

@pikeas
Copy link

pikeas commented Aug 22, 2015

Would love to see a response on this!

@kontrafiktion
Copy link

have you checked out your /usr/lib/ directory, esp.:

ls -al /usr/lib/libSystem*
stat /usr/lib/libSystem.B.dylib
otool -L /usr/lib/libSystem.B.dylib

because the error seems to claim that this file could not be stated

@pikeas
Copy link

pikeas commented Aug 27, 2015

$ ls -al /usr/lib/libSystem*
-rwxr-xr-x  1 root  wheel  52960 May 31 04:52 /usr/lib/libSystem.B.dylib
-rwxr-xr-x  1 root  wheel  60576 Jun 22 15:05 /usr/lib/libSystem.B_debug.dylib
lrwxr-xr-x  1 root  wheel     17 Feb 16  2015 /usr/lib/libSystem.dylib -> libSystem.B.dylib
lrwxr-xr-x  1 root  wheel     23 Jul 27 11:23 /usr/lib/libSystem_debug.dylib -> libSystem.B_debug.dylib
$ stat /usr/lib/libSystem.B.dylib
16777221 26968976 -rwxr-xr-x 1 root wheel 0 52960 "Aug 22 19:27:52 2015" "May 31 04:52:01 2015" "Jul 27 11:29:03 2015" "May 31 04:52:01 2015" 4096 24 0x20 /usr/lib/libSystem.B.dylib
$ otool -L /usr/lib/libSystem.B.dylib
/usr/lib/libSystem.B.dylib:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    /usr/lib/system/libcache.dylib (compatibility version 1.0.0, current version 69.0.0)
    /usr/lib/system/libcommonCrypto.dylib (compatibility version 1.0.0, current version 60061.30.1)
    /usr/lib/system/libcompiler_rt.dylib (compatibility version 1.0.0, current version 35.0.0)
    /usr/lib/system/libcopyfile.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/system/libcorecrypto.dylib (compatibility version 1.0.0, current version 233.30.1)
    /usr/lib/system/libdispatch.dylib (compatibility version 1.0.0, current version 442.1.4)
    /usr/lib/system/libdyld.dylib (compatibility version 1.0.0, current version 353.2.1)
    /usr/lib/system/libkeymgr.dylib (compatibility version 1.0.0, current version 28.0.0)
    /usr/lib/system/liblaunch.dylib (compatibility version 1.0.0, current version 559.30.1)
    /usr/lib/system/libmacho.dylib (compatibility version 1.0.0, current version 862.0.0)
    /usr/lib/system/libquarantine.dylib (compatibility version 1.0.0, current version 76.20.1)
    /usr/lib/system/libremovefile.dylib (compatibility version 1.0.0, current version 35.0.0)
    /usr/lib/system/libsystem_asl.dylib (compatibility version 1.0.0, current version 267.0.0)
    /usr/lib/system/libsystem_blocks.dylib (compatibility version 1.0.0, current version 65.0.0)
    /usr/lib/system/libsystem_c.dylib (compatibility version 1.0.0, current version 1044.10.1)
    /usr/lib/system/libsystem_configuration.dylib (compatibility version 1.0.0, current version 699.30.1)
    /usr/lib/system/libsystem_coreservices.dylib (compatibility version 1.0.0, current version 9.0.0)
    /usr/lib/system/libsystem_coretls.dylib (compatibility version 1.0.0, current version 35.30.2)
    /usr/lib/system/libsystem_dnssd.dylib (compatibility version 1.0.0, current version 576.30.4)
    /usr/lib/system/libsystem_info.dylib (compatibility version 1.0.0, current version 459.20.1)
    /usr/lib/system/libsystem_kernel.dylib (compatibility version 1.0.0, current version 2782.30.5)
    /usr/lib/system/libsystem_m.dylib (compatibility version 1.0.0, current version 3086.1.0)
    /usr/lib/system/libsystem_malloc.dylib (compatibility version 1.0.0, current version 53.30.1)
    /usr/lib/system/libsystem_network.dylib (compatibility version 1.0.0, current version 412.20.3)
    /usr/lib/system/libsystem_networkextension.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/system/libsystem_notify.dylib (compatibility version 1.0.0, current version 133.1.1)
    /usr/lib/system/libsystem_platform.dylib (compatibility version 1.0.0, current version 63.0.0)
    /usr/lib/system/libsystem_pthread.dylib (compatibility version 1.0.0, current version 105.10.1)
    /usr/lib/system/libsystem_sandbox.dylib (compatibility version 1.0.0, current version 358.20.5)
    /usr/lib/system/libsystem_secinit.dylib (compatibility version 1.0.0, current version 18.0.0)
    /usr/lib/system/libsystem_stats.dylib (compatibility version 1.0.0, current version 163.30.2)
    /usr/lib/system/libsystem_trace.dylib (compatibility version 1.0.0, current version 72.20.1)
    /usr/lib/system/libunc.dylib (compatibility version 1.0.0, current version 29.0.0)
    /usr/lib/system/libunwind.dylib (compatibility version 1.0.0, current version 35.3.0)
    /usr/lib/system/libxpc.dylib (compatibility version 1.0.0, current version 559.30.1)

@pikeas
Copy link

pikeas commented Sep 19, 2015

Just tried with the latest Nix, still failing, this time with a helpful error message. The error leads back to this bit of code:

($url, $filename) = `cd $tmpdir && $Nix::Config::curl --silent --write-out '%{url_effective}\n%{filename_effective}' -L '$url' -O`;
chomp $url;
die "$0: unable to check ‘$url’\n" if $? != 0;

I haven't written Perl in about 10 years, but this looks like a simple curl? If I curl https://nixos.org/channels/nixpkgs-unstable directly, there's no error, so it looks like an issue with what Nix::Config::curl is doing?

I'm running standard OS X 10.10.5 on a recent Macbook Pro, and I'm installing Nix the normal way. I don't think I'm doing anything strange, so is Nix really broken by default on OS X...?

@ghost
Copy link

ghost commented Sep 23, 2015

Just installed Nix today on 10.10.5. No problems installing for me

@retrry
Copy link
Contributor Author

retrry commented Sep 23, 2015

Ok, so I had some time and played around a little bit with installation on Darwin and found out the culprit.
The culprit was that before installation I set: build-use-chroot = true in /etc/nix/nix.conf to enable Darwin Sandboxes and it was causing the installation to fail. When I removed that file - installation succeeded.

So this bug should be closed or this is an actual bug with Darwin Sandboxes?

@ariscn
Copy link

ariscn commented Sep 23, 2015

Just tried again from my work laptop (no prior Nix install). nix-channel --update works, but nix-env -qas still fails with a long list of failures:

download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/78rf1156ac5xq8gh33jjs61xk761jadi.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/q0y5yqjmxg8ixa665p0naw0kwn589959.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/b8vmfi804j32fagal16lxcabh420zdda.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/13w7qpgg6i6npbf692zy1bn56n2fyl33.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/almi2hmxj8qay77cfyrfmvv3nsmmr1kl.narinfo’ after 5 seconds...
<more like this>

@wmertens
Copy link
Contributor

Those are probably not failures, they just mean your internet connection is
slow, is that possible?

On Thu, Sep 24, 2015, 01:25 ariscn [email protected] wrote:

Just tried again from my work laptop (no prior Nix install). nix-channel
--update, but nix-env -qas still fails with a long list of failures:

download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/78rf1156ac5xq8gh33jjs61xk761jadi.narinfo’ after 5 seconds...download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/q0y5yqjmxg8ixa665p0naw0kwn589959.narinfo’ after 5 seconds...download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/b8vmfi804j32fagal16lxcabh420zdda.narinfo’ after 5 seconds...download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/13w7qpgg6i6npbf692zy1bn56n2fyl33.narinfo’ after 5 seconds...download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/almi2hmxj8qay77cfyrfmvv3nsmmr1kl.narinfo’ after 5 seconds...


Reply to this email directly or view it on GitHub
#9215 (comment).

Wout.
(typed on mobile, excuse terseness)

@offlinehacker
Copy link
Contributor

Or that you have some rate limiting on router.

V čet., 24. sep. 2015 6:48 dop. je oseba Wout Mertens <
[email protected]> napisala:

Those are probably not failures, they just mean your internet connection is
slow, is that possible?

On Thu, Sep 24, 2015, 01:25 ariscn [email protected] wrote:

Just tried again from my work laptop (no prior Nix install). nix-channel
--update, but nix-env -qas still fails with a long list of failures:

download-from-binary-cache.pl: still waiting for ‘
https://cache.nixos.org/78rf1156ac5xq8gh33jjs61xk761jadi.narinfo’ after 5
seconds...download-from-binary-cache.pl: still waiting for ‘
https://cache.nixos.org/q0y5yqjmxg8ixa665p0naw0kwn589959.narinfo’ after 5
seconds...download-from-binary-cache.pl: still waiting for ‘
https://cache.nixos.org/b8vmfi804j32fagal16lxcabh420zdda.narinfo’ after 5
seconds...download-from-binary-cache.pl: still waiting for ‘
https://cache.nixos.org/13w7qpgg6i6npbf692zy1bn56n2fyl33.narinfo’ after 5
seconds...download-from-binary-cache.pl: still waiting for ‘
https://cache.nixos.org/almi2hmxj8qay77cfyrfmvv3nsmmr1kl.narinfo’ after 5
seconds...


Reply to this email directly or view it on GitHub
#9215 (comment).

Wout.
(typed on mobile, excuse terseness)


Reply to this email directly or view it on GitHub
#9215 (comment).

@ariscn
Copy link

ariscn commented Sep 24, 2015

No, it's very unlikely that it's a network issue - multiple computers on multiple networks, including a very fast office LAN. nix-env is definitely hanging.

@gridaphobe
Copy link
Contributor

@ariscn I see those messages every now and then, mostly when pulling packages from hydra (the build server), but I've never seen one turn fatal.

Can you post a full log, including when/how nix-env finally fails?

EDIT: this is on OSX 10.10.5

@ariscn
Copy link

ariscn commented Sep 24, 2015

@gridaphobe Sure thing. Is there any debugging I should enable?

$ nix-env -qas
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/wvxwl86wfbvh2jv879d35f58xhgim7qy.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/30fd8s2v8mawnfqk3y2395jahmz96ivd.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/9pm5kqsjvdwjjpc4db7p23h5kmyya600.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/58cx282ca1y3ds0lnkkkmczwk9giqb53.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/n5zlqsqnfifiq5fsk61ahsq7hgrpw9zg.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/4i7iahwg7xcldx3fc2p8pwd584j9kzsd.narinfo’ after 5 seconds...
<6500 more lines like this>

Hm! I let nix-env run longer this time than I have previously, and it does eventually complete. After those 6500 errors, it outputs the same number of packages:

download-from-binary-cache.pl: still waiting for ‘https://cache.nixos.org/chijns3mb6fp868gsr8vvzxdwvy12x6d.narinfo’ after 5 seconds...
---  3dpong-0.5
---  915resolution-0.5.2
<...>

This is a combination of user error and bad UX. If on the first run - where I am literally just following the tutorial docs - nix-env spams thousands of download errors, I naturally assumed that things were broken.

So, since OS X is not actually broken (yay!), the new set of questions is:

  • Why does nix-env consistently generate these timeouts for me on first run? Two different OS X laptops, different networks, repeated tries on different days.
  • Can the error output be made less noisy?

@gridaphobe
Copy link
Contributor

Actually, I can confirm this, but only when running nix-env -qas (which I never do because it usually throws an exception on darwin, nix-env -qaP works quite well for searching).

Given that this only happens for nix-env -qas, I'm inclined to believe it has something to do with nix itself, not nixpkgs. So we probably want to move this issue to the nix repo. /cc @edolstra

@gridaphobe
Copy link
Contributor

@retrry that's to be expected if you're using the default settings on darwin. The build-use-chroot option is only supported by the alternative, pure stdenv (https://nixos.org/wiki/Nix_on_OS_X#The_Pure_Darwin_stdenv).

So let's close this issue and open a separate one to track the weird nix-env -qas business.

@ariscn
Copy link

ariscn commented Sep 24, 2015

@gridaphobe If nix-env -qas is going to error by default on OS X for now, can a note be added to the docs? It's a pretty rough new user experience when things break on step #3 of a tutorial!

@gridaphobe
Copy link
Contributor

Sure! Which docs, specifically? I believe the wiki is open for anyone to edit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

7 participants