You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So because ghc-pkg list gives Cabal-1.18.1.3, then cabal has decided to pick that. It gets even more confusing when I do:
$ cabal haddock
cabal: You need to re-run the 'configure' command. The version of Cabal being
used has changed (was Cabal-1.18.1.3, now Cabal-1.20.0.1).
So while cabal install compiles a simple setup binary (which seems unnecessary, given its simple style), the haddock doesn't use that simple binary, so you get a version clash. It seems if I then do cabal configure that configures with 1.20, but a cabal install then has to reconfigure it.
In addition, I think because my location of Haddock has a space in it, Cabal-1.18 fails to install the docs but Cabal-1.20 succeeds.
This happens because of the difference between the internal and external setup methods. Normally for build-type: Simple packages the internal setup method is used, but the parallel install requires using the external setup method. Since you don't have Cabal-1.20.0.1 installed, the setup script is compiled against Cabal-1.18.
One solution is to install the matching version of the Cabal library, or to ship an older version of cabal-install. Haskell Platform does the latter.
@23Skidoo, that's pretty bad. If @snoyberg and I ship an old version then as soon as someone does cabal update they get a warning message saying they should upgrade. If we ship a newer version then cabal install and cabal configure use different versions. I'd consider that a pretty bad bug in parallel install - why can't parallel install just use the cabal.exe it comes with for internal builds? For example, add an extra (hidden) mode to cabal.exe that does whatever the external setup method does?
I still regularly run into bugs and confusion around this. I don't remember what the last issue was I commented on regarding this problem, but I'd love if this situation was improved.
as soon as someone does cabal update they get a warning message saying they should upgrade.
This was removed recently.
For example, add an extra (hidden) mode to cabal.exe that does whatever the external setup method does?
That's how I implemented it initially, but @dcoutts thought that the patch was too intrusive. Why can't you ship a new version of Cabal if you are already shipping a new cabal-install? Having two Cabals installed should work fine.
IIRC @ttuegel was looking into making reconfigure happen automatically when the Cabal version has changed (#2214).
Mmm, the fact that it switches back and forth due to using parallel or not is pretty bad in terms of knock-on consequences. Though having picked an older one ideally we shouldn't then insist on switching back again.
Installing the newer Cabal and switching back seems undesirable - the old Cabal doesn't work for many of the things I want to do (including generate documentation, as my Haddock is somewhere with a space in it). Wouldn't just having a submode to cabal so that cabal install in parallel uses the compiled version work better? I think the original design by @23Skidoo sounds preferable.
We are aiming to ship a vanilla GHC release with some extra binaries that should have been in the GHC binary all along (e.g. cabal). Upgrading the packages inside GHC isn't feasible, because we are just repackaging.
Activity
23Skidoo commentedon Feb 24, 2015
This happens because of the difference between the internal and external setup methods. Normally for
build-type: Simplepackages the internal setup method is used, but the parallelinstallrequires using the external setup method. Since you don't have Cabal-1.20.0.1 installed, the setup script is compiled against Cabal-1.18.One solution is to install the matching version of the Cabal library, or to ship an older version of cabal-install. Haskell Platform does the latter.
ndmitchell commentedon Feb 25, 2015
@23Skidoo, that's pretty bad. If @snoyberg and I ship an old version then as soon as someone does
cabal updatethey get a warning message saying they should upgrade. If we ship a newer version thencabal installandcabal configureuse different versions. I'd consider that a pretty bad bug in parallel install - why can't parallel install just use thecabal.exeit comes with for internal builds? For example, add an extra (hidden) mode tocabal.exethat does whatever the external setup method does?snoyberg commentedon Feb 25, 2015
I still regularly run into bugs and confusion around this. I don't remember what the last issue was I commented on regarding this problem, but I'd love if this situation was improved.
23Skidoo commentedon Feb 26, 2015
This was removed recently.
That's how I implemented it initially, but @dcoutts thought that the patch was too intrusive. Why can't you ship a new version of Cabal if you are already shipping a new
cabal-install? Having two Cabals installed should work fine.IIRC @ttuegel was looking into making reconfigure happen automatically when the Cabal version has changed (#2214).
dcoutts commentedon Mar 3, 2015
Mmm, the fact that it switches back and forth due to using parallel or not is pretty bad in terms of knock-on consequences. Though having picked an older one ideally we shouldn't then insist on switching back again.
ndmitchell commentedon Mar 8, 2015
Installing the newer Cabal and switching back seems undesirable - the old Cabal doesn't work for many of the things I want to do (including generate documentation, as my Haddock is somewhere with a space in it). Wouldn't just having a submode to cabal so that cabal install in parallel uses the compiled version work better? I think the original design by @23Skidoo sounds preferable.
We are aiming to ship a vanilla GHC release with some extra binaries that should have been in the GHC binary all along (e.g. cabal). Upgrading the packages inside GHC isn't feasible, because we are just repackaging.
ttuegel commentedon Mar 24, 2015
This is a duplicate of #1938.
dcoutts commentedon Jun 1, 2015
I think I must have misunderstood @23Skidoo's approach. I agree it's sensible. @tibbe and I implemented it yesterday, see #2633.
tibbe commentedon Jun 2, 2015
#2633 fixes this:
So as you can see no setup executable is built and cabal just calls itself.
Allow using cabal program itself as the external setup method
Allow using cabal program itself as the external setup method
Allow using cabal program itself as the external setup method