This is a simple tool for using
cabal new-build
in Haskell projects that have originally been designed
for use with stack
.
The tool does two things:
-
cabal new-build
(at the moment) handles only dependencies that are either local or on Hackage. Instack
, on the other hand, it is possible to use dependencies from GitHub by specifying repository-URL and commit in thestack.yaml
file. Thestack2cabal
tool scans thestack.yaml
file for such dependencies, clones the repositories into subfolder./stack2cabal/
and checks out the correct commit. -
Using the packages listed in
stack.yaml
and the cloned git repositories,stack path --compiler-exe
to determine the correct GHC version andstack list-dependencies
to get the correct version of each dependency, thestack2cabal
tool creates thecabal.project
file needed forcabal new-build
, thus making sure thatcabal new-build
will build the same packages asstack
, will use the same GHC version asstack
and will use the same dependency versions asstack
.