Skip to content

build dependencies for custom Setup.hs #948

Closed
@kowey

Description

@kowey

Projects often require custom Setup.hs files which in turn may rely on Haskell packages. Those packages may in turn depend on Cabal, perhaps without being too fussy about which version of Cabal they want.

It might be useful to be able to express the idea that the Setup script itself has dependencies. Rogan Creswick suggested maybe something that looks like

   CustomBuild
        Setup-is: Setup.hs
        Build-Depends:  ...
        Build-tools:    ...
        ...

Here was my musing about it: https://plus.google.com/114991347543804898741/posts/2Wpy3WWvGyH (not sure if I understood correctly, and my user claims that upping the cabal-version constraint [which should be unnecessary in that case] fixes it for them)

This appears to have come up for several projects:

  • GUI programmers on Mac might use a cabal-macosx package to help create application bundles for their executables
  • Pandoc's Setup.hs at one point needed something from a new version of the process package
  • Rogan Creswick filed this GSoC suggestion http://hackage.haskell.org/trac/summer-of-code/ticket/1602
  • Rogan also commented something about cabal-dev (which I didn't fully process, sorry, Rogan!)

To ensure that these packages are present, I sometimes abuse the build-depends for my executable, which appears to be insufficient because when a Haskell-naive user upgrades from one version of Cabal to another, you get into a kind of messy situation where the Setup.hs file wants to use one version of Cabal but it relies on the package which assumes another version of Cabal. It's the kind of thing that a Haskeller can just sort of muddle/bulldoze through, but for somebody who knows enough to type cabal install type commands but isn't otherwise a Haskeller, it can be seriously confusing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions