Help us beta test "no-reinstall Cabal"
August 29, 2015Over this summer, Vishal Agrawal has been working on a GSoC project to move Cabal to more Nix-like package management system. More simply, he is working to make it so that you’ll never get one of these errors from cabal-install again:
Resolving dependencies...
In order, the following would be installed:
directory-1.2.1.0 (reinstall) changes: time-1.4.2 -> 1.5
process-1.2.1.0 (reinstall)
extra-1.0 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
process-1.2.0.0
hoogle-4.2.35
haskell98-2.0.0.3
ghc-7.8.3
Cabal-1.22.0.0
...
However, these patches change a nontrivial number of moving parts in Cabal and cabal-install, so it would be very helpful to have willing guinea pigs to help us iron out some bugs before we merge it into Cabal HEAD. As your prize, you’ll get to run “no-reinstall Cabal”: Cabal should never tell you it can’t install a package because some reinstalls would be necessary.
Here’s how you can help:
- Make sure you’re running GHC 7.10. Earlier versions of GHC have a hard limitation that doesn’t allow you to reinstall a package multiple times against different dependencies. (Actually, it would be useful if you test with older versions of GHC 7.8, but only mostly to make sure we haven’t introduced any regressions here.)
git clone https://github.com/ezyang/cabal.git(I’ve added some extra corrective patches on top of Vishal’s version in the course of my testing) andgit checkout cabal-no-pks.- In the
Cabalandcabal-installdirectories, runcabal install. - Try building things without a sandbox and see what happens! (When I test, I’ve tried installing multiple version of Yesod at the same time.)
It is NOT necessary to clear your package database before testing. If you completely break your Haskell installation (unlikely, but could happen), you can do the old trick of clearing out your .ghc and .cabal directories (don’t forget to save your .cabal/config file) and rebootstrapping with an old cabal-install.
Please report problems here, or to this PR in the Cabal tracker. Or chat with me in person next week at ICFP. :)
I decided to give this a try. Installed yesod and setup a project, all went well. A bit later I tried to install Snap and this was the result:
http://lpaste.net/140612
I say “a bit later” because I can’t recall if I installed any other packages in between.
I’m running this on Windows 10, btw.
Indeed, large enough that lpaste seems not to like it :)
https://onedrive.live.com/redir?resid=C3B85758C5D07CE2!44413&authkey=!AD3S72tv4z6ApEM&ithint=file%2czip
ghc –version reports:
The Glorious Glasgow Haskell Compilation System, version 7.10.2
Hmm. Probably doing something wrong, but I’m getting the same result as before.
The package keys referenced in the errors from the last command appear to be identical to the previous attempt.
Hello dgpratt,
This was a bit tricky to debug, but I think the problem is that you actually have the old buggy version of Cabal installed parallel with the good version (thanks to no-reinstall) and lens is picking the old version to compile against (I guess this is a bug; I think we have a plan to solve this actually). You can verify by checking: ghc-pkg list Cabal; there will be two Cabal-1.23.0.0 entries. So just ‘ghc-pkg unregister Cabal-1.23.0.0’ and then reinstall Cabal and cabal-install, and then reinstall lens and try again. (Or if you can figure out which one is new, unregister that specific one with ‘ghc-pkg unregister –ipid IPID’; no need to reinstall in that case.)
To test the fix, you can do as before; a faster method, however, is to ‘cabal unpack lens’, cd’ing to the directory, ‘cabal configure’ and then look at ‘dist/build/autogen/cabal_macros.h’; scroll to the end and look to see that current package key is “3n5vL4MDitwxi3zZCJ0Kys” and not “lens-4.13-3n5vL4MDitwxi3zZCJ0Kys” (or similar).
You already know this, but for anyone else who happens upon this, you were right. The proposed fix did indeed fix it.
Thanks!
I have cloned the repo and did
> ./setup-dev.sh
but it fails with
[…] [75 of 82] Compiling Distribution.Simple.Build ( Distribution/Simple/Build.hs, Distribution/Simple/Build.o )
Distribution/Simple/Build.hs:408:58: Not in scope: ‘configFlags’ Perhaps you meant data constructor ‘ConfigFlags’ (imported from Distribution.Simple.Setup)
PS using
> cabal –version cabal-install version 1.22.9.0 using version 1.22.5.0 of the Cabal library > ghc –version The Glorious Glasgow Haskell Compilation System, version 7.10.3