IreneKnapp / direct-sqlite

MIT License
35 stars 54 forks source link

Add built-tool-depends hsc2hs? #101

Closed moll closed 1 year ago

moll commented 1 year ago

Hey,

If I'm not mistaken, shouldn't direct-sqlite.cabal contain a reference to hsc2hs? There is a Types.hsc file in the repo, after all. I stumbled upon this seeing the following error from the Haskell Language Server/HIE BIOS:

cabal-3.6.2.0: The program 'hsc2hs' is required but it could not be found.

Regular compiling via Cabal works, of course, but perhaps because Cabal deduces more than HLS/HIE BIOS.

Anywho, throwing the following to direct-sqlite.cabal seems to have fixed the problem:

build-tool-depends: hsc2hs:hsc2hs
jchia commented 1 year ago

I'm not sure. I wonder what other projects on Hackage do that also use hsc2hs.

hsc2hs is distributed together with GHC in the binary distribution package.

moll commented 1 year ago

Given we also add explicit dependencies to packages also distributed with GHC, it makes sense to explicitly list build tools it includes.

However, GitHub search shows plenty of packages referencing hsc2hs: https://github.com/search?q=build-tool-depends+hsc2hs+path%3A*.cabal&type=code&ref=advsearch

That includes Stack, the package manager: https://github.com/commercialhaskell/stack/blob/87c1a5b7d309b6b752dd3b39307abdf0d8f68438/stack.cabal#L635