Skip to content

Bump lower bound on base (because Cabal-syntax doesn't compile with GHC 7.10.3 and other old GHCs due to a bug) #8371

Closed

Description

@Mikolaj

It seems that Cabal-syntax doesn't compile with GHC 7.10.3 and other old GHCs (complains about unknown flags or extensions; seen on hackage-security CI). If so, we should bump the bound on base accordingly so that people don't need to add hacky conditions to the same effect to their package, e.g., see haskell/hackage-security@737ad61

I think it's fine if we bump to the same range that we have in CI. It may make sense to revise the bound on Hackage for 3.8.1.0, too.

Activity

  1. Mikolaj commented on Aug 12, 2022

    @Mikolaj
    MemberAuthor

    Got the errors with 7.10.3:

    Preprocessing library for Cabal-syntax-3.8.1.0..
    Building library for Cabal-syntax-3.8.1.0..
    ghc: unrecognised flag: -Wcompat
    unrecognised flag: -Wnoncanonical-monad-instances
    unrecognised flag: -Wnoncanonical-monadfail-instances
    

    in https://github.com/haskell/hackage-security/runs/7814994152?check_suite_focus=true

  2. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    Same errors: https://app.travis-ci.com/github/ivanperez-keera/dunai/jobs/579714292

    I don't think you need to bump the lower bound on base. You can just update the conditional ghc-options that is already in Cabal's cabal file to check also the lower bound:

    https://github.com/haskell/cabal/blob/master/Cabal/Cabal.cabal#L58-L63

  3. added a commit that references this issue on Aug 13, 2022
    719735d
  4. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    You are right, this is a safer fix. Please review the PR.

    I intend to emergency-merge this and then revise on Hackage for both packages.

  5. added a commit that references this issue on Aug 13, 2022
    0dc215e
  6. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    I just added some comments. In short: I think those flags were introduced in GHC 8.0, not GHC 8.2.

  7. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    I added my comments to 719735d, but there seems to have been a new commit 0dc215e. The comments still apply.

  8. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    I just added some comments. In short: I think those flags were introduced in GHC 8.0, not GHC 8.2.

    Yes, fixed for you. Initially I've just set as bound the last GHC version that we support.

  9. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    Oh thanks! :)

    But I am confused. Mikolaj@0dc215e still says 8.2. Am I missing something? Or do you mean that, for now, you'll just set it to the latest version that you support (8.2)? (That'd be fine.)

    EDIT: clarification

  10. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    Please look at the PR. Individual detached commits are pure chaos.

  11. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    Thanks. Now I see it.

  12. added a commit that references this issue on Aug 13, 2022
    1209433
  13. 1 remaining item

  14. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    It will take some more time to revise on Hackage. Will report here.

  15. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    It seems I can't revise #8373 on Hackage: "Cannot change the 'if' condition expressions". So the change will become active only when a new version is released. I guess base version bumps would work, but let's try to stick to the more subtle version, unless there's a widespread breakage.

  16. fgaz commented on Aug 13, 2022

    @fgaz
    Member

    Shouldn't 3.8.1.0 get a revision with a lower base version bump anyway since we can't make more precise changes?

  17. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    Shouldn't 3.8.1.0 get a revision with a lower base version bump anyway since we can't make more precise changes?

    Perhaps. But so far we have one user against and zero users for this course of action. Are you aware of packages that would need that (except hackage-security that I've just hacked not to need it)? Actually, we could query Hackage and check...

  18. added a commit that references this issue on Aug 13, 2022
    c8acbfe
  19. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    From another angle. Assuming we'd bump base version only in 3.8.1.0, revert it (just not apply it on Hackage) in 3.8.2.0, what bad side-effects can happen? Is there any risk?

    The bad effect is that packages that require old GHCs won't be able to use cabal 3.8.1.0, But they can't anyway, because while the build plan would succeed, the compilation would fail, right? Is there any scenario where the build plan goes through, but no compilation happens? Anything else that could go wrong with this one-time base bound bump?

  20. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    At a practical level ("extensionally"), I think you are probably right.

    At a deeper level, I think "The Right" (ahem) solution would be to publish a hotfix with what you just merged directly on top of the published 3.8.1 and deprecate the older version on hackage.

    I'm not familiar with Cabal's development process to know how hard that would be. I don't know if hotfixes are even a thing in Cabal. (And thanks for looking into this quickly.)

  21. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    Yes, indeed. But for the very practical reasons, I'd like to avoid the churn, both ours and of cabal users, given that the problem only affects >5 years old GHC users and the Hackage revision hack saves them the churn, as well, though it incurs the risk that whatever problem they already had or will have may get obscured (repo has different bounds than Hackage, etc.). Actually, anybody's problems get slightly obscured by Hackage revisions. But that's an old discussion. A trade-off.

  22. ivanperez-keera commented on Aug 13, 2022

    @ivanperez-keera
    Contributor

    I'd like to avoid the churn, both ours

    I definitely cannot weigh in on that.

    and of cabal users,

    I don't see any there. There's a new release, and a deprecated release. I suspect users will not be largely affected, expect perhaps those creating packages for distros and such.

    it incurs the risk that whatever problem they already had or will have may get obscured (repo has different bounds than Hackage, etc.)

    I think this is what I'm getting at with "at a deeper level". We even disable curation by hackage maintainers because, even if very well intended, it creates potential QA, verification (and in our case legal) issues to publish packages on hackage that don't match our releases on github. (This was a "policy" I instilled in our group at NASA, for example, and our internal requirements include it.)

  23. Mikolaj commented on Aug 13, 2022

    @Mikolaj
    MemberAuthor

    Thank you for you input @ivanperez-keera. Noted.

    The current plan, for which I'm seeking more comments and objections, is to bump lower base bound exclusively in the Cabal-syntax package, because this suffices to fix compilation breakage in hackage-security and in the old version of hackage-repo-tool that is currently on Hackage, so it's likely it fixes all or most breakages in the wild.

    Let's decide on Monday.

  24. Mikolaj commented on Aug 15, 2022

    @Mikolaj
    MemberAuthor

    No further objections, so I'm giving it a few more hours and I'm going to carry out the plan. I can then check how it affects hackage-repo-tool, before I actually publish new hackage-repo-tool that fixes this from another end. Thank you for all the input here and elsewhere.

  25. changed the title [-]Bump lower bound on base[/-] [+]Bump lower bound on base (because Cabal-syntax doesn't compile with GHC 7.10.3 and other old GHCs due to a bug)[/+] on Aug 15, 2022
  26. Mikolaj commented on Aug 15, 2022

    @Mikolaj
    MemberAuthor

    Bumped the lower bound in https://hackage.haskell.org/package/Cabal-syntax-3.8.1.0/revisions to

    base       >= 4.9      && < 5,
    

    which corresponds to GHC 8.0.

    This is a one-time workaround, not checked into the repo and not to be repeated in any new minor nor major releases.

  27. Mikolaj commented on Aug 15, 2022

    @Mikolaj
    MemberAuthor

    Actually, hackage-repo-tool was too outdated, with too restricted base bounds on its own, so it didn't start compiling again until I uploaded a new version to Hackage and now hackage-repo-tool builds again in our CI, e.g., see

    https://github.com/haskell/cabal/runs/7835252632?check_suite_focus=true

    However, I restarted hackage-security jobs for an older version of hackage-security at

    https://github.com/haskell/hackage-security/runs/7835204211?check_suite_focus=true

    and they now pass for GHC 7.10.3, whereas they failed before, so the workaround works.

    This issue is now fixed for a new release and worked around for the current one so let's let it rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions