1

When I run cabal repl on my project using nix develop I get the following error:

Warning: Requested index-state 2023-02-20T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2023-02-19T23:48:00Z).
Warning: Requested index-state 2022-12-22T00:00:00Z is newer than
'cardano-haskell-packages'! Falling back to older state
(2022-12-13T23:38:19Z).
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-node-emulator-1.2.0.0 (user goal)
[__1] unknown package: quickcheck-contractmodel (dependency of
cardano-node-emulator)
[__1] fail (backjumping, conflict set: cardano-node-emulator,
quickcheck-contractmodel)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cardano-node-emulator,
quickcheck-contractmodel

Here is my cabal.project file:

-- Custom repository for cardano haskell packages
-- See https://github.com/input-output-hk/cardano-haskell-packages on how to use CHaP in a Haskell project.
repository cardano-haskell-packages
  url: https://input-output-hk.github.io/cardano-haskell-packages
  secure: True
  root-keys:
    3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
    443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
    a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
    bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
    c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
    d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

index-state: 2023-02-20T00:00:00Z

-- See CONTRIBUTING.adoc for how to update index-state
index-state:
  , hackage.haskell.org 2023-02-20T00:00:00Z
  , cardano-haskell-packages 2022-12-22T00:00:00Z

packages: game

-- We never, ever, want this.
write-ghc-environment-files: never

-- Always build tests and benchmarks.
tests: true
benchmarks: true

-- The only sensible test display option, since it allows us to have colourized
-- 'tasty' output.
test-show-details: direct

allow-newer:
  -- cardano-ledger packages need aeson >2, the following packages have a
  -- too restictive upper bounds on aeson, so we relax them here. The hackage
  -- trustees can make a revision to these packages cabal file to solve the
  -- issue permanently.
  , ekg:aeson
  , ekg-json:aeson
  , openapi3:aeson
  , servant:aeson
  , servant-client-core:aeson
  , servant-server:aeson

constraints:
  -- cardano-prelude-0.1.0.0 needs
  , protolude <0.3.1

  -- cardano-ledger-byron-0.1.0.0 needs
  , cardano-binary <1.5.0.1

  -- plutus-core-1.0.0.1 needs
  , cardano-crypto-class >2.0.0.0
  , algebraic-graphs <0.7

  -- cardano-ledger-core-0.1.0.0 needs
  , cardano-crypto-class <2.0.0.1

  -- cardano-crypto-class-2.0.0.0.1 needs
  , cardano-prelude <0.1.0.1

  -- dbvar from cardano-wallet needs
  , io-classes <0.3.0.0

  -- newer typed-protocols need io-classes>=0.3.0.0 which is incompatible with dbvar's constraint above
  , typed-protocols==0.1.0.0

  , aeson >= 2

  , hedgehog >= 1.1

  , resource-pool <0.4.0.0

  , http2 <4.0.0

-- The plugin will typically fail when producing Haddock documentation. However,
-- in this instance you can simply tell it to defer any errors to runtime (which
-- will never happen since you're building documentation).
--
-- So, any package using 'PlutusTx.compile' in the code for which you need to
-- generate haddock documentation should use the following 'haddock-options'.
package plutus-ledger
  haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
package plutus-script-utils
  haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
package plutus-contract
  haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"

-- 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-shelley
  optimization: False
package ouroboros-consensus-cardano
  optimization: False
package cardano-api
  optimization: False
package cardano-wallet
  optimization: False
package cardano-wallet-core
  optimization: False
package cardano-wallet-cli
  optimization: False
package cardano-wallet-launcher
  optimization: False
package cardano-wallet-core-integration
  optimization: False

source-repository-package
  type: git
  location: https://github.com/input-output-hk/plutus-apps.git
  tag: cc144a86
  subdir:
    cardano-node-emulator
    cardano-streaming
    doc
    freer-extras
    marconi-chain-index
    marconi-core
    marconi-sidechain
    pab-blockfrost
    plutus-chain-index-core
    plutus-chain-index
    plutus-contract
    plutus-contract-certification
    plutus-e2e-tests
    plutus-example
    plutus-ledger
    plutus-pab-executables
    plutus-pab
    plutus-script-utils
    plutus-tx-constraints
    plutus-use-cases


-- Direct dependency.
-- Compared to others, cardano-wallet doesn't bump dependencies very often.
-- Making it a good place to start when bumping dependencies.
-- As, for example, bumping the node first highly risks breaking API with the wallet.
-- Unless early bug fixes are required, this is fine as the wallet tracks stable releases of the node.
-- And it is indeed nice for plutus-apps to track stable releases of the node too.
--
-- The current version is dated 2022/08/10
source-repository-package
    type: git
    location: https://github.com/input-output-hk/cardano-wallet
    tag: 18a931648550246695c790578d4a55ee2f10463e
    subdir:
      lib/cli
      lib/core
      lib/core-integration
      lib/dbvar
      lib/launcher
      lib/numeric
      lib/shelley
      lib/strict-non-empty-containers
      lib/test-utils
      lib/text-class

-- Direct dependency.
source-repository-package
    type: git
    location: https://github.com/Quviq/quickcheck-contractmodel
    tag: cc43f13f98c704e0d53dbdef6a98367918f8c5c1
    subdir:
      contractmodel

-- Should follow cardano-wallet.
source-repository-package
    type: git
    location: https://github.com/input-output-hk/cardano-addresses
    tag: b7273a5d3c21f1a003595ebf1e1f79c28cd72513
    subdir:
      -- cardano-addresses-cli
      command-line
      -- cardano-addresses
      core

-- This is needed because we rely on an unreleased feature
-- https://github.com/input-output-hk/cardano-ledger/pull/3111
source-repository-package
    type: git
    location: https://github.com/input-output-hk/cardano-ledger
    tag: da3e9ae10cf9ef0b805a046c84745f06643583c2
    subdir:
      eras/alonzo/impl
      eras/alonzo/test-suite
      eras/babbage/impl
      eras/babbage/test-suite
      eras/byron/chain/executable-spec
      eras/byron/crypto
      eras/byron/crypto/test
      eras/byron/ledger/executable-spec
      eras/byron/ledger/impl
      eras/byron/ledger/impl/test
      eras/shelley/impl
      eras/shelley/test-suite
      eras/shelley-ma/impl
      eras/shelley-ma/test-suite
      libs/cardano-ledger-core
      libs/cardano-ledger-pretty
      libs/cardano-protocol-tpraos
      libs/cardano-data
      libs/vector-map
      libs/set-algebra
      libs/small-steps
      libs/small-steps-test
      libs/non-integral

Can anyone help?

4
  • 1
    Can you share your .project file? Apr 10, 2023 at 9:44
  • @FalconStakepool: I've added the cabal.project file.
    – Eric
    Apr 11, 2023 at 9:14
  • Q1. Doesn't GHC comes with the Nix env binaries? Q2. Did the original question got a solution?
    – user11782
    Jul 26, 2023 at 0:05
  • Hi @user11782, please do not post questions as answers. If you have questions that are not answered here, feel free to open a new question where you describe the problem you have. This way the chance of getting help is a lot bigger.
    – eddex
    Jul 26, 2023 at 7:47

2 Answers 2

0

The problem was that a ghc must be installed globally before you try to build plutus-apps.

-1

I hope you have ran cabal update and cabal build before running cabal repl in the root folder of your project. These must be ran in the nix-shell obtained from running nix-develop in the plutus-apps folder and then navigating to your project directory.

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.