yamadapc / hpack-convert

hpack-convert: Convert Cabal manifests into hpack's package.yamls
http://hpack-convert.herokuapp.com/
MIT License
51 stars 13 forks source link

hpack-convert won't build with LTS11.4 #18

Open sebeaumont opened 6 years ago

sebeaumont commented 6 years ago
$ stack install hpack-convert
Using latest snapshot resolver: lts-11.4
/private/var/folders/30/9xrf_jtx7618zqb1pyd1wyh40000gp/T/stack40077/hpack-convert-1.0.1/src/Hpack/Util.hs:106:21: error:
    • Couldn't match type ‘[[FilePath]]’ with ‘([[FilePath]], b0)’
      Expected type: IO ([[FilePath]], b0)
        Actual type: IO [[FilePath]]
    • In the second argument of ‘(<$>)’, namely
        ‘globDir compiledPatterns dir’
      In the first argument of ‘(>>=)’, namely
        ‘(fst <$> globDir compiledPatterns dir)’
      In a stmt of a 'do' block:
        files <- (fst <$> globDir compiledPatterns dir)
                   >>= mapM removeDirectories
    |
106 |   files <- (fst <$> globDir compiledPatterns dir) >>= mapM removeDirectories
    |                     ^^^^^^^^^^^^^^^^^^^^^
tebello-thejane commented 6 years ago

It would appear that the type signature for globDir changed in Glob-0.9.0.

Old: https://hackage.haskell.org/package/Glob-0.8.0/docs/System-FilePath-Glob.html#v:globDir

globDir :: [Pattern] -> FilePath -> IO ([[FilePath]], [FilePath]) 

New: https://hackage.haskell.org/package/Glob-0.9.0/docs/System-FilePath-Glob.html#v:globDir

globDir :: [Pattern] -> FilePath -> IO [[FilePath]] 

This appears to be a simple job for -XCPP, assuming that nothing else is broken.

tebello-thejane commented 6 years ago

Here's a supposed fix: https://github.com/yamadapc/hpack-convert/pull/16

ifduyue commented 6 years ago

Any updates on this?

andrewufrank commented 5 years ago

I observed the same error - with ghc 8.4.4 please fix!

CedricLeong commented 5 years ago

I'm getting the same error on Windows 10

peterstorm commented 5 years ago

Any update for this? Doesn't work on newest resolver either, as far as my tries go :(

pigam commented 4 years ago

Interested as well for #16 integration.

wbadart commented 4 years ago

Looks like we've still got this issue on LTS-15.5.

chansey97 commented 9 months ago

At the moment the hpack-convert won't build with the latest GHC (such as 9.8.1, ghc-9.4.8), and the official repository doesn't provide a windows binary release. This prevents you from using hpack-convert on windows.

You might built it via older snapshot by stack, but this require downgrading the stack version, which is annoying.

For ease of use, a windows binary is provided here.

It built on windows (lts-15.5) successfully and it works well, using @kindaro 's fork: https://github.com/kindaro/hpack-convert/commit/fa98909f18992713fba82d2033e04fdedb58592a

Related links: https://github.com/yamadapc/hpack-convert/issues/18 https://github.com/yamadapc/hpack-convert/pull/16

sebeaumont commented 9 months ago

Please close this if everyone's happy -- (I can't recall what I was doing in 2018) and I don't use stack anymore these days anyhow.