7

I was doing the plutus pioneer program and ran into an error when starting a nix-shell at the top-level directory of the plutus-repository.

I ran into the same error on Ubuntu 20.04.2 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64) and NixOS (20.09.4029.4a154d47623 (Nightingale) on VirtualBox).

I also did set up the IOHK binary caches on both systems.

I got the following error when running nix-shell:

error: build of '/nix/store/z6w41a6dv151g2q95v91yywid7s8mkn5-Agda-plan-to-nix-pkgs.drv' failed
(use '--show-trace' to show detailed location information)

The nix-shell --show-trace command shows the following error:

error: while evaluating the attribute 'nativeBuildInputs' of the derivation 'ghc-shell-for-packages' at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/builder/shell-for.nix:115:5:
while evaluating 'chooseDevOutputs' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/attrsets.nix:475:22, called from undefined position:
while evaluating 'mergeInputs' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/mkshell/default.nix:14:17, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/mkshell/default.nix:32:23:
while evaluating anonymous function at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/builder/shell-for.nix:57:20, called from undefined position:
while evaluating the attribute 'name' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating 'sanitizeDerivationName' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/strings.nix:746:28, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating 'pipe' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:61:15, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/strings.nix:746:36:
while evaluating 'reverseApply' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:62:27, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:63:8:
while evaluating the attribute 'version' at /home/demo/plutus/nix/pkgs/default.nix:68:15:
while evaluating the attribute 'extraPackages.Agda' at /home/demo/plutus/nix/pkgs/haskell/extra.nix:98:31:
while evaluating the attribute 'hsPkgs' at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/overlays/haskell.nix:546:15:
while evaluating the attribute 'hsPkgs' at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/overlays/haskell.nix:526:43:
while evaluating anonymous function at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/lib/import-and-filter-project.nix:5:1, called from /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/overlays/haskell.nix:504:27:
build of '/nix/store/z6w41a6dv151g2q95v91yywid7s8mkn5-Agda-plan-to-nix-pkgs.drv' failed

Does anyone have an idea how to fix this? I couldn't find anything online or in the cardano forum.

EDIT: running nix-shell --show-trace I have the additional error:

error: while evaluating the attribute 'buildInputs' of the derivation 'ghc-shell-for-packages' at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/builder/shell-for.nix:117:5:
while evaluating 'chooseDevOutputs' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/attrsets.nix:475:22, called from undefined position:
while evaluating 'mergeInputs' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/mkshell/default.nix:14:17, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/mkshell/default.nix:31:17:
while evaluating anonymous function at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/builder/shell-for.nix:61:20, called from undefined position:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'plutus-metatheory-lib-plutus-metatheory-0.1.0.0' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the derivation attribute 'name' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating 'sanitizeDerivationName' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/strings.nix:746:28, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating 'pipe' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:61:15, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/strings.nix:746:36:
while evaluating 'reverseApply' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:62:27, called from /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/trivial.nix:63:8:
while evaluating the attribute 'version' at /cloud/cloud-lite/training/plutus-pioneer-program/plutus-other-repo/plutus/nix/pkgs/default.nix:67:15:
while evaluating the attribute 'extraPackages.Agda' at /cloud/cloud-lite/training/plutus-pioneer-program/plutus-other-repo/plutus/nix/pkgs/haskell/extra.nix:18:3:
while evaluating 'hackage-package' at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:456:11, called from /cloud/cloud-lite/training/plutus-pioneer-program/plutus-other-repo/plutus/nix/pkgs/haskell/extra.nix:18:10:
while evaluating the attribute 'hsPkgs.Agda' at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:536:15:
while evaluating the attribute 'hsPkgs' at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:516:43:
while evaluating 'mkCabalProjectPkgSet' at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:152:13, called from /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:501:30:
while evaluating the attribute 'buildPackages.haskell-nix.compiler."${(((plan-pkgs).pkgs  hackage)).compiler.nix-name}".version' at /nix/store/qrbp0y6mfscqhfhzivnhc91hvby45nv7-nixpkgs-src/lib/attrsets.nix:344:7:
while evaluating anonymous function at /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/lib/import-and-filter-project.nix:5:1, called from /nix/store/cf4ksa58yibwkmx2z83y7qd9zwpyjwmy-haskell.nix-src/overlays/haskell.nix:503:31:
build of '/nix/store/42ml953fywhg2i2fi4mqkq64v4fy512d-Agda-plan-to-nix-pkgs.drv' failed
5
  • On what revision of the plutus repository were you seeing this error? May 5 at 14:36
  • Latest release, i just cloned it yesterday.
    – Hamza
    May 5 at 15:42
  • Yes it looks like it's the same error,I'm still trying to fix it with no success so far. Which discord community are you referring to ?
    – Hamza
    May 5 at 19:56
  • Dunno if the link will work for you, for me it's a IOHK discord channel: discord.com/channels/826816523368005654/826822689427554365 moreover I have opened a github issue for Haskell.Nix in case they can help find the problem which seems to occur in the nix derivation of this library: github.com/input-output-hk/haskell.nix/issues/1109 May 5 at 23:09
  • I have suggested this question as a dupplicate, because if you look at the entire log it contains the same error warning: hash mismatch in fixed-output derivation '/nix/store/7y3jr1jvzkj2146h7sivw0sfr2bhap3j-ghc-8.4.4-x86_64-deb8-linux.tar.xz like in the question Hash MisMatch Error on Plutus and Nix cardano.stackexchange.com/questions/367/… . It is much more focussed on the real issue according to me. I gave the same answer: setting up the IOHK binary cache for nix May 7 at 5:50
0

This question is indeed a dupplicate of Hash MisMatch Error on Plutus and Nix

If you look more closer at the entire error log, there is a mismatch in the sha256 singature of the derivation of ghc: hash mismatch in fixed-output derivation '/nix/store/7y3jr1jvzkj2146h7sivw0sfr2bhap3j-ghc-8.4.4-x86_64-deb8-linux.tar.xz

Same answer, same workaround: the problem disappears when using the IOHK bianry cache for nix. And there's is indeed an "IMPORTANT" mention at the begining of plutus REAME file asking to do this.


On NixOs:
# configuration.nix
{ config, pkgs, ... }:
{
  # ... all the rest of the configuration of the server

  # iohk binary caches
  nix = 
  {
    binaryCaches          = [ "https://hydra.iohk.io" "https://iohk.cachix.org" ];
    binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ];
  };
}

Ubuntu and other Linuxes

Nix has a configuration in /etc/nix/nix.conf. So as to use the IOHK binary cache you have to modify this file:

In the documentation it is said

sudo mkdir -p /etc/nix
cat <<EOF | sudo tee /etc/nix/nix.conf
substituters = https://cache.nixos.org https://hydra.iohk.io
trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
EOF

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