I was playing with the new-build command. I managed to build with it a project. This built a dependency [zlib] into ~/.cabal/store/ghc-8.2.2. Then i deleted this newly created zlib folder from the store. Then ran cabal new-build again on my project and got the following output :
In order, the following will be built:
- zlib-0.6.2 (lib) (requires build)
internal error in InstallPlan.completed
CallStack (from HasCallStack):
error, called at ./Distribution/Client/InstallPlan.hs:261:25 in main:Distribution.Client.InstallPlan
When i put the deleted package folder back into ~/.cabal/store/ghc-8.2.2 then cabal new-build responded with Up to date again.
$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.0 of the Cabal library
My operating system is NixOS 18.03.132083.06c576b0525 (Impala)
I think that -like in nixos- you aren't supposed to touch the store.
Well, unless you manually track and delete/unregister every reverse dependency.
Then what is the recommended method to remove a package from the store ?
Uh... the simplest way is probably to nuke the entire store.
But why would you want to do that, except for disk space problems (hence #3333)? The store is immutable and recompiling a package will result in the exact same files _xor_ a different path.
I wanted to do that because of a special need. I ran into trouble building library zlib. Because it has c library requirement. I managed to finally build it with a workaround [nix-env -p zlib --run 'cabal new-build'], but then wanted to experiment if i can build instead with putting the required c library paths into ~/.cabal/config. I needed to trigger a rebuild of zlib.
You could do something like cabal get zlib && cd zlib-$version && cabal new-build.
Closing in favour of #3333.