Reputation: 523
I am using scotty and cookie, scotty uses text 1.2.2.2 and cookie text 1.2.2.1. Can I recompile cookie in order to use the newer version of text? Is there a way to include both version (I basically only need text to transform it into strings). Or how can I manage this version conflict in sandbox?
Upvotes: 0
Views: 64
Reputation: 64750
Yes, you can re-install packages to depend on other, common, versions. Make a cabal file for your project and build via the cabal library (using cabal-install or stack), cabal will ensure there is only one version of text installed that satisfies both scotty and cookie.
If you want to resolve the situation more manually then consider re-installing cookie with a constraint on the text version. For example:
ghc-pkg unregister cookie
cabal install cookie --constraint='text == 1.2.2.2'
Or a middle ground, you could unregister both packages and install them at the same time so they implicitly get the same dependency resolution:
ghc-pkg unregister cookie
ghc-pkg unregister scotty
cabal install cookie scotty
Notice that the unregistration process can break other packages so it might be a bit of a manual process. This is why it's best to use sandboxes, cabal new-build, or similar.
Upvotes: 1