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

Build with Cabal-3.8 and GHC 9.4 #1141

Merged
merged 7 commits into from
Oct 29, 2022
Merged

Build with Cabal-3.8 and GHC 9.4 #1141

merged 7 commits into from
Oct 29, 2022

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented Oct 25, 2022

Fix #1120.

Warning! This PR makes hackage-server compile with Cabal-3.8, but does not add any Cabal-3.8 specific features.

Blocked on:

@andreasabel andreasabel added the re: Cabal-3.8 Concerning building with the Cabal-3.8 library label Oct 25, 2022
@andreasabel
Copy link
Member Author

Somehow the use of Cabal-3.8 fails with GHC 9.2 and below, with one factor being the dependencies of doctest-parallel. If in CI i fix ghc to the installed package, no build plan is found:

cabal-3.6.2.0: Could not resolve dependencies:
[__0] trying: hackage-server-0.5.1 (user goal)
[__1] rejecting: hackage-server:!test (constraint from config file, command line flag, or user target requires opposite flag selection)
[__1] trying: hackage-server:*test
[__2] trying: doctest-parallel-0.2.5 (dependency of hackage-server *test)
[__3] trying: ghc-9.2.4/installed-9.2.4 (dependency of doctest-parallel)
[__4] next goal: Cabal (dependency of hackage-server)
[__4] rejecting: Cabal-3.6.3.0/installed-3.6.3.0 (conflict: hackage-server => Cabal^>=3.8.1.0)
[__4] rejecting: Cabal-3.8.1.0 (conflict: ghc => process==1.6.13.2/installed-1.6.13.2, Cabal => process>=1.6.14.0 && <1.7)

I don't understand the last part: Cabal => process>=1.6.14.0 && <1.7. Where does this come from? On https://hackage.haskell.org/package/Cabal, the lower bound is >= 1.2. Ok, when looking closer, at https://hackage.haskell.org/package/Cabal-3.8.1.0/dependencies, then I see this:

if impl(ghc>=8.2)
  process >=1.6.14.0

I wonder what purpose is served by this? https://hackage.haskell.org/package/process-1.6.14.0 was released 2022-02-15, but GHC 8.2 was released much earlier (in 2017). Basically, no installed ghc will be compatible with such a recent version of process.

@andreasabel
Copy link
Member Author

@gbaz suggested in haskell/cabal#8554 (comment):

for just making things work for hackage server, we can toss allow-older into the cabal.project file

This works locally (e.g. on my machine). However, haskell-ci which generates our cabal-CI does not take the cabal.project* files into account, it actually deletes them. Also, it does not support allow-newer/older settings to be passed in via the cabal.haskell-ci configuration file. This somehow makes sense, as it tests the packages as if it had been released to hackage. In particular it uses the sdist generated tarball rather than the repo code directly. This was actually a feature I wanted, to detect files forgotten in the hackage-server.cabal file, see:

For now, I get haskell-ci.yml to pass by switching off the tests for ghc < 9.4. This removes the dependency path doctest-parallel -> ghc -> process, so it is ok if Cabal-3.8 wants a too recent process.

I don't have any clue how to fix the nix-shell.yml workflow. @peterbecich, could you have a look?
It seems to use ghc-9.0 and seems to want to build the tests. If you upgrade it to ghc-9.4 it might just work.

#if MIN_VERSION_Cabal(3,7,0)
import Distribution.Fields.Pretty
( pattern NoComment )
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, instead of #if, we could burn the bridges and drop Cabal-3.6 entirely.

@@ -39,6 +40,9 @@ import Distribution.Version
import Distribution.Compiler (CompilerFlavor)
import Distribution.FieldGrammar (prettyFieldGrammar)
import Distribution.Fields.Pretty (PrettyField (..), showFields)
#if MIN_VERSION_Cabal(3,7,0)
import Distribution.Fields.Pretty (pattern NoComment)
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want this file to remain in sync with its copy in hackage-cli, so the CPP would stay here.

@andreasabel
Copy link
Member Author

@gbaz : With CI green, maybe you want to review now?

@andreasabel andreasabel requested a review from gbaz October 28, 2022 07:31
Copy link
Contributor

@gbaz gbaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

