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

singletons-{th,base}: Require building with GHC 9.12 #620

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Conversation

RyanGlScott
Copy link
Collaborator

@RyanGlScott RyanGlScott commented Dec 3, 2024

The most notable change is that because GHC 9.12 includes a fix for https://gitlab.haskell.org/ghc/ghc/-/issues/24911, the test suite output now includes explicit namespaces for its fixity declarations. Aside from that, the changes here are mostly bumping upper version bounds.

Checks off one box in #619.

@RyanGlScott RyanGlScott mentioned this pull request Dec 5, 2024
@RyanGlScott
Copy link
Collaborator Author

@phadej, do you know what is causing the CI issue here?

Cloning into '/__w/singletons/singletons/dist-newstyle/src/th-desugar-28dc69f1833d071d'...
HEAD is now at 730a0ed Adapt to (but don't support) or-patterns
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.12.1.0 supports 'ghc' version < 9.12): /github/home/.ghcup/ghc/9.12.0.20241128/bin/ghc is version 9.12.0.20241128
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: singletons-base-3.5 (user goal)
[__1] next goal: singletons-base:setup.Cabal (dependency of singletons-base)
[__1] rejecting: singletons-base:setup.Cabal-3.14.0.0/installed-5c53 (constraint from maximum version of Cabal used by Setup.hs requires <3.14)
[__1] rejecting: singletons-base:setup.Cabal; 3.2.1.0, 3.0.2.0, 2.4.1.0 (constraint from minimum version of Cabal used by Setup.hs requires >=3.12)
[__1] fail (backjumping, conflict set: singletons-base, singletons-base:setup.Cabal)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: singletons-base:setup.Cabal, singletons-base

I don't observe this when building the code locally, only with haskell-ci.

@phadej
Copy link

phadej commented Dec 9, 2024

@RyanGlScott allow-newer doesn't relax the setup-depends dependencies (there is an issue from 2019 at Cabal issue tracker). And Cabal-3.12 (which cabal-install-3.12) has hard implicit setup-depends constraint Cabal <3.14.

You have two options:

  • Don't use build-type: Custom
  • wait until there is cabal-install-3.14 release so we can use it in haskell-ci
  • and actually third option: fix the allow-newer cabal-install issue (but that won't help you this time).

@RyanGlScott
Copy link
Collaborator Author

Bummer. I suppose we should expedite fixing #532, since that would allow us to finally get rid of the custom Setup.hs script in singletons-base.

@RyanGlScott
Copy link
Collaborator Author

I have implemented a fix for #534, and I have rebased this PR on top of it. Sadly, the CI still fails because #534 introduces a dependency on ghc-paths (see haskell/cabal#10632 for why this is necessary), and ghc-paths also has a custom Setup.hs script. As such, we encounter the same build plan failure as in #620 (comment). Sigh.

@RyanGlScott RyanGlScott force-pushed the ghc-9.12 branch 3 times, most recently from 08ba505 to 6098243 Compare December 10, 2024 14:07
@RyanGlScott
Copy link
Collaborator Author

I had to do some slightly unsavory things to get there, but I managed to get singletons-base to build with head.hackage on GHC 9.12. As such, I feel pretty confident that this will be ready to land after #532.

The most notable change is that because GHC 9.12 includes a fix for
https://gitlab.haskell.org/ghc/ghc/-/issues/24911, the test suite output now
includes explicit namespaces for its fixity declarations. Aside from that, the
changes here are mostly bumping upper version bounds.

Checks off one box in #619.
This adds a Haskell-CI patch file containing workarounds for the following
`cabal` issues when building with `head.hackage` + GHC 9.12:

* haskell/cabal#6522: Remove the use of
  `head.hackage.ghc.haskell.org:override` in the `cabal` configuration file so
  that `ghc-paths`' custom `Setup.hs` script can find a suitable `Cabal`
  version.

* haskell/cabal#10500: Remove the use of
  `allow-newer: *:Cabal *:Cabal-syntax` in the generated `cabal.project` file.

We should be able to remove this patch file once we no longer depend on the use
of `head.hackage`, as well as when Haskell-CI upgrades to use
`cabal-install-3.14`.
@RyanGlScott RyanGlScott marked this pull request as ready for review December 11, 2024 12:17
@RyanGlScott RyanGlScott merged commit ac23235 into master Dec 11, 2024
26 checks passed
@RyanGlScott RyanGlScott deleted the ghc-9.12 branch December 11, 2024 12:28
@RyanGlScott RyanGlScott mentioned this pull request Dec 11, 2024
3 tasks
@RyanGlScott
Copy link
Collaborator Author

Sigh. There is one last obstacle: Hackage simply won't let you upload a package that requires cabal-version: 3.8 (see haskell/hackage-server#1351), but cabal code generators require 3.8 or later. I'm not sure if this is easily fixable on Hackage's end, but if not, I'll have to revert the changes from #532 in the meantime.

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.

None yet

2 participants