input-output-hk / marlowe-cardano

Marlowe smart contract language Cardano implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

utils/genprimopcode/dist/package-data.mk: No such file or directory

malakaw opened this issue · comments

Summary

When I run nix-shell command, Got a Error

utils/genprimopcode/dist/package-data.mk: No such file or directory

Steps to reproduce

Steps to reproduce the behavior:

  1. git clone https://github.com/input-output-hk/marlowe-cardano.git -b mpp-cli-lectures
  2. cd marlowe-cardano
  3. nix-shell
  4. got error

Expected behavior

System info (please complete the following information):

  • OS: [Ubuntu]
  • nix --version
    nix (Nix) 2.10.3
  • cabal-install version 3.6.2.0

Additional context

[215 of 270] Compiling Distribution.Simple.Setup ( libraries/Cabal/Cabal/Distribution/Simple/Setup.hs, bootstrapping/Distribution/Simple/Setup.o ) utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory make[1]: *** [utils/ghc-cabal/ghc.mk:56: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed make: *** [Makefile:123: all] Error 2 error: builder for '/nix/store/y06dz1pnglf3xprxraby7bablx6kvma4-ghc-8.6.5.drv' failed with exit code 2; last 10 log lines: > [209 of 270] Compiling Distribution.Types.InstalledPackageInfo.Lens ( libraries/Cabal/Cabal/Distribution/Types/InstalledPackageInfo/Lens.hs, bootstrapping/Distribution/Types/InstalledPackageInfo/Lens.o ) > [210 of 270] Compiling Distribution.Types.InstalledPackageInfo.FieldGrammar ( libraries/Cabal/Cabal/Distribution/Types/InstalledPackageInfo/FieldGrammar.hs, bootstrapping/Distribution/Types/InstalledPackageInfo/FieldGrammar.o ) > [211 of 270] Compiling Distribution.Simple.Program.GHC ( libraries/Cabal/Cabal/Distribution/Simple/Program/GHC.hs, bootstrapping/Distribution/Simple/Program/GHC.o ) > [212 of 270] Compiling Distribution.Simple.Program.Builtin ( libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs, bootstrapping/Distribution/Simple/Program/Builtin.o ) > [213 of 270] Compiling Distribution.Simple.Program.Db ( libraries/Cabal/Cabal/Distribution/Simple/Program/Db.hs, bootstrapping/Distribution/Simple/Program/Db.o ) > [214 of 270] Compiling Distribution.Simple.Program ( libraries/Cabal/Cabal/Distribution/Simple/Program.hs, bootstrapping/Distribution/Simple/Program.o ) > [215 of 270] Compiling Distribution.Simple.Setup ( libraries/Cabal/Cabal/Distribution/Simple/Setup.hs, bootstrapping/Distribution/Simple/Setup.o ) > utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory > make[1]: *** [utils/ghc-cabal/ghc.mk:56: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed > make: *** [Makefile:123: all] Error 2 For full logs, run 'nix log /nix/store/y06dz1pnglf3xprxraby7bablx6kvma4-ghc-8.6.5.drv'.
Add any other context about the problem here.

@malakaw, did you enable the IOHK binary cache? It looks like nix-shell is compiling GHC, which is a lengthy process. Enabling the caches will speed things up, but I don't know if it will fix the problem you experienced.

I just tried as well on Ubuntu and it entered the nix-shell properly and without compiling things as bwbush said above. Definitely suspecting how nix is configured for the IOHK caches.

thank gays' comments. use these command
git clone https://github.com/input-output-hk/marlowe-cardano.git cabal install exe:marlowe-cli
now , The marlowe-cli works fine.

ref this :https://github.com/input-output-hk/marlowe-cardano/tree/cli-blog-april2022/marlowe-cli

@bwbush I have edited /etc/nix/nix.conf , but same error.

@malakaw Ok, I'm out of ideas and am asking people in IOHK who have more experience with Nix, will report back.

The aforementioned error would stem from building GHC from source, which is something that should not happen; we should have cache hits for this. However even if it happened (to build GHC from source), that error should not happen.

I was unable to reproduce this error on a clean checkout of the mentioned repo. @malakaw can you please provide the contents of your /etc/nix/nix.conf?

Also, if you had edited /etc/nix/nix.conf (which is for a multi-user Nix installation), the daemon also needs to be restarted sudo systemctl restart nix-daemon.service
If you installed nix single-user, the config file will be in $HOME/.config/nix/nix.conf and there's no daemon to restart.

PS The nix docs seem to encourage multi-user installation but single-user Nix installation has advantages

  • No daemon and socket are created
  • A group of 32 nix users doesn't get created on the system
  • Nothing is written into /etc
  • These things are especially problematic if you ever want to remove nix, which usually installs without proper distro packaging. So the artifacts above get left on the system unless you manually remove them.

my /etc/nix/nix.conf file

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
build-users-group = nixbld```

@malakaw I see that your nix.conf is missing the substituters and the trusted-public-keys looks different than the ones needed for the IOHK cache. The two settings should be:

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=

I see that you also have some settings for MacOS (the extra-sandbox-paths), our configuration docs also show that but another setting is missing

sandbox = true

Try making sure you have these lines above in that config file and restart the daemon. I don't have Mac but from the document it looks like

sudo launchctl stop org.nixos.nix-daemon
sudo launchctl start org.nixos.nix-daemon