What 3.8 specific features do you think we need to consider supporting, if any?

@ulysses4ever
Copy link
Contributor

Multi-lib packages?

@andreasabel
Copy link
Member Author

I don't have any clue how to fix the nix-shell.yml workflow. @peterbecich, could you have a look?
It seems to use ghc-9.0 and seems to want to build the tests. If you upgrade it to ghc-9.4 it might just work.

I fixed this by adding allow-older: Cabal:process to the cabal.project file. But anyway, there seems a 22.05 nixos available (I could be mistaken) so we could upgrade from 21.11, maybe.

@andreasabel
Copy link
Member Author

I'll merge this now, and open an issue for supporting Cabal-3.8 features.

@andreasabel andreasabel merged commit 0632086 into master Oct 29, 2022
@andreasabel andreasabel deleted the Cabal-3.8 branch October 29, 2022 09:37
gbaz added a commit that referenced this pull request Jan 5, 2023
* delete unused GitHub Action; fix CI badge

* Fix #1076: separate validators from UI and doctest them (#1077)

* Cachix caching for nix-shell GitHub Action (#1081)

* Add uploaded_at field in package api (#1080)

* package page: Include virtual-modules in module tree (#1085)

* Allow hashable-1.4 and text-2.0 (#1089)

* Divide sitemap into parts

* Add sitemap link for subdirectories

* Fix `non-canonical-return` warnings

* Bump CI to GHC 9.2.3 and restrict to master branch

* Check authorisation (#1111)

* Dynamically add css piece

* Fix #1105: change order of markdown parsers to allow pipes in lists

* Fix #1128, fix #1130 by adding bounds to Cabal-syntax and haddock-library

* Bump CI to 9.2.4 and some deps

* Force .txt and .text to have UTF-8 MIME charset (#1133)

* Upgrade to haddock-library-1.11.0 (#1126)

* attempt to speed up GitHub Action for Nix Shell

* work with cabal 3.8

* Updated accepted licenses (#1092)

* Add dependabot for github workflows

* Bump cachix/cachix-action from 10 to 12

* Bump actions/checkout from 2.4.0 to 3.1.0
* Bump cachix/install-nix-action from 17 to 18

* Build with Cabal-3.8 and GHC 9.4 (#1141)

* Haskell CI: bump to Ubuntu-22.04, GHC 9.2.5 and 9.4.4

* Allow mtl-2.3 and transformers-0.6 (#1150)

* Disable test (#1124)

* allow disable tests on client side

* add deprecated version warning (#1123)

* List maintainers on package page (#1098)

* List maintainers on package page

* Vendor snowball package (#1116)

* Add searchbox metadata (#1115)

* Add captcha for user registration (#1099)

* remove filtering 00-index for cabal version < 2.0 hack (#1152)

* Add lastVersion in listings (#749) (#1140)

* rm icu dep instructions, add libgd

* Add test log display (#1100)

* Add test log

* Reverse Dependencies indexed on PackageName (#1082)

* Rebased Reverse Dependencies

* Add "Quick Jump" to candidate package page (#1122)

* Solves #1029 - Adds paging to recent packages and recent revisions (#1055)

* support for `prefers-color-scheme` (#1008)

* 2x brightness for captions and links in dark color scheme

* table dark color scheme

* prefers-color-scheme for links, footer, and table-of-contents

* paginator css for `prefers-color-scheme`

* Maintainer notifications

* cleanup partial functions for revdeps, elim use of MonadThrow, MonadCatch

* fix tests enablement link

Co-authored-by: Peter Becich <[email protected]>
Co-authored-by: Andreas Abel <[email protected]>
Co-authored-by: Hécate Moonlight <[email protected]>
Co-authored-by: Matthew Pickering <[email protected]>
Co-authored-by: ˌbodʲɪˈɡrʲim <[email protected]>
Co-authored-by: Alias Qli <[email protected]>
Co-authored-by: Ondřej Kubánek <[email protected]>
Co-authored-by: Gautier DI FOLCO <[email protected]>
Co-authored-by: Janus Troelsen <[email protected]>
Co-authored-by: Levi Butcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: Cabal-3.8 Concerning building with the Cabal-3.8 library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support GHC 9.4
3 participants