Setup that I have: Cabal library project that depends on GHC and has a copy of SourcePlugin
from GHC docs
The problem is that I can’t figure out how to run GHC with the plugin. Running GHC directly produces following output:
$ ghc -fplugin src/SourcePlugin src/Parser.hs
Loaded package environment from /home/ddrone/.ghc/x86_64-linux-9.6.1/environments/default
attempting to use module ‘main:src/SourcePlugin’ (./src/SourcePlugin.hs) which is not loaded
Replacing ghc
with cabal exec ghc
does seem to actually run GHC, but I don’t see the output plugin is supposed to write to stdout:
$ cabal exec ghc -fplugin src/SourcePlugin.hs src/Parser.hs
Loaded package environment from /home/ddrone/Projects/ghc-plugin/dist-newstyle/tmp/environment.-47119/.ghc.environment.x86_64-linux-9.6.1
[1 of 2] Compiling Parser ( src/Parser.hs, src/Parser.o ) [Source file changed]
Not sure what I should do instead?