I am trying to build a profilable executable with stack build --profile
. stack build
, stack test
, and stack ghci
all work correctly. (Full repo for reference)
I get many errors like the following:
StateVar > Could not find module ‘Prelude’
StateVar > Perhaps you haven't installed the profiling libraries for package ‘base-4.15.1.0’?
StateVar > Use -v (or `:set -v` in ghci) to see a list of the files searched for.
StateVar > |
StateVar > 72 | module Data.StateVar
This kind of makes sense to me - I'm using the GHC installed by stack, and when installing it didn't give me any indication that it was using profiling libraries.
> stack exec -- which ghc
/home/xavier/.stack/programs/x86_64-linux/ghc-tinfo6-9.0.2/bin/ghc
I'm using lts-19.2
.
Problems with this command seem to be relatively common in other questions, but usually the response is "stop using system GHC". Things I have tried that haven't worked:
- Reading the stack docs for
setup
, but found no reference to profiling. - Reading the stack docs for
--profile
, but finding no reference to system profiling libraries. stack clean
rm -Rf ~/.stack/programs
sudo apt install ghc-prof
and thenstack build --system-ghc --profile
(on a lark ... would prefer to stick to stack managed GHC...)