When I run cabal install [pkg]
and pkg is a command line executable program instead of a library, it often warns me with this message: "Warning: The following packages are likely to be broken by the reinstalls"
I always use the --force-reinstalls
option to proceed.
But since I'm installing an executable and NOT a library, is there a way to run cabal install
to isolate the build process in a cabal sandbox, and then install the executable in ~/.cabal/bin
? Or is this something I need to write a custom bash script for?
I always create a sandbox for my tools, such as hoogle
, pointfree
, haddock
, ghc-mod
, hlint
, shake
, and stylish-haskell
among others. Simply follow these steps:
cabal sandbox init
in the location of your choicecabal install [pkg1 [pkg2 ...]]
.cabal-sandbox/bin
folder to your ~/.cabal/bin/
folder.cabal sandbox delete
to remove the likely very large sandbox that you no longer need.These executables are usually completely standalone, so you can build them against the dependencies they request in a sandbox and then move them to where ever you want. This definitely helps keep your system-wide installation clean and free from conflicts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With