#10894 closed bug (wontfix)
In users_guide/profiling.xml : -prof flag not to be used with cabal/stack
報告者: | robstewartuk | 担当者: | |
---|---|---|---|
優先度: | lowest | マイルストーン: | |
コンポーネント: | Documentation | バージョン: | 7.10.2 |
キーワード: | user guide, profiling | 関係者: | |
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | Documentation bug | Test Case: | |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
詳細
The documentation for compiling with cost centre profiling support is here: https://github.com/ghc/ghc/blob/master/docs/users_guide/profiling.xml#L79
It says:
Compile and run this program as follows: $ ghc -prof -fprof-auto -rtsopts Main.hs $ ./Main +RTS -p 121393 $
This is not the case when cabal or stack are used, as -prof
should be omitted, i.e.
cabal install --enable-executable-profiling --enable-library-profiling --ghc-options="-fprof-auto -rtsopts"
If the user does not know this and includes -prof
in the --ghc-options string, they are likely to see compiler error messages relating to p_dyn
, e.g.
Failed to load interface for ‘GHC.Integer.Type’ Perhaps you haven't installed the "p_dyn" libraries for package ‘integer-gmp-1.0.0.0’? Use -v to see a list of the files searched for.
Given that other parts of the profiling.xml
file does refer to cabal, do people agree that it might be helpful to make it explicit in Section "5.1. Cost centres and cost-centre stacks", that using ghc directly -prof
should be used (no change to the XML file):
$ ghc -prof -fprof-auto -rtsopts Main.hs
Though if cabal/stack is being used, the -prof
should be omitted (an addition to the XML file):
$ cabal install --enable-executable-profiling --enable-library-profiling --ghc-options="-fprof-auto -rtsopts"
更新履歴 (4)
comment:2 更新者: (22ヵ月前)
Thanks @osa1 , I agree with this suggestion. I have opened this suggestion for both cabal and stack in two mirrored tickets:
https://github.com/commercialhaskell/stack/issues/1015 https://github.com/haskell/cabal/issues/2827
Once both tickets are addressed, I will return here to close this one.
comment:3 更新者: (22ヵ月前)
Indeed, these cabal and stack github tickets have been (stack) or are being (cabal) addressed, as a concern of their compile time flags. See the discussions in the respective links in https://ghc.haskell.org/trac/ghc/ticket/10894#comment:2. Closing this GHC ticket.
I had this problem before and it's quite annoying, but I feel like the right way to solve this is to add a check in Cabal and print a warning if
--ghc-options=-prof
is used.