Building hledger from source for a Haskell tools Novice: Do I need to change something?

I prefer to build hledger from source, because reasons. I'm a Novice with Haskell tools in that I've heard of stack and cabal and can understand them by analogy to similar tools for other languages. I have written small amounts of Haskell code and compiled them directly with ghc. I have no real familiarity with the details.

Today I tried to follow the build instructions to install hledger 1.33.1 and they failed with messages about not having the right version of the Haskell compiler. (I'm going by memory now.) After stumbling in the dark, I discovered that they worked if I added the --install-ghc switch to

stack install --verbosity error --resolver lts-22 \
    hledger-lib-1.33.1 hledger-1.33.1 hledger-ui-1.33.1 hledger-web-1.33.1

I don't know the tools well enough to decide between these two statements, and I'd love help:

  • The instructions should include --install-ghc by default, because that's good for most people most of the time.
  • I shouldn't need to use --install-ghc here, because something is amiss with my stack installation or configuration.

...or maybe something else?

I'm on Pop!_OS.

Thanks.

1 Like

Thanks for the feedback! I'll update the doc.

  • The instructions should include --install-ghc by default, because that's good for most people most of the time.
  • I shouldn't need to use --install-ghc here, because something is amiss with my stack installation or configuration.

This needs some thought. For people using Haskell for the first time, yes perhaps --install-ghc is best. The doubt is that the Haskell community now mostly recommends installing ghc with ghcup rather than stack. So if the person later switches to that method, or if they are already a haskeller using that method, they can end up with ghcs, perhaps the same version, installed by both methods, which works just fine but wastes a couple of G of disk space and could be confusing.

Do you know which ghc version, if any, was previously installed ? How was it installed ? Do you still have any of the output you saw before --install-ghc ? [Disregard]

Updated, now recommending --install-ghc. Thanks.