Skip to content

I shouldn't have to manually re-run cabal configure #2214

Closed

Description

@bitemyapp
[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.

Activity

  1. yogsototh commented on Nov 13, 2014

    @yogsototh

    +1

  2. YoEight commented on Nov 13, 2014

    @YoEight

    +1

  3. bitemyapp commented on Nov 20, 2014

    @bitemyapp
    ContributorAuthor

    Additional example:

    [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 )
  4. rgrinberg commented on Nov 20, 2014

    @rgrinberg

    Yes please. +12312738912. Looks like @bitemyapp will be cabal's usability expert after that conversation with Paul Phillips :D

  5. ttuegel commented on Dec 9, 2014

    @ttuegel
    Member

    Some design notes:

    There are two cases we need to cover.

    1. "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.
    2. 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.
  6. self-assigned this
    on Dec 9, 2014
  7. mietek commented on Jan 5, 2015

    @mietek
    Contributor

    It would be nice to have this fixed.

  8. ttuegel commented on Jan 5, 2015

    @ttuegel
    Member

    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.)

  9. added this to the milestone on Apr 24, 2015
  10. bitemyapp commented on Jun 11, 2015

    @bitemyapp
    ContributorAuthor

    @ttuegel is this resolved or still pending for cabal-install-1.24?

  11. ttuegel commented on Jun 12, 2015

    @ttuegel
    Member

    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.)

  12. 4 remaining items

  13. ttuegel commented on Jun 19, 2015

    @ttuegel
    Member

    OK, here is the problem:

    ...
    trying: doctest-0.10.0/installed-bfa... (user goal)
    trying: ghc-7.8.4/installed-436... (dependency of doctest-0.10.0/installed-bfa...)
    next goal: Cabal (user goal)
    rejecting: Cabal-1.22.4.0 (global constraint requires ==1.22.3.0)
    rejecting: Cabal-1.22.3.0 (conflict: ghc => Cabal==1.18.1.5/installed-c52...)
    ...
    

    This says:

    1. bloodhound needs doctest
    2. doctest needs the ghc library
    3. the ghc library needs the Cabal library that shipped with the compiler
    4. 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.)

  14. bitemyapp commented on Jun 19, 2015

    @bitemyapp
    ContributorAuthor

    @ttuegel

    since ghc-7.10 has those performance regressions.

    er, what performance regressions?

    I'll try the manual setup build, thank you!

    Update: that got me going. Now to attack other problems 👍 🐻 🌳

  15. ttuegel commented on Sep 20, 2015

    @ttuegel
    Member

    I have a work-in-progress/preview in PR #2829.

  16. modified the milestones: cabal-install 1.24, on Feb 21, 2016
  17. modified the milestones: cabal-install 2.0, 2.0 on Sep 6, 2016
  18. ezyang commented on Sep 6, 2016

    @ezyang
    Contributor

    @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
  19. added 2 commits that reference this issue on Sep 10, 2016
    cb57fcf
    ae59bb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions