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

Support GHC 9.4 #1120

Closed
1 of 2 tasks
andreasabel opened this issue Aug 10, 2022 · 3 comments · Fixed by #1141
Closed
1 of 2 tasks

Support GHC 9.4 #1120

andreasabel opened this issue Aug 10, 2022 · 3 comments · Fixed by #1141
Assignees
Labels
re: Cabal-3.8 Concerning building with the Cabal-3.8 library

Comments

@andreasabel
Copy link
Member

andreasabel commented Aug 10, 2022

Blocked by:

@eddiejessup
Copy link

eddiejessup commented Oct 23, 2022

I dug into this and this is what I think is needed to support GHC 9.4

Does this sound right?

@andreasabel
Copy link
Member Author

andreasabel commented Oct 25, 2022

Thanks for digging in!
I am using doctest-parallel, not doctest, so I stroke out the first two items.
We should/must also switch to Cabal-3.8 to support the latest cabal syntax.

P.S.: With the following added to cabal.project.local and base and HTTP bump in hackage-server.cabal, cabal test succeeds:

allow-newer: ed25519:base
allow-newer: ed25519:ghc-prim
allow-newer: HStringTemplate:template-haskell

So the main work is to upgrade to Cabal-3.8.

@andreasabel
Copy link
Member Author

andreasabel commented Oct 25, 2022

Build attempt with Cabal-3.8.1.0 gives the following initial problems:

  • Server.Framework.Instances
src/Distribution/Server/Framework/Instances.hs:122:5: error: [-Wincomplete-patterns, -Werror=incomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘putCopy’:
        Patterns of type ‘OS’ not matched: Wasi
    |
122 |     putCopy (OtherOS s) = contain $ putWord8 0 >> safePut s
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Distribution/Server/Framework/Instances.hs:165:5: error: [-Wincomplete-patterns, -Werror=incomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘putCopy’:
        Patterns of type ‘Arch’ not matched:
            S390X
            Wasm32
    |
165 |     putCopy (OtherArch s) = contain $ putWord8 0 >> safePut s
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
  • Distribution.Server.Util.CabalRevisions: Can be ported from hackage-cli.
src/Distribution/Server/Util/CabalRevisions.hs:343:66: error:
    • Couldn't match expected type ‘Distribution.Fields.Pretty.CommentPosition’
                  with actual type ‘[a0]’
    • In the first argument of ‘const’, namely ‘[]’
      In the first argument of ‘showFields’, namely ‘(const [])’
      In the first argument of ‘(.)’, namely ‘showFields (const [])’
    |
343 |   changesOkList changesOk "source-repository" (showFields (const []) . (:[]) . ppSourceRepo)
    |                                                                  ^^

src/Distribution/Server/Util/CabalRevisions.hs:628:17: error:
    • The constructor ‘TestSuite’ should have 4 arguments, but has been given 3
    • In the pattern: TestSuite _nameA interfaceA buildInfoA
      In an equation for ‘checkTestSuite’:
          checkTestSuite
            componentName
            (TestSuite _nameA interfaceA buildInfoA)
            (TestSuite _nameB interfaceB buildInfoB)
            = do checkSame
                   "Cannot change test-suite type" interfaceA interfaceB
                 checkBuildInfo componentName buildInfoA buildInfoB
    |
628 |                (TestSuite _nameA interfaceA buildInfoA)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Next iteration:

  • Distribution.Server.Features.BuildReports.BuildReport
src/Distribution/Server/Features/BuildReports/BuildReport.hs:314:26: error:
    • Couldn't match expected type ‘Distribution.Fields.Pretty.CommentPosition’
                  with actual type ‘[a0]’
    • In the first argument of ‘const’, namely ‘[]’
      In the first argument of ‘showFields’, namely ‘(const [])’
      In the first argument of ‘(.)’, namely ‘showFields (const [])’
    |
314 | show = showFields (const []) . prettyFieldGrammar CabalSpecV2_4 fieldDescrs
    |                          ^^
  • Distribution.Server.Features.Tags.Backup
src/Distribution/Server/Features/Tags/Backup.hs:26:20: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns of type ‘BackupEntry’ not matched: BackupBlob _ _
   |
26 |     restoreEntry = \(BackupByteString entry bs) ->
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Distribution/Server/Features/Tags/Backup.hs:39:20: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns of type ‘BackupEntry’ not matched: BackupBlob _ _
   |
39 |     restoreEntry = \(BackupByteString entry bs) ->
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
  • Distribution.Server.Packages.Metadata
src/Distribution/Server/Packages/Metadata.hs:49:4: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘PkgTarball’ not matched: PkgTarball_v2_v1 _
   |
49 |    PkgTarball{..} = pkgTarball
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Distribution.Server.Features.DownloadCount
src/Distribution/Server/Features/DownloadCount.hs:195:11: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘[BackupEntry]’ not matched:
            []
            ((BackupBlob _ _):_)
            ((BackupByteString _ _):_:_)
    |
195 |       let [BackupByteString _ bs] = onDiskBackup onDiskStats
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@andreasabel andreasabel self-assigned this Oct 25, 2022
@andreasabel andreasabel added the re: Cabal-3.8 Concerning building with the Cabal-3.8 library label Oct 25, 2022
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 a pull request may close this issue.

2 participants