check-pvp

Roman Cheplyaka roma at ro-che.info
Sat Mar 1 21:11:17 UTC 2014


* Henning Thielemann <lemming at henning-thielemann.de> [2014-03-01 16:57:56+0100]
> Am 28.02.2014 23:00, schrieb Roman Cheplyaka:
> 
> >* Henning Thielemann <lemming at henning-thielemann.de> [2014-02-28 22:48:59+0100]
> 
> >>Nice! Is there a recommended way to transfer CPP options from the
> >>Cabal file to the CpphsOptions record?
> >
> >Yes, haskell-packages[2] lets you easily create a cabal-integrated
> >"compiler". See the compile method[3] in particular.
> >
> >For an example of how this all glues together, see [4].
> >
> >[2]: http://hackage.haskell.org/package/haskell-packages
> >[3]: http://hackage.haskell.org/package/haskell-packages-0.2.3.4/docs/Distribution-HaskellSuite-Compiler.html#v:compile
> >[4]: https://github.com/haskell-suite/haskell-names/blob/master/hs-gen-iface/src/hs-gen-iface.hs#L70
> 
> Treating check-pvp as compiler driven by Cabal sounds reasonable,
> since this would do all the preprocessing stuff and would also work
> on tarballs etc. However the haskell-name framework seems to expect a
> binary executable as compiler. According to
> 
>    http://documentup.com/haskell-suite/haskell-names
> 
> I would have to design the checker as a tool that only reads modules,
> not the package description, called maybe 'check-modules-pvp' and
> then run
> 
> $ cabal install --haskell-suite -w check-modules-pvp mypkg
> 
> My problem is: The checker needs to read the package description in
> order to classify the dependency ranges. The compiler has no access
> to the package description.

Right, — similar to how ghc doesn't access package description either.
I guess there's no reason not to add such a feature, if you're willing
to write a patch (to both haskell-packages and Cabal).

> If it tries to load the package
> description manually, that will fail on tarballs.

Not sure what you mean here. What tarballs?

> I can also not see how I define my own command line options in the
> Compiler interface.

Good point. I've added 'customMain' to git repo. Let me know if it works
for you.

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/cabal-devel/attachments/20140301/1cc72083/attachment.sig>


More information about the cabal-devel mailing list