Can't install ghc-8.10.4 on Apple Silicon

Hi,

I can’t install packages like shellcheck on my mac laptop (Apple Silicon) due to ghe-8.10.4 not available. The exact error message looks like this:

$ nix-env -iA nixpkgs.shellcheck

installing 'shellcheck-0.7.2'
error: Package ‘ghc-8.10.4’ in /nix/store/z517n8mkks55pqyq3jc4h6x2q14k44y3-nixpkgs-21.11pre310022.14b0f20fa1f/nixpkgs/pkgs/development/compilers/ghc/8.10.4.nix:308 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)

Can someone help? Thanks!

1 Like

See ghc: enable build on aarch64-darwin (aka Apple Silicon) by prusnak · Pull Request #135345 · NixOS/nixpkgs · GitHub

1 Like

Thanks. Is it the case that once that PR is merged, I’ll be able to install GHC from the unstable channel?

Yes, that’s correct.

Fixed in master, give it a few hour for hydra to build the GHC for aarch64-darwin.

1 Like

@domenkozar thanks for working on this fix. I’ve been watching the github issue.

I just tried to install ghc from “unstable” and it seems that the version of ghc has been bumped to 8.10.6 somehow. Hence, I still can’t install ghc :joy:

Is there any way to use 8.10.6? It fixes a number of darwin packaging issues.

I don’t have the time to give 8.10.4 a try :slight_smile:

Just to be clear, ghc 8.10.6 fails to install with the same error. I am ok with any version of ghc.

Could you paste the full error?

I am afk but the error looks exactly the same as before.

I did nix channel update and that didn’t help

Channel hasn’t updated yet, as it was just merged. Tomorrow, if everything goes well.

I see. Will try again tomorrow. Thanks!

Has the channel been updated? How do I check that? I still can’t install ghc. Here’s the error:

> nix-env -iA nixpkgs.shellcheck
installing 'shellcheck-0.7.2'
error: Package ‘ghc-8.10.6’ in /nix/store/sf3lb1jxaj8gid7lyavcdn1jyp6r0bph-nixpkgs-21.11pre312229.08ef0f28e3a/nixpkgs/pkgs/development/compilers/ghc/8.10.6.nix:308 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)

https://status.nixos.org shows the current commit and time since last update

Thanks for sharing the status page! Looks like that @domenkozar 's change hasn’t been picked up by the unstable channel yet.

I wanted to confirm that I was able to install GHC 8.10.6 on my laptop now. Thanks for all the help!

3 Likes