Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
phadej opened this issue Jul 21, 2016 · 7 comments
Closed

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

phadej opened this issue Jul 21, 2016 · 7 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Jul 21, 2016

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

@phadej phadej 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 Jul 21, 2016
@ezyang
Copy link
Contributor

ezyang commented Jul 21, 2016

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

@kosmikus
Copy link
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?

@ezyang
Copy link
Contributor

ezyang commented Jul 21, 2016

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

@23Skidoo
Copy link
Member

23Skidoo commented Jul 22, 2016

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.

@snoyberg
Copy link
Collaborator

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

hvr referenced this issue Jul 24, 2016
This implements the flag `--allow-older` which is the analogous to
`--allow-newer` acting on lower bounds.
@mgsloan
Copy link
Collaborator

mgsloan commented Aug 10, 2016

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?

@hvr hvr self-assigned this May 18, 2017
hvr added a commit to hvr/cabal that referenced this issue May 19, 2017
This is a preparatory refactoring needed for future work such as haskell#4203.

I've refrained from doing additional cleanups in order to keep this a
refactoring that mostly moves around blocks of code mostly
unchanged (except for whitespace), and make it easier to review.

This feature was originally implemented because its lack was complained
about by Stack/Stackage developers. However, after it got implemented it
was never really being used; what's more, it's causing us overhead for
no benefit as well as blocking us improving the implementation via the
likes of haskell#4203.

Closes haskell#3581
@hvr hvr closed this as completed in #4527 May 19, 2017
@acertain
Copy link

acertain commented Aug 27, 2018

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
Projects
None yet
Development

No branches or pull requests

8 participants