input-output-hk / plutus-pioneer-program

This repository hosts the lectures of the Plutus Pioneers Program. This program is a training course that the IOG Education Team provides to recruit and train software developers in Plutus, the native smart contract language for the Cardano ecosystem.
1.39k stars 987 forks source link

Cannot load test/Spec/Trace.hs #23

Closed tdiesler closed 3 years ago

tdiesler commented 3 years ago

As mentioned on Discord there seem to errors loading dependencies for the Spec.Trace module

[Prelude Week08.Lens> :l test/Spec/Trace.hs 

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Week08.TokenSale
[2 of 2] Compiling Spec.Trace       ( test/Spec/Trace.hs, /Users/tdiesler/git/plutus-pioneer-program/code/week08/dist-newstyle/build/x86_64-osx/ghc-8.10.4/plutus-pioneer-program-week08-0.1.0.0/build/Spec/Trace.o ) [Test.Tasty changed]

test/Spec/Trace.hs:22:1: error:
    Could not load module ‘Control.Monad.Freer.Extras’
    It is a member of the hidden package ‘freer-extras-0.1.0.0’.
    Perhaps you need to add ‘freer-extras’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘freer-extras-0.1.0.0’.
    Perhaps you need to add ‘freer-extras’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
22 | import           Control.Monad.Freer.Extras as Extras
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/Spec/Trace.hs:23:1: error:
    Could not load module ‘Data.Default’
    It is a member of the hidden package ‘data-default-0.7.1.1’.
    Perhaps you need to add ‘data-default’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
23 | import           Data.Default               (Default (..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/Spec/Trace.hs:33:1: error:
    Could not load module ‘Test.Tasty’
    It is a member of the hidden package ‘tasty-1.4.1’.
    Perhaps you need to add ‘tasty’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
33 | import           Test.Tasty
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, one module loaded.

I fixed this by adding the missing stuff to the library section in the .cabal file. No sure, if this is the right thing to do because they are already in the test-suite section where test/Spec/Trace.hs lives

tdiesler commented 3 years ago

Can better be solved like this

cabal repl plutus-pioneer-program-week08-tests