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

Nix is completely broken after major macOS update #2444

Open
lilyball opened this issue Sep 24, 2018 · 30 comments
Open

Nix is completely broken after major macOS update #2444

lilyball opened this issue Sep 24, 2018 · 30 comments
Labels
installer macos Nix on macOS, aka OS X, aka darwin

Comments

@lilyball
Copy link
Member

After updating macOS to 10.14 Mojave, Nix is completely broken, giving me an error saying something about I think libSystem_networking.dylib being missing (I apologize for not having the exact error text, I already blew away my local installation).

My recollection is I went through the same issue when upgrading from macOS 10.12 to 10.13, where I had to completely reinstall Nix and my Nix-installed packages.

It would be fantastic if this issue did not happen again next year when upgrading to macOS 10.15.

@edolstra
Copy link
Member

It's pretty much a certainty that it will break on 10.15, because, well, that's macOS :-)

@domenkozar
Copy link
Member

domenkozar commented Sep 25, 2018

Maybe install script should safeguard macos to be set to known tested versions? Although that won't prevent macOS upgrades...

@lilyball
Copy link
Member Author

lilyball commented Sep 25, 2018 via email

@kahlil29
Copy link

Having the same issue.
Reinstalled but still getting the following error (that I got after upgrading on my older installation)

dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/wrl2sxy6yqgm7w7ii1515jxndncc7545-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found

Completely stuck here.

@domenkozar
Copy link
Member

@kahlil29 did you upgrade to Nix 2.1?

@kahlil29
Copy link

kahlil29 commented Sep 26, 2018

@domenkozar I nuked my installation and ran it again from scratch via

curl https://nixos.org/nix/install | sh

It installed Nix version 2.1.2
It gave me the same error after that.

@kahlil29
Copy link

Is there no known workaround for this?
I tried the solution given here as well with the tar file by @LnL7 Temp Solution but that ended up giving me the same error.

I have now resorted to running an Ubuntu VM on my system and had to install everything from scratch.

@LnL7
Copy link
Member

LnL7 commented Sep 26, 2018

The issue you describe was fixed in 2.1. I have not upgraded myself, but I have helped somebody with the upgrade process so whatever this is it's something specific to your system. Either something that isn't 2.1 or something from the previous install is interfering.

@kahlil29
Copy link

@LnL7 Thanks for your input on this!
I'll try nuking everything properly once more and re-installing Nix 2.1 again.

@ajbouh
Copy link

ajbouh commented Oct 3, 2018

I just had this same issue. Doing the following at least allowed installation to complete without any Library not loaded errors.

sudo mv /nix /nix-old
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
unset SSL_CERT_FILE
unset NIX_PATH
# ... Reran installer

@kahlil29
Copy link

kahlil29 commented Oct 7, 2018

It's not my nix installation procedure that's triggering the error. Installation runs fine but the moment I go into my company's GitLab repo and run nix-shell -A shells.ghc ...it begins the download process and during that is where it comes up with the error(s). Still not able to resolve it.

@vai0
Copy link

vai0 commented Oct 8, 2018

I am encountering the same exact issue as @kahlil29. Ran through the steps to do a clean install. Installation runs just fine - it's just once I run nix-shell within my project it throws:

dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/46qj01lcjz48wb4hc7mvn3mhb3syda7h-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found

@LnL7
Copy link
Member

LnL7 commented Oct 9, 2018

What you describe sounds a lot more like an expression that uses a pinned nixpkgs that didn't have 10.14 support yet instead of an issue with the install.

@jordanst3wart
Copy link

jordanst3wart commented Oct 15, 2018

This does actually seem to be an issue with the individual packages. Reinstalling the individual packages fixes the issue for me (see below).

unknown at unknown in ~
$ micro
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/12yshvbpz9hjn7khzzf0ar67kaw6g7f7-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found
[1]    10652 abort      micro

unknown at unknown in ~
$ nix-env -e micro
uninstalling 'micro-1.4.0'
building '/nix/store/scgi90x34jj9f6f2mw6yj532hzhsd5jk-user-environment.drv'...
created 465 symlinks in user environment

unknown at unknown in ~
$ nix-env -i micro
warning: name collision in input Nix expressions, skipping '/Users/jordanstewart/.nix-defexpr/channels_root/nixpkgs'
replacing old 'micro-1.4.0'
installing 'micro-1.4.1'
these paths will be fetched (5.76 MiB download, 14.25 MiB unpacked):
  /nix/store/4w5hz6sh4924p2wqn2zp2gsc03wqd83p-micro-1.4.1-bin
  /nix/store/lss6icbzgvl1ns2ns74l56sxqdngwhpq-micro-1.4.1
copying path '/nix/store/4w5hz6sh4924p2wqn2zp2gsc03wqd83p-micro-1.4.1-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/lss6icbzgvl1ns2ns74l56sxqdngwhpq-micro-1.4.1' from 'https://cache.nixos.org'...
building '/nix/store/3a822vr0xn0n6isc2ka4619j5w8xiln2-user-environment.drv'...
created 469 symlinks in user environment

unknown at unknown in ~
$ micro
# works here

unknown at unknown in ~
$ nix-env --version
nix-env (Nix) 2.1.3

@s50600822
Copy link

pretty sure going for 2.1.3 will get #2193 instead.

