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
{{ message }}
Repository navigation
I shouldn't have to manually re-run cabal configure #2214
[callen@localhost ~/code/bloodhound]$ cabal repl
cabal: You need to re-run the 'configure' command. The version of Cabal being
used has changed (was Cabal-1.20.0.0, now Cabal-1.20.0.1). Additionally the
compiler is different (was ghc-7.8, now ghc-7.6) which is probably the cause
of the problem.
[callen@localhost ~/code/bloodhound]$ cabal configure
Resolving dependencies...
Configuring bloodhound-0.4.0.0...
[callen@localhost ~/code/bloodhound]$ cabal repl
Preprocessing library bloodhound-0.4.0.0...
[1 of 4] Compiling Database.Bloodhound.Types.Class ( Database/Bloodhound/Types/Class.hs, dist/build/Database/Bloodhound/Types/Class.o )
[2 of 4] Compiling Database.Bloodhound.Types ( Database/Bloodhound/Types.hs, dist/build/Database/Bloodhound/Types.o )
Easily in the realm of "just do it". Users shouldn't have to fuss with this.
[callen@cumae ~/work/bloodhound]$ cabal test
cabal: You need to re-run the 'configure' command. The version of Cabal being
used has changed (was Cabal-1.20.0.2, now Cabal-1.20.0.1).
[callen@cumae ~/work/bloodhound]$ cabal configure --enable-tests
Resolving dependencies...
Configuring bloodhound-0.4.0.0...
[callen@cumae ~/work/bloodhound]$ cabal test
Building bloodhound-0.4.0.0...
Preprocessing library bloodhound-0.4.0.0...
[2 of 4] Compiling Database.Bloodhound.Types ( Database/Bloodhound/Types.hs, dist/build/Database/Bloodhound/Types.o )
"The version of Cabal being used has changed." The LocalBuildInfo format can change dramatically between versions, so it is not sufficient to look up the ConfigFlags from dist/setup-config. I propose we store the flags in dist/setup-config-flags in a backward- and forward-compatible format. The format used by the cabal.config parser should do nicely, we just need to ignore unrecognized fields. We probably want to move that parser to Cabal; the setup/cabal behavior has been getting pretty divergent lately. We'll need a pretty printer if that module doesn't have one already.
If the old version of Cabal was too old to write dist/setup-config-flags, we will have to try parsing the setup-config anyway. I made some changes for improve dist/setup-config format mismatch detection #2251 so we can now at least attempt to parse old files. With the new binary setup-config coming, we may want to keep around the oldest text setup-config format so we can bridge the gap.
Working on this now. I have changed my mind about how this should be implemented. We need to save the flags given to configure in a totally version independent way, so I'm just going to serialize the result of getArgs into dist/setup-config-flags. When we need to reconfigure, we'll just invoke main with the saved arguments using withArgs. This may still fail between versions when the command-line interface changes, but that happens only rarely. (Even that failure should give reasonable error messages.)
the ghc library needs the Cabal library that shipped with the compiler
conflict: the Cabal that ships with ghc is not the Cabal you asked for.
IOW, it's the basic diamond-dependency Cabal-hell problem. IIRC, newer ghc versions do not link to Cabal, so they do not have this restriction, but that doesn't really help since ghc-7.10 has those performance regressions.
The only workaround I can think of ATM is to build the custom setup manually, i.e. ghc --make Setup.hs. Then you can ./Setup configure --enable-tests, ./Setup build, and ./Setup test. You may be able to use the sandbox if you configure with --package-db=.cabal-sandbox/${arch}-ghc-${version}-packages.conf.d. (I am aware that this is deeply unsatisfying, even if it works.)
@ttuegel and I had a chat about the state of this bug, here are some notes:
@ttuegel has agreed that this can make it's way into the next feature release
There was some miscommunication about how this feature interacts with new-build, but we came to an agreement that reconfigure would not be exercised by a new-build style build system, because the build system always knows what the necessary set of configuration flags are, and will just call Setup configure as necessary. (Similarly, Stack wouldn't benefit from reconfigure since if the Cabal library version changes, you're rebuilding the world anyway.)
Reconfigure will still help people using old-style build/sandboxes
new-build will NOT be default in 2.0, and given that the patch is very nearly complete (it is missing some wiring up on the cabal-install side, and a cabal-install wrapper for the reconfigure command), it makes sense to help out users for at least one feature release avoid this problem
Activity
yogsototh commentedon Nov 13, 2014
+1
YoEight commentedon Nov 13, 2014
+1
bitemyapp commentedon Nov 20, 2014
Additional example:
rgrinberg commentedon Nov 20, 2014
Yes please. +12312738912. Looks like @bitemyapp will be cabal's usability expert after that conversation with Paul Phillips :D
ttuegel commentedon Dec 9, 2014
Some design notes:
There are two cases we need to cover.
LocalBuildInfoformat can change dramatically between versions, so it is not sufficient to look up theConfigFlagsfromdist/setup-config. I propose we store the flags indist/setup-config-flagsin a backward- and forward-compatible format. The format used by thecabal.configparser should do nicely, we just need to ignore unrecognized fields. We probably want to move that parser to Cabal; thesetup/cabalbehavior has been getting pretty divergent lately. We'll need a pretty printer if that module doesn't have one already.dist/setup-config-flags, we will have to try parsing thesetup-configanyway. I made some changes for improve dist/setup-config format mismatch detection #2251 so we can now at least attempt to parse old files. With the new binarysetup-configcoming, we may want to keep around the oldest textsetup-configformat so we can bridge the gap.mietek commentedon Jan 5, 2015
It would be nice to have this fixed.
ttuegel commentedon Jan 5, 2015
Working on this now. I have changed my mind about how this should be implemented. We need to save the flags given to configure in a totally version independent way, so I'm just going to serialize the result of
getArgsintodist/setup-config-flags. When we need to reconfigure, we'll just invokemainwith the saved arguments usingwithArgs. This may still fail between versions when the command-line interface changes, but that happens only rarely. (Even that failure should give reasonable error messages.)bitemyapp commentedon Jun 11, 2015
@ttuegel is this resolved or still pending for cabal-install-1.24?
ttuegel commentedon Jun 12, 2015
I'm still working on this. (I almost fell into the yak-shaving trap, implementing a feature that would make this one easier to implement.)
4 remaining items
ttuegel commentedon Jun 19, 2015
OK, here is the problem:
This says:
IOW, it's the basic diamond-dependency Cabal-hell problem. IIRC, newer ghc versions do not link to Cabal, so they do not have this restriction, but that doesn't really help since ghc-7.10 has those performance regressions.
The only workaround I can think of ATM is to build the custom setup manually, i.e.
ghc --make Setup.hs. Then you can./Setup configure --enable-tests,./Setup build, and./Setup test. You may be able to use the sandbox if you configure with--package-db=.cabal-sandbox/${arch}-ghc-${version}-packages.conf.d. (I am aware that this is deeply unsatisfying, even if it works.)bitemyapp commentedon Jun 19, 2015
@ttuegel
er, what performance regressions?
I'll try the manual setup build, thank you!
Update: that got me going. Now to attack other problems 👍 🐻 🌳
ttuegel commentedon Sep 20, 2015
I have a work-in-progress/preview in PR #2829.
ezyang commentedon Sep 6, 2016
@ttuegel and I had a chat about the state of this bug, here are some notes:
new-build, but we came to an agreement that reconfigure would not be exercised by a new-build style build system, because the build system always knows what the necessary set of configuration flags are, and will just callSetup configureas necessary. (Similarly, Stack wouldn't benefit from reconfigure since if the Cabal library version changes, you're rebuilding the world anyway.)Add `reconfigure` command
Add `reconfigure` command