hpack-convert icon indicating copy to clipboard operation
hpack-convert copied to clipboard

hpack-convert won't build with LTS11.4

Open sebeaumont opened this issue 6 years ago • 10 comments

$ 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
    |                     ^^^^^^^^^^^^^^^^^^^^^

sebeaumont avatar Apr 12 '18 10:04 sebeaumont

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 avatar May 17 '18 14:05 tebello-thejane

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

tebello-thejane avatar May 17 '18 14:05 tebello-thejane

Any updates on this?

ifduyue avatar Nov 17 '18 08:11 ifduyue

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

andrewufrank avatar Mar 15 '19 16:03 andrewufrank

I'm getting the same error on Windows 10

CedricLeong avatar Mar 20 '19 02:03 CedricLeong

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

peterstorm avatar Mar 27 '19 22:03 peterstorm

Interested as well for #16 integration.

pigam avatar Dec 17 '19 06:12 pigam

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

wbadart avatar Mar 27 '20 23:03 wbadart

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

chansey97 avatar Feb 19 '24 06:02 chansey97

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.

sebeaumont avatar Feb 19 '24 17:02 sebeaumont