Skip to content

new-build runs into internal error after deleting from store #5290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
libeako opened this issue Apr 26, 2018 · 6 comments
Closed

new-build runs into internal error after deleting from store #5290

libeako opened this issue Apr 26, 2018 · 6 comments

Comments

@libeako
Copy link

libeako commented Apr 26, 2018

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)

@fgaz
Copy link
Member

fgaz commented Apr 27, 2018

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.

#3333 Will help with this

@libeako
Copy link
Author

libeako commented Apr 27, 2018

Then what is the recommended method to remove a package from the store ?

@fgaz
Copy link
Member

fgaz commented Apr 27, 2018

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.

@libeako
Copy link
Author

libeako commented Apr 27, 2018

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.

@23Skidoo
Copy link
Member

You could do something like cabal get zlib && cd zlib-$version && cabal new-build.

@23Skidoo
Copy link
Member

Closing in favour of #3333.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants