Is there any way to define flags for cabal dependencies?

后端 未结 5 1457
天命终不由人
天命终不由人 2020-12-30 20:11

I recently ran into a Cabal issue that I only managed to solve by manually installing transformers-compat with the -f transformers3 flag in my cabal sandbox be

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 20:56

    There are a couple of ways to constrain the version for installation.

    1. Add lower and upper bounds to package versions in the cabal file like Mikhail mentioned above, example of such a file here

    2. Additionally, you can override the settings in the .cabal file with the flag cabal install --constraint="bar-2.1"

    To remove a specific version of a package:

    • In a sandbox you can unregister a version with cabal sandbox hc-pkg unregister bar-2.1
    • Global unregistering can be done with this command outside of sandbox ghc-pkg unregister bar-2.1

提交回复
热议问题