Skip to content

RFC remove allow-older and allow-newer support from Setup.hs #3581

Closed

Description

@phadej

Shortly: revert changes made in #3163 & #3165, as well as followed --allow-older changes.

Motivation: Such functionality isn't necessary (not used by anyone) to be provided by Cabal/Setup.hs†, and results into duplicate code (starting from argument parsing etc). --exact-configuration should be enough for everyone to force "I know what I'm doing". For the situations were "I almost know what I do, help me with rest", one could/should use external tools (e.g. cabal-install could have cabal solver command to produce configuration file).

Optional:

  • Add --exact-configuration to cabal-install
  • Add cabal solver (we now use cabal configure -v2 --dry-run, but it feels semantically wrong).

Alternative: leave --allow-newer in Cabal, only remove followed --allow-older changes. IMHO this would lead to confusion. --allow-older hasn't hit Hackage AFAIK.

Note: this is proposal to remove them only from Cabal-the-library, cabal-install will continue to have them.

† AFAICS stack opted to use --exact-configuration commercialhaskell/stack#1579 (comment)

ping @hvr, @ezyang, @23Skidoo, @dcoutts

Activity

  1. changed the title [-]RFC remove allow-older and allow-newer supoort from Setup.hs[/-] [+]RFC remove allow-older and allow-newer support from Setup.hs[/+] on Jul 21, 2016
  2. ezyang commented on Jul 21, 2016

    @ezyang
    Contributor

    OK, fine. But we need a test which demonstrates that --exact-configuration is sufficient to override the package's build-depends.

  3. kosmikus commented on Jul 21, 2016

    @kosmikus
    Contributor

    Seems I'm missing a whole lot. In particular, I have not the slightest idea what --exact-configuration is or does. Where can I read up on this?

  4. ezyang commented on Jul 21, 2016

    @ezyang
    Contributor

    @kosmikus The situation is that Cabal the library has a miniature dependency solver, which picks dependencies when a user runs ./Setup configure. This solver is run even when you say --dependency="foo=foo-0.5-blahblah" because you may not have specified a complete set of dependencies and flags. Of course, if you're running cabal-install, by the time you get to the setup script you know exactly what dependencies you want. So you can then say ./Setup configure --exact-configuration --dependency="foo=foo-0.5-blahblah" and then no solver is run; we just take the command line arguments on faith.

    exact-configuration is completely undocumented and I know about it from reading the configure source code.

  5. 23Skidoo commented on Jul 22, 2016

    @23Skidoo
    Member

    Motivation: Such functionality isn't necessary (not used by anyone)

    Well, the reason it was added was because a user requested it. If @snoyberg no longer needs it, we can reconsider, but I don't think removing it buys us that much. #3165 added ~100 lines total, and more than half of those were comments and tests.

  6. snoyberg commented on Jul 22, 2016

    @snoyberg
    Collaborator

    CCing @mgsloan, who will know more about this than I do.

  7. mgsloan commented on Aug 10, 2016

    @mgsloan
    Collaborator

    We don't need such a flag. I recall a discussion that likely caused this to be implemented.

    stack build --allow-newer is more permissive than cabal-install's allow-newer. It causes all version constraints to instead be warnings. As far as I know, cabal-install does not have this capability. I guess it would mean installing all the latest versions, maybe?

  8. self-assigned this
    on May 18, 2017
  9. added a commit that references this issue on May 19, 2017
    a95b8f4
  10. acertain commented on Aug 27, 2018

    @acertain

    Nix currently runs Setup.hs, and not cabal configure (or any cabal command), so this is needed to avoid modifying cabal files afaik (which on nix is fairly involved). I was using this.

    EDIT: Nevermind, nix has doJailbreak

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions