Skip to content

stack repl doesn't work on project with mixins #5077

Open
@chshersh

Description

@chshersh

General summary/comments (optional)

I have a project that follows the mixins approach of using an alternative prelude. When trying to load the project in GHCi via stack repl, I see multiple defintions not in scope errors. I tried to create a minimal example, but I couldn't. stack works on my small examples even with common stanzas, multiple stanzas, but for some reasons doesn't work on the following packages (however, the build is successful):

Steps to reproduce

  1. git clone git@github.com:kowainik/summoner.git
  2. cd summoner
  3. stack repl summoner

Expected

Successfully entering REPL without compilation errors.

Actual

What actually happened.

If you suspect that a stack command misbehaved, please include the output of that command in --verbose mode.
If the output is larger than a page please paste the output in a Gist.

$ stack repl summoner --verbose
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2
2019-11-07 17:13:10.072378: [debug] Checking for project config at: /home/shersh/haskell/kowainik/summoner/stack.yaml
2019-11-07 17:13:10.072696: [debug] Loading project config file stack.yaml
2019-11-07 17:13:10.082806: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2019-11-06 14:13:10.082744481 UTC]
2019-11-07 17:13:10.083594: [debug] Using package location completions from a lock file
2019-11-07 17:13:10.241257: [debug] Asking for a supported GHC version
2019-11-07 17:13:10.241444: [debug] Installed tools: 
 - ghc-8.8.1
 - ghc-8.6.5
2019-11-07 17:13:10.241578: [debug] Run process: /sbin/ldconfig -p
2019-11-07 17:13:10.243327: [debug] Process finished in 2ms: /sbin/ldconfig -p
2019-11-07 17:13:10.243485: [debug] Found shared library libtinfo.so.5 in 'ldconfig -p' output
2019-11-07 17:13:10.243742: [debug] Did not find shared library libtinfo.so.6
2019-11-07 17:13:10.243809: [debug] Did not find shared library libncursesw.so.6
2019-11-07 17:13:10.243852: [debug] Found shared library libgmp.so.10 in 'ldconfig -p' output
2019-11-07 17:13:10.243913: [debug] Did not find shared library libgmp.so.3
2019-11-07 17:13:10.243938: [debug] Potential GHC builds: standard
2019-11-07 17:13:10.243976: [debug] Found already installed GHC builds: standard
2019-11-07 17:13:10.244150: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_path","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","global_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "/home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-8.6.5"]
2019-11-07 17:13:10.298209: [debug] Loaded compiler information from cache
2019-11-07 17:13:10.298354: [debug] Asking for a supported GHC version
2019-11-07 17:13:10.298530: [debug] Resolving package entries
2019-11-07 17:13:10.298578: [debug] Parsing the targets
2019-11-07 17:13:10.301271: [debug] Checking flags
2019-11-07 17:13:10.301339: [debug] SourceMap constructed
2019-11-07 17:13:10.317484: [debug] Starting to execute command inside EnvConfig
2019-11-07 17:13:10.323804: [debug] Parsing the targets
2019-11-07 17:13:10.324310: [debug] Finding out which packages are already installed
2019-11-07 17:13:10.324757: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.355967: [debug] Process finished in 31ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.357836: [debug] Ignoring package parsec due to wanting version 3.1.14.0 instead of 3.1.13.0
2019-11-07 17:13:10.359674: [debug] Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
2019-11-07 17:13:10.360008: [debug] Ignoring package haskeline due to wanting version 0.7.5.0 instead of 0.7.4.3
2019-11-07 17:13:10.360314: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.419985: [debug] Process finished in 60ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.422927: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.445716: [debug] Process finished in 23ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.446366: [debug] Start: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.461316: [debug] Finished in 15ms: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.462659: [info] Using main module: 1. Package `summoner' component summoner:exe:summon with main-is file: /home/shersh/haskell/kowainik/summoner/summoner-cli/app/Cli.hs
2019-11-07 17:13:10.462734: [debug] Parsing the targets
2019-11-07 17:13:10.462959: [debug] Checking flags
2019-11-07 17:13:10.462994: [debug] SourceMap constructed
2019-11-07 17:13:10.465141: [debug] Finding out which packages are already installed
2019-11-07 17:13:10.465326: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.499832: [debug] Process finished in 34ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.501418: [debug] Ignoring package parsec due to wanting version 3.1.14.0 instead of 3.1.13.0
2019-11-07 17:13:10.502793: [debug] Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
2019-11-07 17:13:10.503062: [debug] Ignoring package haskeline due to wanting version 0.7.5.0 instead of 0.7.4.3
2019-11-07 17:13:10.503281: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.557785: [debug] Process finished in 54ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.560864: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.583959: [debug] Process finished in 23ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.584556: [debug] Constructing the build plan
2019-11-07 17:13:10.587306: [debug] SELECT "id","directory","type","pkg_src","active","path_env_var","haddock" FROM "config_cache" WHERE "directory"=? AND "type"=?; [PersistText "/home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/",PersistText "lib:summoner-1.3.0.1-8yeaPcO00SAHtbTZyLsqZQ"]
2019-11-07 17:13:10.588364: [debug] SELECT "id", "config_cache_id", "index", "option" FROM "config_cache_dir_option" WHERE ("config_cache_id"=?) ORDER BY "index"; [PersistInt64 83]
2019-11-07 17:13:10.588652: [debug] SELECT "id", "config_cache_id", "index", "option" FROM "config_cache_no_dir_option" WHERE ("config_cache_id"=?) ORDER BY "index"; [PersistInt64 83]
2019-11-07 17:13:10.588877: [debug] SELECT "id", "config_cache_id", "ghc_pkg_id" FROM "config_cache_dep" WHERE ("config_cache_id"=?); [PersistInt64 83]
2019-11-07 17:13:10.589048: [debug] SELECT "id", "config_cache_id", "component" FROM "config_cache_component" WHERE ("config_cache_id"=?); [PersistInt64 83]
2019-11-07 17:13:10.589686: [debug] Start: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.612952: [debug] Finished in 23ms: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.617319: [debug] Checking if we are going to build multiple executables with the same name
2019-11-07 17:13:10.617425: [debug] Executing the build plan
2019-11-07 17:13:10.618384: [debug] Finding out which packages are already installed
2019-11-07 17:13:10.618626: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.653939: [debug] Process finished in 35ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-07 17:13:10.655305: [debug] Ignoring package parsec due to wanting version 3.1.14.0 instead of 3.1.13.0
2019-11-07 17:13:10.656821: [debug] Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
2019-11-07 17:13:10.657215: [debug] Ignoring package haskeline due to wanting version 0.7.5.0 instead of 0.7.4.3
2019-11-07 17:13:10.657436: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.710565: [debug] Process finished in 53ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/.stack/snapshots/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.713859: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.734634: [debug] Process finished in 21ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /home/shersh/haskell/kowainik/summoner/.stack-work/install/x86_64-linux/fc05c9059930f271da94fa1badc9c441d516cf58762c2d5c2d2f3ecd56b8fe82/8.6.5/pkgdb dump --expand-pkgroot
2019-11-07 17:13:10.735172: [debug] Start: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.749525: [debug] Finished in 14ms: getPackageFiles /home/shersh/haskell/kowainik/summoner/summoner-cli/summoner.cabal
2019-11-07 17:13:10.751133: [warn] The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
2019-11-07 17:13:10.751213: [info] Configuring GHCi with the following packages: summoner
2019-11-07 17:13:10.751787: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-8.6.5 --version
2019-11-07 17:13:10.785282: [debug] Process finished in 33ms: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-8.6.5 --version
2019-11-07 17:13:10.785835: [debug] Run process: /home/shersh/.stack/programs/x86_64-linux/ghc-8.6.5/bin/ghc-8.6.5 --interactive -i -odir=/home/shersh/haskell/kowainik/summoner/.stack-work/odir -hidir=/home/shersh/haskell/kowainik/summoner/.stack-work/odir -hide-all-packages -XDeriveGeneric -XDerivingStrategies -XGeneralizedNewtypeDeriving -XInstanceSigs -XLambdaCase -XOverloadedStrings -XRecordWildCards -XScopedTypeVariables -XTypeApplications -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build -i/home/shersh/haskell/kowainik/summoner/summoner-cli/src -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/autogen -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/global-autogen -stubdir=/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build -package-id=base-4.12.0.0 -package-id=relude-0.6.0.0-AcrVfUNryj1HsmpcUfIeuY -package-id=aeson-1.4.5.0-4tP9POulx7kGv2m3BKQ2NN -package-id=ansi-terminal-0.9.1-JvtMBmSUh1eHKvsAMwthXj -package-id=bytestring-0.10.8.2 -package-id=containers-0.6.0.1 -package-id=directory-1.3.3.0 -package-id=filepath-1.4.2.1 -package-id=generic-deriving-1.12.4-DLZ2cqfoVDQGYjceQHrMNL -package-id=gitrev-1.3.1-28bODUJmuLsJT3tLybQkQz -package-id=neat-interpolation-0.3.2.4-HeNnMwiiKFO9lpwTnxIb8W -package-id=optparse-applicative-0.15.0.0-A6eMLcSzmzvDFZhHmBUdaj -package-id=process-1.6.5.0 -package-id=shellmet-0.0.3.0-1SoT2mnycLoBHUzO2p2kwD -package-id=text-1.2.3.1 -package-id=time-1.8.0.2 -package-id=tomland-1.2.1.0-LHNUJPIynQz4eLzzDdfVjr -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/summon -i/home/shersh/haskell/kowainik/summoner/summoner-cli/app -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/summon/autogen -i/home/shersh/haskell/kowainik/summoner/summoner-cli/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/summon/summon-tmp -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths -rtsopts -with-rtsopts=-N -optP-include -optP/home/shersh/haskell/kowainik/summoner/.stack-work/ghci/0e95b82b/cabal_macros.h -ghci-script=/tmp/haskell-stack-ghci/513d8b67/ghci-script
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
[ 1 of 25] Compiling Paths_summoner
[ 2 of 25] Compiling Summoner.Ansi

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:33:16: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
33 | putStrFlush :: Text -> IO ()
   |                ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:55:27: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
55 | beautyPrint :: [IO ()] -> Text -> IO ()
   |                           ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:61:14: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
61 | prompt :: IO Text
   |              ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:68:13: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
68 | boldText :: Text -> IO ()
   |             ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:71:16: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
71 | boldDefault :: Text -> IO ()
   |                ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:74:26: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
74 | colorMessage :: Color -> Text -> IO ()
   |                          ^^^^

/home/shersh/haskell/kowainik/summoner/summoner-cli/src/Summoner/Ansi.hs:80:75: error:
    Not in scope: type constructor or class ‘Text’
    Perhaps you meant ‘T.Text’ (imported from Data.Text)
   |
80 | errorMessage, warningMessage, successMessage, infoMessage, skipMessage :: Text -> IO ()
   |                                                                           ^^^^
Failed, one module loaded.

<no location info>: error:
    Could not load module ‘Summoner’
    It is a member of the hidden package ‘summoner-1.3.0.1’.
    You can run ‘:set -package summoner’ to expose it.
    (Note: this unloads all the modules in the current scope.)
Loaded GHCi configuration from /tmp/haskell-stack-ghci/513d8b67/ghci-script

Stack version

$ stack --version
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions