Haskell Stack install package dependency from github

后端 未结 3 1644
情话喂你
情话喂你 2021-01-31 16:56

Is it possible to install a version of a package from github using Haskell stack?

e.g. in a .cabal or a stack.yaml file, how can I point a depe

3条回答
  •  感情败类
    2021-01-31 17:09

    In my case i wanted to depend on a fork of pandoc, specifying a precise commit. It worked by adding the following to stack.yml:

    extra-deps: - archive: https://github.com/italia/pandoc/archive/1327c564cccf5dfa387a2956443990d9854c85cd.zip

    This would work with any branch-like URL on Git. I found my url by browsing the files at the commit and copying the URL from the "Download ZIP" button.

    Note that my branch has a specific version, higher than any version Stack could fetch from the resolver. I pinpoint the version in the Cabal dependencies. If the version on that branch would overlap with one available in the resolver's index, i'm not sure about which one would be picked

提交回复
热议问题