dump-core icon indicating copy to clipboard operation
dump-core copied to clipboard

How do I generate core-html/GHC.Types.html

Open Avi-D-coder opened this issue 6 years ago • 3 comments

I have package.yaml configured and I deleted .stack-work, but only Main.html and Paths_${package name}_hs.html are generated by bothstack build and rm -rf ~/.cabal cabal v2-build. stack build --profile also did not work.

ghc-options:
- -fplugin=DumpCore
- -fplugin-opt DumpCore:core-html

Avi-D-coder avatar Jun 20 '19 20:06 Avi-D-coder

Hi, the plugin only dumps core when GHC is compiling a module. I am guessing that your modules are already compiled, and so GHC notices that it only needs to recompile Main. To force it to recompile things you may have to delete dist or new-dist. I am not a stack user so I don't recall what's in .stack-work, but for cabal you shouldn't delete your ~/.cabal (e.g., this is where your cabal configuration lives).

yav avatar Jun 21 '19 20:06 yav

@yav I don't use generally use cabal so I just deleted everything I could think of. I didn't have new-dist prior to cabal v2-build.

With cabal v2-build everything definitely rebuilt, but I suspect dependencies are being rebuilt without the plugin. I can't figure out how to specify the plugin as a dependency and have the plugin run when building other dependencies?

Have you gotten dump-core to work with v2 style builds?

Avi-D-coder avatar Jun 21 '19 22:06 Avi-D-coder

I think that the options apply only to the package you are building, so you'll only see the generated core for the modules in the current packages. I'm not sure how to generate the core for all dependencies as well, perhaps you could add some flags to the cabal.project file? It would be a lot of information to look through though... I generally tend to look at the core for a single module, or perhaps a couple.

yav avatar Jun 21 '19 22:06 yav