Skip to content

Refine the fix for requiring Cabal > 1.20 for Setup.hs #4058

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

Merged
merged 2 commits into from
Jan 1, 2017

Conversation

dcoutts
Copy link
Contributor

@dcoutts dcoutts commented Oct 29, 2016

Going along with the existing approach of using a constraint rather than altering the deps of custom Setup.hs scripts, but make the constraint only apply to Cabal instances that are dependencies of Setup.hs scripts not all instances of Cabal.

Also rearrange things a little with a dedicated solver policy function for adding a min dep on Cabal versions for setup scripts.

This is a follow-up to #4051. @ezyang @dagit

@kosmikus @grayjay could you have a look at my use of setupPP and let us know if this will make sure the constraint applies to all setup deps. I'm not quite sure about the linking and whether this will catch all cases of Cabal instances occurring as deps of Setup scripts.

@mention-bot
Copy link

@dcoutts, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dagit, @hvr and @ezyang to be potential reviewers.

@grayjay
Copy link
Collaborator

grayjay commented Oct 29, 2016

The use of setupPP looks right to me.

@dcoutts
Copy link
Contributor Author

dcoutts commented Oct 29, 2016

@grayjay thanks!

@ezyang
Copy link
Contributor

ezyang commented Oct 31, 2016

OK, fixing this ended up being a lot easier than I thought. Looks nice. But that CI needs to pass. Fortunately it just looks like something silly:

 new_build_requires_Cabal_1_20.sh (ignoring stdout+stderr):                        FAIL (1.43s)
      Unexpected exit status.

      Exit status: ExitFailure 1
      Working directory: /tmp/cabal-install-test-17715

      <stdout> was:
      Warning:
      /tmp/cabal-install-test-17715/custom-setup-old-cabal/custom-setup-old-cabal.cabal:
      A package using section syntax must specify at least
      'cabal-version: >= 1.2'.
      Resolving dependencies...
      cabal: Could not resolve dependencies:
      trying: custom-setup-1.0 (user goal)
      next goal: custom-setup-setup.Cabal (dependency of custom-setup-1.0)
      rejecting: custom-setup-setup.Cabal-1.18.1.5/installed-647... (constraint from
      minimum version of Cabal used by Setup.hs requires >=1.20)
      rejecting: custom-setup-setup.Cabal-1.24.0.0,
      custom-setup-setup.Cabal-1.22.8.0, custom-setup-setup.Cabal-1.22.7.0,
      custom-setup-setup.Cabal-1.22.6.0, custom-setup-setup.Cabal-1.22.5.0,
      custom-setup-setup.Cabal-1.22.4.0, custom-setup-setup.Cabal-1.22.3.0,
      custom-setup-setup.Cabal-1.22.2.0, custom-setup-setup.Cabal-1.22.1.1,
      custom-setup-setup.Cabal-1.22.1.0, custom-setup-setup.Cabal-1.22.0.0,
      custom-setup-setup.Cabal-1.20.0.4, custom-setup-setup.Cabal-1.20.0.3,
      custom-setup-setup.Cabal-1.20.0.2, custom-setup-setup.Cabal-1.20.0.1,
      custom-setup-setup.Cabal-1.20.0.0 (conflict: custom-setup =>
      custom-setup-setup.Cabal<1.20)
      rejecting: custom-setup-setup.Cabal-1.18.1.7,
      custom-setup-setup.Cabal-1.18.1.6, custom-setup-setup.Cabal-1.18.1.5,
      custom-setup-setup.Cabal-1.18.1.4, custom-setup-setup.Cabal-1.18.1.3,
      custom-setup-setup.Cabal-1.18.1.2, custom-setup-setup.Cabal-1.18.1.1,
      custom-setup-setup.Cabal-1.18.1, custom-setup-setup.Cabal-1.18.0,
      custom-setup-setup.Cabal-1.16.0.3, custom-setup-setup.Cabal-1.16.0.2,
      custom-setup-setup.Cabal-1.16.0.1, custom-setup-setup.Cabal-1.16.0,
      custom-setup-setup.Cabal-1.14.0, custom-setup-setup.Cabal-1.12.0,
      custom-setup-setup.Cabal-1.10.2.0, custom-setup-setup.Cabal-1.10.1.0,
      custom-setup-setup.Cabal-1.10.0.0, custom-setup-setup.Cabal-1.8.0.6,
      custom-setup-setup.Cabal-1.8.0.4, custom-setup-setup.Cabal-1.8.0.2,
      custom-setup-setup.Cabal-1.6.0.3, custom-setup-setup.Cabal-1.6.0.2,
      custom-setup-setup.Cabal-1.6.0.1, custom-setup-setup.Cabal-1.4.0.2,
      custom-setup-setup.Cabal-1.4.0.1, custom-setup-setup.Cabal-1.4.0.0,
      custom-setup-setup.Cabal-1.2.4.0, custom-setup-setup.Cabal-1.2.3.0,
      custom-setup-setup.Cabal-1.2.2.0, custom-setup-setup.Cabal-1.2.1,
      custom-setup-setup.Cabal-1.1.6 (constraint from minimum version of Cabal used
      by Setup.hs requires >=1.20)
      fail (backjumping, conflict set: custom-setup, custom-setup-setup.Cabal)
      Dependency tree exhaustively searched.
      die: Expect constraint failure

      ```

dcoutts and others added 2 commits December 31, 2016 14:57
Going along with the existing approach of using a constraint rather than
altering the deps of custom Setup.hs scripts, but make the constraint
only apply to Cabal instances that are dependencies of Setup.hs scripts
not all instances of Cabal.

Also rearrange things a little with a dedicated solver policy function
for adding a min dep on Cabal versions for setup scripts.
@hvr
Copy link
Member

hvr commented Jan 1, 2017

I've rebased (since the PR was created, the newly rewritten testsuite was merged) & fixed up the unit-test; I'll merge this as soon as Travis is done (and all is green).

@hvr hvr merged commit 19d9738 into haskell:master Jan 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants