Repository navigation
Install freezes immediately at the beginning on macOS #8002
Description
Activity
So, what I did was to run the install scripts with the
set -xand this is what I get:❯ /var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin/install + umask 0022 + dest=/nix ++ dirname /var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin/install + self=/var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin + nix=/nix/store/8w0v2mffa10chrf1h66cbvbpw86qmh85-nix-2.13.3 + cacert=/nix/store/pl497357lkfpvdr8v4pfan16k7jna2l2-nss-cacert-3.83 + '[' -e /var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin/.reginfo ']' + '[' -z mirosval ']' + '[' -z /Users/mirosval ']' ++ uname -s + '[' Darwin = Darwin ']' + IFS=. + read -r macos_major macos_minor macos_patch ++ sw_vers -productVersion + '[' 13 -lt 10 ']' + '[' 13 -eq 10 ']' + '[' 2 -eq 12 ']' ++ uname -s + '[' Darwin = Linux ']' + case "$(uname -s)" in ++ uname -s + INSTALL_MODE=daemon + ACTIONS= + '[' 0 -gt 0 ']' + '[' daemon = daemon ']' + printf '\e[1;31mSwitching to the Multi-user Installer\e[0m\n' Switching to the Multi-user Installer + exec /var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin/install-multi-user ++ set -o pipefail ++ readonly NIX_DAEMON_DEST=/Library/LaunchDaemons/org.nixos.nix-daemon.plist ++ NIX_DAEMON_DEST=/Library/LaunchDaemons/org.nixos.nix-daemon.plist ++ readonly NIX_VOLUME_CREATE=1 ++ NIX_VOLUME_CREATE=1 ++ NIX_FIRST_BUILD_UID=301 ++ NIX_BUILD_USER_NAME_TEMPLATE=_nixbld%d ++ read_only_root ++ case "$(/usr/bin/touch / 2>&1)" in +++ /usr/bin/touch / ++ return 0 ++ '[' 1 = 1 ']' ++ . /var/folders/s1/gp_m07r53kzb77nvdzgj8bzc0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.4tR2RpHf/unpack/nix-2.13.3-aarch64-darwin/create-darwin-volume.sh no-main +++ set -exu +++ set -o pipefail +++ '[' no-main = no-main ']' +++ shift +++ readonly _CREATE_VOLUME_NO_MAIN=1 +++ _CREATE_VOLUME_NO_MAIN=1 +++ readonly NIX_VOLUME_FS=APFS +++ NIX_VOLUME_FS=APFS +++ readonly 'NIX_VOLUME_LABEL=Nix Store' +++ NIX_VOLUME_LABEL='Nix Store' ++++ root_disk_identifier ++++ local special_device +++++ /usr/bin/stat -f %Sd / ++++ special_device=disk3s5 ++++ echo disk3 +++ readonly NIX_VOLUME_USE_DISK=disk3 +++ NIX_VOLUME_USE_DISK=disk3 +++ NIX_VOLUME_USE_SPECIAL= +++ NIX_VOLUME_USE_UUID= +++ readonly NIX_VOLUME_MOUNTD_DEST=/Library/LaunchDaemons/org.nixos.darwin-store.plist +++ NIX_VOLUME_MOUNTD_DEST=/Library/LaunchDaemons/org.nixos.darwin-store.plist +++ /usr/bin/fdesetup isactive +++ NIX_VOLUME_DO_ENCRYPT=1 +++ '[' 1 = 1 ']' +++ '[' -n '' ']' + welcome_to_nix + ok 'Welcome to the Multi-User Nix Installation' + _textout '\033[32m' 'Welcome to the Multi-User Nix Installation' + echo -en '\033[32m' + shift + '[' 'Welcome to the Multi-User Nix Installation' = '' ']' + echo 'Welcome to the Multi-User Nix Installation' Welcome to the Multi-User Nix Installation + echo -en '\033[0m' + catAt this point the installer gets stuck
I have tried installing using https://crates.io/crates/nix-installer and that worked.
Here's that invocation in the script:
nix/scripts/install-multi-user.sh
Lines 698 to 719 in e8415dc
cat <<EOF This installation tool will set up your computer with the Nix package manager. This will happen in a few stages: 1. Make sure your computer doesn't already have Nix. If it does, I will show you instructions on how to clean up your old install. 2. Show you what I am going to install and where. Then I will ask if you are ready to continue. 3. Create the system users and groups that the Nix daemon uses to run builds. 4. Perform the basic installation of the Nix files daemon. 5. Configure your shell to import special Nix Profile files, so you can use Nix. 6. Start the Nix daemon. EOF If it's blocking on something as simple as
catand a HEREDOC, I guess it's worth seeing if there's something unexpected aboutcatorbashon your system.Might be able to diagnose with output of a few commands:
type -a cat bashcat --versionbash --version
I don't think I've ever seen bash just hang on a HEREDOC, but I was able to find an SO thread where a number of macOS users are reporting exactly this: https://stackoverflow.com/questions/65267006/bash-heredoc-hangs-when-more-than-512-characters
If you do happen to have a modern bash on your PATH, it might be interesting to see if the installer runs clean if you modify your PATH to exclude it before running?
Reacted by John Ericson and Miroslav ZoričákThanks for exploring this @abathur. That's cursed stuff I would not have guessed!
Reacted by Travis A. Everett❯ type -a cat bash cat is /bin/cat bash is /opt/homebrew/bin/bash bash is /bin/bash bash is /opt/homebrew/bin/bash❯ cat --version cat: illegal option -- - usage: cat [-belnstuv] [file ...]
🤷🏻♂️
❯ bash --version GNU bash, version 5.2.15(1)-release (aarch64-apple-darwin22.1.0) Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
So what I've done to repro this is I copied that
catcommand from the script and when I run it with#!/bin/bashat the top, it works, but#!/usr/bin/env bashdoes not.#!/bin/bash # <- works #!/usr/bin/env bash # <- broken set -ex cat <<EOF This installation tool will set up your computer with the Nix package manager. This will happen in a few stages: 1. Make sure your computer doesn't already have Nix. If it does, I will show you instructions on how to clean up your old install. 2. Show you what I am going to install and where. Then I will ask if you are ready to continue. 3. Create the system users and groups that the Nix daemon uses to run builds. 4. Perform the basic installation of the Nix files daemon. 5. Configure your shell to import special Nix Profile files, so you can use Nix. 6. Start the Nix daemon. EOF
The default bash was installed using
brew install bashand the/bin/bashis the system one:❯ /bin/bash --version GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22) Copyright (C) 2007 Free Software Foundation, Inc.
Reacted by Travis A. Everett@mirosval Interesting :)
Thanks for the good repro. I tried this out on my Intel mac.
-
It worked fine for me in brew-installed bash 5.2.15 with version:
$ /usr/local/bin/bash --version GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin19.6.0) ...
-
It worked fine for me in a nix-installed bash 5.2.15 with version:
$ /run/current-system/sw/bin/bash --version GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin22.2.0) ...
Since you got Nix installed with the rust installer, can you give this repro one more try with a Nix-installed bash 5.2?
(I'm wondering if this is a bash ARM bug we should report up the chain?)
-
I'm so sorry for this, but it looks like it works fine with the nix-installed bash. I was actually not able to reproduce the issue even with brew bash again today :(
- addedmacosNix on macOS, aka OS X, aka darwinNix on macOS, aka OS X, aka darwin
on Mar 16, 2023
Platform
Additional information
I'm pretty new to nix, I've installed it on one machine successfully yesterday, but today the install freezes. I just used the install command from the home page and it got stuck at "Welcome to the Multi-User Nix Installation". I cancelled it after about a minute. I tried a couple of times after that, but same result.
Output
Output
Priorities
Add 👍 to issues you find important.