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
723 stars 164 forks source link

Cannot bootstrap GHC on aarch64 #827

Closed tdimiduk closed 11 months ago

tdimiduk commented 1 year ago

I have a new mac (m2 cpu) and am trying to get reflex working on it (so I can build an iOS app for my obelisk project). I've got nix installed and (I believe) the caches enabled.

When I run try reflex I get

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...
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'shell-aarch64-darwin'
         whose name attribute is located at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:201:11

       … while evaluating attribute 'buildInputs' of derivation 'shell-aarch64-darwin'

         at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:243:11:

          242|           depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          243|           buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |           ^
          244|           depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Package ‘ghc-8.10.7’ in /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/development/compilers/ghc/8.10.7.nix:291 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.```

And then when I run with

export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1


I get 

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... error: … while calling the 'derivationStrict' builtin

     at /builtin/derivation.nix:9:12: (source not available)

   … while evaluating derivation 'shell-aarch64-darwin'
     whose name attribute is located at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:201:11

   … while evaluating attribute 'buildInputs' of derivation 'shell-aarch64-darwin'

     at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:243:11:

      242|           depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
      243|           buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
         |           ^
      244|           depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

   (stack trace truncated; use '--show-trace' to show the full trace)

   error: cannot bootstrap GHC on this platform


I am able to install and run ghc in nix (though 9.2.8 not 8.10)
matthunz commented 1 year ago

Same on m1

matt@Matts-MacBook-Air reflex-platform % ./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...
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'shell-aarch64-darwin'
         whose name attribute is located at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:201:11

       … while evaluating attribute 'buildInputs' of derivation 'shell-aarch64-darwin'

         at /nix/store/snsm9x6c5mx4k4axa590lx7y83h8ri7g-source/pkgs/stdenv/generic/make-derivation.nix:243:11:

          242|           depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          243|           buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |           ^
          244|           depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: cannot bootstrap GHC on this platform
ali-abrar commented 1 year ago

m1/m2 macos and aarch64-linux support will be ready soon: https://github.com/reflex-frp/reflex-platform/pull/804

ali-abrar commented 11 months ago

Fixed in 1.2.0.0