2

I'm preparing the Plutus Pioneer program and installing the environment.

After installing nix and updating the "IOHK binary cache", I tried to do nix build but it seems that it is building and compiling ghc as shown below and it takes a very long time.

MyMac$ nix build -f default.nix plutus.haskell.packages.plutus-core
trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
[1/1/619 built] building ghc-8.6.5 (buildPhase): clang-7: warning: argument unu

Current nix.conf

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=

sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
extra-experimental-features = nix-command
build-users-group = nixbld

I found the following warning message:

If you want to use Nix with this project, make sure to set up the IOHK binary cache. If you do not do this, you will end up building GHC, which takes several hours. If you find yourself building GHC, STOP and fix the cache.

Could you guide me how I can fix the cache?

Thanks in advance.

4
  • Is this on an m1 Mac? Binary cache doesn't have Mac arm binaries. Jan 12, 2022 at 13:55
  • Thanks for your comment, please see below spec of mine. (1.1 GHz Intel Core M, MacBook (Retina, 12-inch, Early 2015) it is a little older one. I've remove all nix installation and install again, found something different log as below but still it is trying to building ghc-8.6.5
    – Tae Euy
    Jan 12, 2022 at 22:39
  • MyMac$ nix build -f default.nix docs.site [1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: : [1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: [1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the materialized argument and run the 'updateMaterialized' script in 'passthru'. [1/109/730 built, 434 copied (1193.3 MiB), 438.4 MiB DL] building ghc-8.6.5 (buildPhase): "inplace/bin/ghc-stage1" -hisuf p_hi -osuf p_
    – Tae Euy
    Jan 12, 2022 at 22:42
  • I also saw warning: ignoring untrusted substituter 'https://hydra.iohk.io' with Nix in multi-user mode. It was fixed by specifying these substituters in /etc/nix/nix.conf rather than ~/.config/nix/nix.conf. It appears Nix reads both of these configuration files, but does not trust the substituters in the latter. Feb 21, 2022 at 23:05

1 Answer 1

4

It may be the case that you edited your nix.conf file after you launched nix-daemon. You would need to kill and start the daemon again to pick up the updated nix.conf:

$ sudo pkill nix-daemon

and then

$ sudo nix-daemon &

After that. Your non-root user will use substitutes.

source: https://docs.cachix.org/faq#why-is-nix-not-picking-up-on-any-of-the-pre-built-artifacts

3
  • 1
    Welcome to Cardano SE! As a new user be sure to take the Tour.
    – gRebel
    Jan 14, 2022 at 5:14
  • Thanks for your comments. I tried to solve this issue with various way so anyway I could solve this issue. But I'm not sure what make it run. anyway thanks for your help.
    – Tae Euy
    Jan 14, 2022 at 9:42
  • If your systems uses systemd to run services you can restart the daemon using sudo systemctrl restart nix-daemon.service
    – Skelli
    Jun 30, 2022 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.