reflex-frp / reflex-platform

A curated package set and set of tools that let you build Haskell packages so they can run on a variety of platforms. reflex-platform is built on top of the nix package manager.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
713 stars 163 forks source link

"cannot connect to socket" on macOS aarch64 #822

Closed lylek closed 7 months ago

lylek commented 1 year ago

I had nix already installed. So I cloned the repo, cd'd into it, and ran ./try-reflex:

% ./try-reflex
If you have any trouble with this script, please submit an issue at https://github.com/reflex-frp/reflex-platform/issues
Add binary caches for reflex to /etc/nix/nix.conf ?
1) Yes
2) No
3) Ask again next time
#? 1
/etc/nix/nix.conf already exists: creating backup - This requires root access.
Password:
backup saved at /etc/nix/nix.conf.2023-06-12T14:15:35Z.bak
Adding cache settings to /etc/nix/nix.conf - This requires root access.
Entering the reflex sandbox...
error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused
(use '--show-trace' to show detailed location information)

I'm running macOS 13.4 on aarch64, nix 2.12.0.

I ran ./try-reflex again and it said

Entering the reflex sandbox...

So perhaps the first error was a race condition, whereby it was trying to access the socket before it was created?

And then it finished with this error:

% ./try-reflex
If you have any trouble with this script, please submit an issue at https://github.com/reflex-frp/reflex-platform/issues
Entering the reflex sandbox...
trace: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `lib` instead. For more information see https://github.com/NixOS/nixpkgs/issues/108938
error: Package ‘ghc-8.10.4’ in /nix/store/fv90cbnl3q61a8zhxghzbimxgnk850hj-source/pkgs/development/compilers/ghc/8.10.4.nix:263 is not supported on ‘aarch64-darwin’, refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
ElvishJerricco commented 1 year ago

The /nix/var/nix/daemon-socket/socket socket is a multi-user install thing. I'm curious if that's how you have it installed or if you've done something more interesting.

lylek commented 1 year ago

I installed nix quite a while ago, but I certainly didn't do anything interesting. Since I have very little experience with nix, I just followed the instructions at https://nixos.org/download.html#nix-install-macos. It looks to me like that's a multi-user install. Is there a way I can check whether it's a multi-user install?

alexfmpe commented 1 year ago

error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused

This sounds vaguely familiar. Think I remember running into similar issues ~5 years ago when calling the nix installer on mac with sudo. It would cause havoc for normal use or something. IINM that went away when I removed nix alltogether and installed it normally, letting the installer script use sudo only when needed.

ali-abrar commented 7 months ago

Fixed in 1.2.0.0