Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use stack to build and upload to Hackage?

Over time I've developed a messy system level Haskell installation that I'm not sure how to completely clean up. But for the most part this isn't of much concern as I simply use stack to manage per-project Haskell configurations. However as my project requirements diverge from my system Haskell setup, I wonder what the best way is to build and upload packages for Hackage.

Specifically (1) should I be using

stack exec -- cabal sdist
stack exec -- cabal upload

instead of simply

cabal sdist
cabal upload

and (2) should is there any reason to install a project version of cabal (with stack build cabal?)

Or is there some better stack-based approach to building and distributing to Hackage that doesn't involve invoking cabal directly?

like image 309
orome Avatar asked Dec 28 '16 20:12

orome


People also ask

Where does stack install GHC?

In its default configuration, Stack will simply ignore any system GHC installation and use a sandboxed GHC that it has installed itself. You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory.

Where does stack install packages?

Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.

What is stack Haskell?

Stack's functions Stack handles the management of your toolchain (including GHC — the Glasgow Haskell Compiler — and, for Windows users, MSYS2), building and registering libraries, building build tool dependencies, and more.


1 Answers

Adding an answer based on my earlier comment.


stack offers equivalent functionality via its
  • stack sdist
  • stack upload

commands, which don't require interfacing with cabal directly in stack-based projects.

A full list of commands supported by stack can be obtained via:

$ stack --help

and the official documentation.

Individual commands also support --help to see what command line flags they support.

like image 63
ppb Avatar answered Sep 26 '22 09:09

ppb