@jbddc
Copy link

jbddc commented Nov 5, 2018

I am encountering the same exact issue as @kahlil29. Ran through the steps to do a clean install. Installation runs just fine - it's just once I run nix-shell within my project it throws:

dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/46qj01lcjz48wb4hc7mvn3mhb3syda7h-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found

I'm also getting this error and already nuked my nix install and installed it again. :/

@copumpkin
Copy link
Member

@jordanst3wart yeah, if you use nix-env, packages will stay at whatever version they were at when you installed them until you upgrade them, even if you update your channel. If that version was built on a foundation that was incompatible with Mojave, they'll break.

@jbddc @kahlil29 we need more information to debug something like that. What expression led to that? Do you have any idea which program is crashing with that error? There might be crash logs in Console.app for example.

@s50600822
Copy link

Hi if #2518 is addressed, I can use latest Nix on macOS can anyone help ?

@jbddc
Copy link

jbddc commented Nov 8, 2018

@jordanst3wart yeah, if you use nix-env, packages will stay at whatever version they were at when you installed them until you upgrade them, even if you update your channel. If that version was built on a foundation that was incompatible with Mojave, they'll break.

@jbddc @kahlil29 we need more information to debug something like that. What expression led to that? Do you have any idea which program is crashing with that error? There might be crash logs in Console.app for example.

Well, I can confirm that I can install packages using nix-env, which I suppose calls the most recent channel of nixpkgs-unstable.
What I was trying to install, however, was haskellR using the --nix flag with stack. I subsequently got the aforementioned library not loaded error. On the other hand, I had no issues installing the package using --docker.

If the issue is related to the main project (haskellR that is) having an older version of nixpkgs pinned, then I think this workflow is not sustainable if nix is to be adopted by the masses. macOS upgrades breaking packages like this makes me think that either:

  1. The de facto way of writing nix expressions for darwin packages is wrong
  2. The way that nix abstracts macOS system libraries and files could be improved to take into account its dynamic shift of location from upgrade to upgrade
  3. Apple just likes to mess with developers and completely change it's OS's "infrastructure" every year :/

@drever
Copy link

drever commented Nov 11, 2018

I ran into the same problem when trying to install miso. I seems to be pinned to Libsystem-osx-10.11.6. I there any way to fix this?

@kahlil29
Copy link

@copumpkin I think my issue was due to bytestring-trie
In a more recent version there has been some change to do with monoid and semigroup that causes the version I have not to build with GHC 8.4.3
I think the fix is to use a patched version of the package locally, but I haven't got down to trying it yet, hopefully in the next few days.
Check this issue : reflex-frp/reflex-platform#398
So in conclusion, my issue is nothing nix-specific, from what I gather.

@newhoggy
Copy link

I'm experience this issue:

$ git clone git@github.com:mankyKitty/fantastic-waddle.git
$ cd fantastic-waddle
$ nix build -f release.nix
builder for '/nix/store/1mj7i40s6h363y10b2w9cgfjr5jr64ff-stdenv-darwin-boot-0.drv' failed due to signal 6 (Abort trap: 6); last 3 log lines:
  dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
    Referenced from: /nix/store/cp0dhigj0lxg96d5m5qmdws4k417jvy2-bootstrap-tools/lib/libSystem.B.dylib
    Reason: image not found

@vai0
Copy link

vai0 commented Mar 14, 2019

@newhoggy Could possibly be that the project is pinning an older nixpkgs that doesn't have the MacOS fixes

@kitlangton
Copy link

kitlangton commented May 10, 2019

I'm also experiencing this issue

copying path '/nix/store/ndsv1isl9zkzkw56q4l71x51hrbgn7y1-stdenv-darwin' from 'https://cache.nixos.org'...
building '/nix/store/9gxq1wp55n5l2y16hp33l67byvdksm5i-source.drv'...
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/naqkzg617irnxzxq84jskczbc6544l5j-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found

@mtesseract
Copy link

@kitlangton For me a similar build failure was fixed by updating the project's pinned Nixpkgs version.
This is what @vai0 also hinted at.

@kitlangton
Copy link

kitlangton commented Jul 11, 2019

I'm still experiencing this issue, nothing seems to fix it. Has anyone who has experienced this issue been able to fix it?

@chreekat
Copy link
Contributor

chreekat commented Sep 4, 2019

I think this issue is fixed in Nixpkgs, but can someone point to the sha where it got fixed?

@domenkozar domenkozar added macos Nix on macOS, aka OS X, aka darwin installer labels Apr 30, 2020
@stale
Copy link

stale bot commented Feb 14, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 14, 2021
@koalalorenzo
Copy link

I just upgraded to a minor version and got a similar issue.

@stale stale bot removed the stale label Nov 9, 2023
@grahamc
Copy link
Member

grahamc commented Nov 9, 2023

Hey y'all, I don't usually talk about the Determinate Nix Installer here, since I think it is typically off topic. However, in this case I think it might help a lot of people. We've recently fixed this problem in the Determinate Nix Installer, which you can get like this:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Note it does have some minor differences from the upstream Nix installer, which you can read about in its README: https://github.com/determinateSystems/nix-installer#installation-differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer macos Nix on macOS, aka OS X, aka darwin
Projects
None yet
Development

No branches or pull requests