Skip to content

Doesn't Compile #48

@fallen-icarus

Description

@fallen-icarus

No matter what I try, I can't get cardano-node-emulator to compile in my project. Here is my cabal.project file:

-- Custom repository for cardano haskell packages, see CONTRIBUTING for more
repository cardano-haskell-packages
  url: https://chap.intersectmbo.org/
  secure: True
  root-keys:
    3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
    443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
    a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
    bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
    c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
    d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

index-state:
  , hackage.haskell.org 2025-04-16T16:04:13Z
  , cardano-haskell-packages 2025-05-16T15:25:35Z

with-compiler: ghc-9.6.7

constraints:
  cardano-api == 10.16.1.0

packages: ./.

write-ghc-environment-files: never

tests: true

-- These packages appear in our dependency tree and are very slow to build.
-- Empirically, turning off optimization shaves off ~50% build time.
-- It also mildly improves recompilation avoidance.
-- For dev work we don't care about performance so much, so this is okay.
package cardano-ledger-alonzo
  optimization: False
package ouroboros-consensus-cardano
  optimization: False
package cardano-api
  optimization: False
package cardano-crypto-praos
  flags: -external-libsodium-vrf

test-show-details: direct

source-repository-package
    type: git
    location: https://github.com/intersectMBO/cardano-node-emulator
    tag: 6d65996418d2b00fa791407ec47e2fe77c208790
    subdir:
      plutus-script-utils
      plutus-ledger
      cardano-node-emulator
      freer-extras

The Cardano packages I am using in my .cabal file are:

  build-depends:
      plutus-script-utils
    , plutus-tx
    , plutus-ledger-api
    , cardano-api
    , plutus-ledger
    , plutus-core
    , cardano-node-emulator

I've tried:

  • changing the cardano-api constraint
  • changing the index-state dates
  • changing the specific cardano-node-emulator source tag
  • removing the source-repository-package for the cardano-node-emulator and using the one in CHaP

But nothing has worked. Sometimes cabal can't resolve a dependency path while other times it can but compiling fails like this:

src/Ledger/Tx/CardanoAPI/Internal.hs:195:9: error: [GHC-83865]
    • Couldn't match expected type: Either a0 (C.Tx era)
                  with actual type: C.TextEnvelope -> Either C.TextEnvelopeError a1
    • Probable cause: ‘C.deserialiseFromTextEnvelope’ is applied to too few arguments
      In the second argument of ‘($)’, namely
        ‘C.deserialiseFromTextEnvelope envelope’
      In the second argument of ‘($)’, namely
        ‘either
           (const $ parseFail "Failed to parse 'tx' field from CardanoTx")
           pure
           $ C.deserialiseFromTextEnvelope envelope’
      In a stmt of a 'do' block:
        tx <- C.shelleyBasedEraConstraints sbe
                $ either
                    (const $ parseFail "Failed to parse 'tx' field from CardanoTx")
                    pure
                    $ C.deserialiseFromTextEnvelope envelope
    • Relevant bindings include
        sbe :: C.ShelleyBasedEra era
          (bound at src/Ledger/Tx/CardanoAPI/Internal.hs:188:24)
    |
195 |       $ C.deserialiseFromTextEnvelope envelope
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Ledger/Tx/CardanoAPI/Internal.hs:195:39: error: [GHC-83865]
    • Couldn't match expected type ‘C.AsType a1’
                  with actual type ‘C.TextEnvelope’
    • In the first argument of ‘C.deserialiseFromTextEnvelope’, namely
        ‘envelope’
      In the second argument of ‘($)’, namely
        ‘C.deserialiseFromTextEnvelope envelope’
      In the second argument of ‘($)’, namely
        ‘either
           (const $ parseFail "Failed to parse 'tx' field from CardanoTx")
           pure
           $ C.deserialiseFromTextEnvelope envelope’
    |
195 |       $ C.deserialiseFromTextEnvelope envelope
    |                                       ^^^^^^^^

Any help would be appreciated since I really just need the bare bones emulator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions