When trying to install on macOS Mojave Beta, doing curl https://nixos.org/nix/install | sh, the install fails immediately after creating all the users with the following message:
~~> Setting up the build user nixbld32
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 32
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
Alright! We have our first nix at /nix/store/771l8i0mz4c8kry8cz3sz8rr3alalckg-nix-2.0.4
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
Referenced from: /nix/store/x38ln6gxa3myclbcw8a2mcg140s3mmmn-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
Reason: image not found
/var/folders/m7/gts5k4696tq8m2k0hhgyyy640000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.PrvF7O3m/unpack/nix-2.0.4-x86_64-darwin/install-multi-user: line 216: 8723 Abort trap: 6 sudo "$@"
---- oh no! --------------------------------------------------------------------
This is after I uninstalled Nix and upgraded from High Sierra. How can I fix this?
Did you remove the nixbld users after uninstall?
I have just removed all the users using sudo sysadminctl -deleteUser nixbldX and tried the install again, the same error persists:
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo install -m 0664 /var/folders/m7/gts5k4696tq8m2k0hhgyyy640000gn/T/tmp.XXXXXXXXXX.7qnmTJz8/.nix-channels /var/root/.nix-channels
to set up the default system channel (part 1)
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo rsync -rlpt ./store/0qr5axqkiq7shbzyjcpfvhkdqabh0cgs-curl-7.59.0 ./store/0znkd9y6cjn8snmq9vrkhhzds34pxfi5-nss-cacert-3.36.1 ./store/1n3038902kf1y6nskv1sjym76zi2dk14-gettext-0.19.8 ./store/23333zkdrw2vhg1lcy5jfqxhg7vy4grd-brotli-1.0.3-lib ./store/41zbaxfk0yxmg3x835qss1nbnr9d07sx-xz-5.2.3-bin ./store/771l8i0mz4c8kry8cz3sz8rr3alalckg-nix-2.0.4 ./store/7c28h8fanvhc2lh3dhql3gcrq8f22cwq-libsodium-1.0.16 ./store/7z42iwq7wz1bkgadd0pxv0sdlr9xnbkg-zlib-1.2.11 ./store/7zjx4v5pa8zr2qqb9fhr11fsibnv9fk2-gmp-6.1.2 ./store/ayqdw6fcsa8lxn1cykrpfbgn2fkihk8q-libssh2-1.8.0 ./store/gh9wn9f8yyycqc6hmyfy2ibghv7025mb-libc++abi-5.0.2 ./store/ikmhr8sglkmx25vkawbdblaxpw47520x-openssl-1.0.2o ./store/kmhxqmrkxcj3f2pvycv5yjz1zhynxz6y-libc++-5.0.2 ./store/lhj9v5jhqpjzfjfv8fk3v7x68zpymrnz-libatomic_ops-7.6.2 ./store/mii7hsrc58pm6g9711bndczlgyis9r85-libiconv-osx-10.11.6 ./store/qycnx8834z1w7gipzgd2x5hwlhfz8kd7-xz-5.2.3 ./store/r6rhvxyyarwivh53k2l4x2spispflaca-libkrb5-1.15.2 ./store/rgx1772hskw208c5qz7lwiv68pjm9vk5-gnutar-1.30 ./store/rjglqbbmg27dwwyyqsnn62jcz6qwxkli-bash-4.4-p12 ./store/rv4v4si5wha99bqjnbzyqy39v0d0ms46-aws-sdk-cpp-1.3.22 ./store/s8cnpl3kfmkfjp9p44w3mnxa1d14rsa3-sqlite-3.22.0 ./store/v6xid2gvsr8q1v6cy66z4hm38rhf0vmq-gzip-1.9 ./store/vdhgq8vhx6pqiv6g92jyrlzkwxkvbisb-nghttp2-1.24.0-lib ./store/x17m259z4cac95y0py8s4y78b6s95iii-ICU-osx-10.10.5 ./store/x38ln6gxa3myclbcw8a2mcg140s3mmmn-Libsystem-osx-10.11.6 ./store/xdmarzblx6vjp8g10ik7a3cipzk4yjfl-boehm-gc-7.6.4 ./store/xl3gz1dklm1i1p51hxxfrrkvfdmcyaiq-bzip2-1.0.6.0.1 ./store/yycd5j70n0nvmlhz0hrjsig0kx6zfs67-bzip2-1.0.6.0.1-bin ./store/z9imly1f3lwc90irij4gx9j9b1nn43ij-CF-osx-10.10.5 ./store/zrq8x931a6pvjj2w816y6bab45wanq39-coreutils-8.29 /nix/store/
to copy the basic Nix files to the new store at /nix/store
Alright! We have our first nix at /nix/store/771l8i0mz4c8kry8cz3sz8rr3alalckg-nix-2.0.4
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /nix/store/771l8i0mz4c8kry8cz3sz8rr3alalckg-nix-2.0.4/bin/nix-store --init
to initialize the Nix Database
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
Referenced from: /nix/store/x38ln6gxa3myclbcw8a2mcg140s3mmmn-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
Reason: image not found
/var/folders/m7/gts5k4696tq8m2k0hhgyyy640000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.e14GBX4x/unpack/nix-2.0.4-x86_64-darwin/install-multi-user: line 216: 11046 Abort trap: 6 sudo "$@"
---- oh no! --------------------------------------------------------------------
@bemeurer Does /usr/lib/system/libsystem_network.dylib exist on 10.14? If not we'll have to update our Libsystem definition in nixpkgs.
@LnL7 It does not, only libsystem_networkextension.dylib exists
mia:~ bemeurer$ ls /usr/lib/system/ | grep -i network
libsystem_networkextension.dylib
So is that the only removed lib? For instance, this file has all of the ones we expect:
Yeah, similar to libsystem_coretls with 10.13 but that might not be the only problem ofcorse.
Using this hacked-together script I checked that only the file in question seems to be missing
while read p; do if [[ $p == \#* ]]; then continue; fi; if [ -f $p ]; then echo "Found: $p"; else echo "Missing: $p";fi; done < <(curl https://raw.githubusercontent.com/NixOS/nixpkgs/740d76371e6c1c76bae4801fc5b736a796c1ebbe/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries)
Found: /usr/lib/system/libcache.dylib
Found: /usr/lib/system/libcommonCrypto.dylib
Found: /usr/lib/system/libcompiler_rt.dylib
Found: /usr/lib/system/libcopyfile.dylib
Found: /usr/lib/system/libcorecrypto.dylib
Found: /usr/lib/system/libdispatch.dylib
Found: /usr/lib/system/libdyld.dylib
Found: /usr/lib/system/libkeymgr.dylib
Found: /usr/lib/system/liblaunch.dylib
Found: /usr/lib/system/libmacho.dylib
Found: /usr/lib/system/libquarantine.dylib
Found: /usr/lib/system/libremovefile.dylib
Found: /usr/lib/system/libsystem_asl.dylib
Found: /usr/lib/system/libsystem_blocks.dylib
Found:
Found:
Found: /usr/lib/system/libsystem_configuration.dylib
Found: /usr/lib/system/libsystem_coreservices.dylib
Found: /usr/lib/system/libsystem_dnssd.dylib
Found: /usr/lib/system/libsystem_info.dylib
Found:
Found:
Found: /usr/lib/system/libsystem_m.dylib
Found: /usr/lib/system/libsystem_malloc.dylib
Missing: /usr/lib/system/libsystem_network.dylib
Found: /usr/lib/system/libsystem_networkextension.dylib
Found: /usr/lib/system/libsystem_notify.dylib
Found: /usr/lib/system/libsystem_platform.dylib
Found: /usr/lib/system/libsystem_pthread.dylib
Found: /usr/lib/system/libsystem_sandbox.dylib
Found: /usr/lib/system/libsystem_secinit.dylib
Found: /usr/lib/system/libsystem_trace.dylib
Found: /usr/lib/system/libunc.dylib
Found: /usr/lib/system/libunwind.dylib
Found: /usr/lib/system/libxpc.dylib
Also,
$ otool -L /usr/lib/libSystem.dylib
/usr/lib/libSystem.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
/usr/lib/system/libcache.dylib (compatibility version 1.0.0, current version 81.0.0)
/usr/lib/system/libcommonCrypto.dylib (compatibility version 1.0.0, current version 60118.200.5)
/usr/lib/system/libcompiler_rt.dylib (compatibility version 1.0.0, current version 63.4.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 602.200.36)
/usr/lib/system/libdispatch.dylib (compatibility version 1.0.0, current version 1008.200.66)
/usr/lib/system/libdyld.dylib (compatibility version 1.0.0, current version 622.0.0)
/usr/lib/system/libkeymgr.dylib (compatibility version 1.0.0, current version 30.0.0)
/usr/lib/system/liblaunch.dylib (compatibility version 1.0.0, current version 1336.200.74)
/usr/lib/system/libmacho.dylib (compatibility version 1.0.0, current version 917.0.0)
/usr/lib/system/libquarantine.dylib (compatibility version 1.0.0, current version 86.200.8)
/usr/lib/system/libremovefile.dylib (compatibility version 1.0.0, current version 45.200.2)
/usr/lib/system/libsystem_asl.dylib (compatibility version 1.0.0, current version 356.200.3)
/usr/lib/system/libsystem_blocks.dylib (compatibility version 1.0.0, current version 73.0.0)
/usr/lib/system/libsystem_c.dylib (compatibility version 1.0.0, current version 1272.200.23)
/usr/lib/system/libsystem_configuration.dylib (compatibility version 1.0.0, current version 963.200.18)
/usr/lib/system/libsystem_coreservices.dylib (compatibility version 1.0.0, current version 63.0.0)
/usr/lib/system/libsystem_darwin.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/system/libsystem_dnssd.dylib (compatibility version 1.0.0, current version 878.200.26)
/usr/lib/system/libsystem_info.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/system/libsystem_m.dylib (compatibility version 1.0.0, current version 3158.200.6)
/usr/lib/system/libsystem_malloc.dylib (compatibility version 1.0.0, current version 166.200.46)
/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 172.200.14)
/usr/lib/system/libsystem_sandbox.dylib (compatibility version 1.0.0, current version 851.200.104)
/usr/lib/system/libsystem_secinit.dylib (compatibility version 1.0.0, current version 30.200.6)
/usr/lib/system/libsystem_kernel.dylib (compatibility version 1.0.0, current version 4903.200.249)
/usr/lib/system/libsystem_platform.dylib (compatibility version 1.0.0, current version 177.200.11)
/usr/lib/system/libsystem_pthread.dylib (compatibility version 1.0.0, current version 330.200.35)
/usr/lib/system/libsystem_symptoms.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/system/libsystem_trace.dylib (compatibility version 1.0.0, current version 906.200.60)
/usr/lib/system/libunwind.dylib (compatibility version 1.0.0, current version 35.4.0)
/usr/lib/system/libxpc.dylib (compatibility version 1.0.0, current version 1336.200.74)
@bemeurer Thanks for the information.
I made a tarball using https://github.com/LnL7/nixpkgs/commit/edfb283c16be021fbba0306193eb0e421ba5553c, it would be great if somebody could give that a try. Otherwise I'll look into setting up a vm.
https://files.daiderd.com/tmp/nix-2.0.4pre6073_9dc0af1-x86_64-darwin.tar.bz2
@LnL7 I have downgraded back to High Sierra since the Mojave beta is really broken and I needed to work. I can try setting up a VM as well.
I'm getting this whenever I try to use any nix related command (nix-env, nix-store, nix-channel, nix-shell, etc):
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
[4] 49049 abort
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
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
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
[5] 49052 abort
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
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
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
[5] 49055 abort
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
Referenced from: /nix/store/l2f9jq4j07ip81h3c538g1d1wac3dq3h-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
Reason: image not found
It's pretty obvious that this is a problem of compatibility with some system libraries that have disappeared, my only concern is how can I fix this if I can't even perform a nix-channel --update.
@jbddc Is that using my tarball? If so you'll also have to use my nixpkgs branch to build packages, but that means there are no caches yet.
I'm pretty sure we'll also need to build a new bootstrap tarball, then we can push it to a wip branch or staging to start making compatible binaries with hydra.
/cc @copumpkin
my only concern is how can I fix this if I can't even perform a nix-channel --update
The "right" way to fix this is to reinstall Nix (with ALLOW_PREEXISTING_INSTALLATION to avoid uninstalling Nix).
I'm a nix noob, but using @LnL7 tar's and nixpkgs (via nix-env -f /path/to/local/repo) works for me as far I can test it. I would love to provide some feedback & my testability for macOS Mojave 10.14
I got some additional failures on the latest public beta:
Undefined symbols for architecture x86_64:
"___cVersionNumber", referenced from:
-reexported_symbols_list command line option
"___cVersionString", referenced from:
-reexported_symbols_list command line option
ld: symbol(s) not found for architecture x86_64
Undefined symbols for architecture x86_64:
"___kernelVersionNumber", referenced from:
-reexported_symbols_list command line option
"___kernelVersionString", referenced from:
-reexported_symbols_list command line option
ld: symbol(s) not found for architecture x86_64
Removing these lines from pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_c_symbols and pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols seems to get me a bit further, but I'm still mid-build so I'm not sure if that breaks the world, yet.
EDIT: Going to try https://github.com/LnL7/nixpkgs/commit/5024e4aa39d6d2ddfe52ee481f7a1f728d5b8d1e in my local checkout before I go deleting external symbols in earnest. Also downloading the XCode beta, just in case.
EDIT2: Still got the undefined symbol errors, so I've got a build going with those deleted. Fingers crossed.
EDIT3: Got through a basic build without any obvious issues. Rebuilding my full environment now.
Since this is apparently still a bit in flux we should probably wait a bit longer before adding changes to nixpkgs.
Following problem:
$ nix-env -f nixpkgs -i hello
replacing old 'hello-2.10'
installing 'hello-2.10'
building '/nix/store/pzsx4kfvd1a4b3fi21r13i9kfwd1198i-user-environment.drv'...
created 17 symlinks in user environment
md5-20499ff513ebd42645591ceba02ff377
$ which hello
md5-20499ff513ebd42645591ceba02ff377
/Users/jloos/.nix-profile/bin/hello
md5-20499ff513ebd42645591ceba02ff377
$ hello
md5-20499ff513ebd42645591ceba02ff377
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
Referenced from: /nix/store/q819d3vjz7vswpvkrfa9gck3ys8rmvcj-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
Reason: image not found
[1] 17631 abort hello
So the nixpkgs in nix-env -f nixpkgs -i hello is a git cloned repo from https://github.com/LnL7/nixpkgs/commit/5902e11cd650e8eb53e9e507aef6ff6afe9fbce8
Am I using the repository in a wrong way?
Finally got through a build with no substitutions. I keep getting unexpected end-of-file when darwin-rebuild goes to download nix-cache-info, but I have no idea how to troubleshoot that other than to try other substituters (cache.nixos and the reflex-frp one both give me the error, so I鈥檓 a bit stuck on that one).
@jhenahan So what was that undefined symbols issue? Did you manage to resolve it?
@LnL7 I don鈥檛 think this is in flux by now, I don鈥檛 think that Apple will be breaking anything else dramatically after the public betas are out. What do we lose by merging the fix into nixpkgs?
@kirelagin Removing the undefined symbols from those files seems to have done the trick. My entire config built with substitute = false to get around the nix-cache-info issue, though that seems to be fine, now, so that may just have been a hiccup on cache.nixos.org. Now I just have to wait for the Emacs team to figure out whatever weirdness Mojave introduced that breaks the GUI and I'll be golden! :)
Happy to push a PR with those changes if I can get confirmation that removing them won't have weird consequences for users on older versions of macOS.
After using @LnL7's tarball, I'm still getting this error:
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
There is still one dynamic library that has been moved/removed in Mojave, I believe.
After using @LnL7's tarball, I'm still getting this error: ...
@jbdd:
You鈥檒l have to make sure that your NIX_PATH points to a nixpkgs checkout with the change, too, otherwise you鈥檒l pull in the broken Libsystem. I just use a local nixpkgs repo with those changes cherry picked in.
@jbddc I don't know if this is a good choice. I just run sudo rm -rf (hash)--Libsystem-osx-10.11.6 and everything is going well till now...
@AurevoirXavier yeah that kinda worked. Thanks!
Just as a gentle reminder: now that the necessary changes (https://github.com/NixOS/nixpkgs/issues/42719) have been merged to master in nixpkgs, what needs to be done to fix the Mac installer? Is it just cutting a new release of Nix, and if so, is there a specific way to trigger that? Or at least, add this to some list of things that will trigger it once it weighs enough?
Well, Nix releases are currently built from the 18.03 branch, so it's not enough to have the fix in master. Is the fix safe to cherry-pick in 18.03?
FYI the latest binary tarball + installer script are at https://hydra.nixos.org/job/nix/master/binaryTarball.x86_64-darwin/latest and https://hydra.nixos.org/job/nix/master/installerScript/latest.
I'm still running some builds to test the 18.03 backport just to be sure, but once those are finished we should be good to go.
For the non-nix experts like me, this is how I got it installing (in a clean system), from @edolstra's tarball:
$ wget https://hydra.nixos.org/build/80108588/download/1/nix-2.1pre6381_c651b7bd-x86_64-darwin.tar.bz2
$ gunzip -c nix-2.1pre6381_c651b7bd-x86_64-darwin.tar.bz2 | tar xopf -
$ rm -r nix-2.1pre6381_c651b7bd-x86_64-darwin/store/yvkvyvc36l2dmwl22vajc8bdg7fv3p6b-Libsystem-osx-10.11.6
$ nix-2.1pre6381_c651b7bd-x86_64-darwin && ./install
I was then finally able to run nix-shell -p nix-info --run "nix-info -m" after.
I'm sure there's probably something I need in Libsystem-osx-10.11.6, but at least this gets me to the next step.
The backport is ready now, 18.03 should be compatible since https://hydra.nixos.org/eval/1475530 and the channel has already updated.
@edolstra Everything should be ready, but it's probably fine to wait for a release with actual content (like https://github.com/NixOS/nix/pull/2371? 馃槃) since Mojave is probably still in beta for a while longer.
I think this can be closed now.
@LnL7 Has the updates to fix this issue been released? I'm still experiencing this issue with the latest release of Mojave 10.14
@vai0 Try reinstall nix after upgrading from high serria.
@AurevoirXavier Didn't work :/. My eventual solution was to delete all references to *Libsystem-osx-10.11.6* in /nix/store. Not sure if this will cause problems later down the road.
Now you have broken store paths, and nix-store --verify --repair will either fail or restore the problem. Nix 2.1 with a reasonably recent nixpkgs channel will work.
@vai0 But you dont have to do that. This problem was fixed since last two updates release. And reinstalling works for me.
Problem solved. I was pinning the nixpkgs in my project, thanks!
Most helpful comment
The backport is ready now, 18.03 should be compatible since https://hydra.nixos.org/eval/1475530 and the channel has already updated.
@edolstra Everything should be ready, but it's probably fine to wait for a release with actual content (like https://github.com/NixOS/nix/pull/2371? 馃槃) since Mojave is probably still in beta for a while longer.