well-typed/ghc-events-analyze

Build failed.

Nivroc opened this issue · 7 comments

Hey, only starting to learn Haskell here.
Cloned the repo, did stack init and stack install which failed for me with:

.../ghc-events-analyze/src/GHC/RTS/Events/Analyze/Reports/Timed/SVG.hs:25:11: error:
    • Couldn't match type ‘(,) (F.FontData Double)’ with ‘IO’
      Expected type: IO (F.OutlineMap Double)
        Actual type: F.PreparedFont Double
    • In a stmt of a 'do' block: font <- F.bit
      In the expression:
        do font <- F.bit
           uncurry (renderSVG path)
             $ renderReport options quantized report font
      In an equation for ‘writeReport’:
          writeReport options quantized report path
            = do font <- F.bit
                 uncurry (renderSVG path)
                   $ renderReport options quantized report font
   |
25 |   font <- F.bit
   |           ^^^^^

.../ghc-events-analyze/src/GHC/RTS/Events/Analyze/Reports/Timed/SVG.hs:26:68: error:
    • Couldn't match type ‘Data.Map.Internal.Map
                             String (D.Path V2 Double)’
                     with ‘(F.FontData Double, F.OutlineMap Double)’
      Expected type: F.PreparedFont Double
        Actual type: F.OutlineMap Double
    • In the fourth argument of ‘renderReport’, namely ‘font’
      In the second argument of ‘($)’, namely
        ‘renderReport options quantized report font’
      In a stmt of a 'do' block:
        uncurry (renderSVG path)
          $ renderReport options quantized report font
   |
26 |   uncurry (renderSVG path) $ renderReport options quantized report font
   |                                                                    ^^^^

Opened a text editor, changed this function to

writeReport :: Options -> Quantized -> Report -> FilePath -> IO ()
writeReport options quantized report path = do
  uncurry (renderSVG path) $ renderReport options quantized report F.bit

After that it successfully built and ate my eventlog, producing nice pictures.
Only learning here, have no Idea what I'm doing. Just close this if I did something stupid.

Hm, no success reproducing this so far with cabal using GHC 8.8.3 or stack using LTS-15.2 (GHC 8.8.2). Which snapshot/resolver did you build with?

Oh, I think you might have used a version of SVGFonts < 1.7 where bit didn't return in IO. Apparently the dependency on SVGFonts should have a lower bound >= 1.7.

SVGFonts-1.6.0.3
resolver: lts-10.10

Should I always specify the resolver manually instead of letting stack pick it?

edsko commented

Let's keep this ticket open at least until we fix the lower bound on SVGFonts :)

edsko commented

I don't use stack so not sure that you should do. But I've fixed the lower bound now.

@Nivroc stack init will usually find a working resolver when the dependency constraints are correct.