Haskell Stack install package dependency from github

后端 未结 3 1638
情话喂你
情话喂你 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:27

    For stack <1.11:

    The documentation for the stack.yaml packages section gives examples of referring to more complex package locations.

    packages:
    - location: .
    - location: dir1/dir2
    - location: https://example.com/foo/bar/baz-0.0.2.tar.gz
    - location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f.zip
    - location:
        git: git@github.com:commercialhaskell/stack.git
        commit: 6a86ee32e5b869a877151f74064572225e1a0398
    - location:
        hg: https://example.com/hg/repo
        commit: da39a3ee5e6b4b0d3255bfef95601890afd80709
    

    Then add extra-dep: true to the package entry just to tell stack not to treat the code it pulls in as something you're developing on (e.g., don't load it in GHCi).

提交回复
热议问题