IntersectMBO / cardano-haskell-packages

Metadata for Cardano's Haskell package repository
https://chap.intersectmbo.org/
Apache License 2.0
34 stars 27 forks source link

Cabal fetches an old plutus-core version to compile #665

Closed albertodvp closed 9 months ago

albertodvp commented 9 months ago

Hi, I've been trying to setup a very simple and minimal environment to compile Plutus scripts using plutus-tx.

I'm using haskell.nix and I followed the README but for some reason cabal is trying to compile plutus-core-lib-plutus-core-1.7.0.0 which I suspect is an "old" version (from what I see from https://chap.intersectmbo.org/).

Here is the error I get:

warning: Git tree '/home/albertodvp/Projects/plutus-playground' is dirty
error: builder for '/nix/store/c70cypp031sgpcymsdvap7glg33s5lwc-plutus-core-lib-plutus-core-1.7.0.0.drv' failed with exit code 1;
       last 10 log lines:
       >       Expected: Either Context Info
       >         Actual: Context
       >     • In the first argument of ‘ThunkInfo’, namely ‘ctx’
       >       In the second argument of ‘($)’, namely ‘ThunkInfo ctx’
       >       In the expression: pure . Just $ ThunkInfo ctx
       >    |
       > 41 |         BuiltinResult _ _          -> pure . Just $ ThunkInfo ctx
       >    |                                                               ^^^
       > [138 of 165] Compiling UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts ( untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.hs, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.o, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.dyn_o )
       > [140 of 165] Compiling UntypedPlutusCore.Evaluation.Machine.Cek.StepCounter ( untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.hs, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.o, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.dyn_o )
       For full logs, run 'nix log /nix/store/c70cypp031sgpcymsdvap7glg33s5lwc-plutus-core-lib-plutus-core-1.7.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/883b7clr2b018pcmxwx73lgnrnqm1frv-plutus-playground-exe-plutus-playground-0.1.0.0-env.drv' failed to build

What am I be doing wrong?

Here is my experiment: https://github.com/albertodvp/plutus-playground

michaelpj commented 9 months ago

Try using constraints: plutus-core > 1.7 in your cabal.project and cabal will probably tell you.

albertodvp commented 9 months ago

Ok, thanks to your hint I managed to understand what I was missing: I forced a higher version using constraints: plutus-core > 1.7 and I discovered I was missing libblst-any. I think the easier thing to do is using the iohk-nix overlays, that actually allows me to compile.

Thank you!