6

I was trying to run a Nix command to build a project:

nix build -f default.nix plutus.haskell.packages.plutus-core.components.library

and I received this error!

error: attribute 'aarch64-darwin' missing, at /nix/store/cyfj6bd0n0ckvkm67mhjyg1qcvrfgsg9-source/artifact.nix:11:10

Is 'aarch64-darwin' referring to 64 bit architecture?

3 Answers3

6

I had the same issue and I changed the nix conf to use the x86_64-darwin architecture. So basically I edited the /etc/nix/nix.conf and leave it like this:

substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
# system = aarch64-darwin
system = x86_64-darwin
extra-platforms = x86_64-darwin aarch64-darwin

And the just run:

nix-env -iA nixpkgs.nix

To load the new pkgs related to the new architecture. The source that I used is: https://www.reddit.com/r/cardano/comments/mmzut6/macos_plutus_playground_build_instructions/ https://github.com/NixOS/nixpkgs/issues/95903#issuecomment-869041761

Max Opitz
  • 61
  • 2
  • I would recommend to leave the `system` setting at the native architecture. You can add `--option system x86_64-darwin` when needed. If cardana is your only use case, perhaps it's easier to make intel default though, for now. – Robert Hensing Aug 23 '21 at 12:58
2

Your M1 chips is not rejecting your builds, but some Nix expression is not prepared for M1 yet.

plutus was written by IOHK iirc, so you can check with them what's the status of M1 support for their software. If they don't already have a GitHub issue or other communication about it, it may be helpful to tell them the output of, say, ls /nix/store/cyfj6bd0n0ckvkm67mhjyg1qcvrfgsg9-source as context for the error message when you report the issue. I'm sure they'd like to improve the error if you mention it; they have to edit that code anyway.

Robert Hensing
  • 6,708
  • 18
  • 23
1

These were my error messages for the M1 processor:

error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override (use '--show-trace' to show detailed location information)

error: attribute 'aarch64-darwin' missing

This is the command that worked for me:

```GC_DONT_GC=1 nix-shell --extra-experimental-features flakes  --option system x86_64-darwin
```