Skip to content

Commit

Permalink
Make the Plutus Tx plugin an internal library
Browse files Browse the repository at this point in the history
The documentation for `addCorePlugin` says it has to be in a separate
package to the plugin. However it appears that in GHC's eyes internal
libraries in a Cabal package are separate packages, so we can hide all
of this in a single package, which is much nicer. We can then organize
things a bit more neatly inside.

We then have to do some shennanigans to get doctest to work. The normal
tests work fine, since Cabal registers the built internal library as a
package, and that's fine. But doctest interprets things, which *doesn't*
work.

Now, I initially tried to just pass the appropriate `-package-db`
arguments to `doctest`, but in doing so I hit what appears to be a [Cabal
bug with internal libraries](haskell/cabal#5857).
However, somehow `cabal repl` and friends seem to get around this, and
fortunately there is now a `cabal doctest` command, which amazingly
also seems to pass the right set of obscure flags. So we use that.

Finally, in an extremely irritating discovery, apparently [Haddock
doesn't work with internal libraries]
(haskell/cabal#4969) (possibly fixed in a
newer Cabal, who knows), so I ended up having to exclude `plutus-tx`
from Haddock generation for now.
  • Loading branch information
michaelpj committed Jan 23, 2019
1 parent 06ca1e7 commit 4f9e450
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cabal.project
Expand Up @@ -3,15 +3,13 @@ packages: language-plutus-core
plutus-exe
wallet-api
plutus-tx
plutus-tx-plugin
plutus-use-cases
plutus-ir
plutus-playground/plutus-playground-server
plutus-playground/plutus-playground-lib
optimization: 2
constraints: language-plutus-core +development
, wallet-api +development
, plutus-tx-plugin +development
, plutus-exe +development
, plutus-core-interpreter +development
, plutus-ir +development
Expand Down

0 comments on commit 4f9e450

Please sign in to comment.