Open gergoerdi opened 2 months ago
This a bug in clash.
It seems to ignore specifically the -fplugin
flag in OPTIONS/OPTIONS_GHC
pragmas.
Example:
{-# OPTIONS -fplugin=MissingPlugin -ddump-ds #-}
module Test2771 where
import Clash.Prelude
topEntity = False
This compiles fine in clash, and you see the effect of the -ddump-ds
.
But it should be failing with an error Could not find module ‘MissingPlugin’
.
We do some manipulation of the plugin flags, because we make sure the trio ghc-typelits-extra,ghc-typelits-known,ghc-typelits-natnormalise
get loaded automatically.
There is likely a bug there, where we override the previous settings, instead of amending them.
See https://github.com/gergoerdi/clash-protocols-issue-93
I have this in
src/Main.hs
:This is picked up by GHC when building simulations via Stack.
But when I run Clash via
Clash.Main.defaultMain
(seeBuild.hs
in the repo), the plugin is not loaded.Note that adding
"-fplugin=Protocols.Plugin"
to theClash.Main.defaultMain
invocation does work.