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

Revert "Use a code generator for singletons-base's test suite" #624

Closed
wants to merge 1 commit into from

Conversation

RyanGlScott
Copy link
Collaborator

This reverts commit 3fb0b8b.

Sadly, Hackage does not yet accept package uploads that require cabal-version: 3.8 or later. See haskell/hackage-server#1351. Until then, we cannot use a cabal code generator, which requires 3.8.

This reverts commit 3fb0b8b.

Sadly, Hackage does not yet accept package uploads that require `cabal-version:
3.8` or later. See haskell/hackage-server#1351. Until
then, we cannot use a `cabal` code generator, which requires `3.8`.
@RyanGlScott
Copy link
Collaborator Author

Hm, some build failures arise with Cabal-3.14 (CI log):

[1 of 2] Compiling Main             ( /__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs, /__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/Main.o )
/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:36:25: error: [GHC-16444]
    • non-bidirectional pattern synonym ‘BuildCommonFlags’ used in an expression
    • In a record update at fields ‘buildVerbosity’, ‘buildDistPref’
      and with pattern synonym ‘BuildCommonFlags’.
      In the expression:
        emptyBuildFlags
          {buildVerbosity = haddockVerbosity f,
           buildDistPref = haddockDistPref f}
      In an equation for ‘haddockToBuildFlags’:
          haddockToBuildFlags f
            = emptyBuildFlags
                {buildVerbosity = haddockVerbosity f,
                 buildDistPref = haddockDistPref f}
   |
36 | haddockToBuildFlags f = emptyBuildFlags
   |                         ^^^^^^^^^^^^^^^...

/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:46:30: error: [GHC-83865]
    • Couldn't match type: Distribution.Utils.Path.SymbolicPathX
                             Distribution.Utils.Path.AllowAbsolute
                             Distribution.Utils.Path.Pkg
                             (Distribution.Utils.Path.Dir Distribution.Utils.Path.Dist)
        ‘do let testAutogenDir = autogenComponentModulesDir lbi suitecfg
            createDirectoryIfMissingVerbose verbosity True testAutogenDir
            let buildSingletonsBaseFile
                  = testAutogenDir </> buildSingletonsBaseModule <.> "hs"
            withLibLBI pkg lbi $ \ _ libCLBI -> do ...’
   |
57 |     createDirectoryIfMissingVerbose verbosity True testAutogenDir
   |                                                    ^^^^^^^^^^^^^^

/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:58:35: error: [GHC-83865]
    • Couldn't match type: Distribution.Utils.Path.SymbolicPathX
                             Distribution.Utils.Path.AllowAbsolute
                             Distribution.Utils.Path.Pkg
                             (Distribution.Utils.Path.Dir Distribution.Utils.Path.Source)
                     with: [Char]
      Expected: FilePath
        Actual: Distribution.Utils.Path.SymbolicPath
                  Distribution.Utils.Path.Pkg
                  (Distribution.Utils.Path.Dir Distribution.Utils.Path.Source)
    • In the first argument of ‘(</>)’, namely ‘testAutogenDir’
      In the expression:
        testAutogenDir </> buildSingletonsBaseModule <.> "hs"
      In an equation for ‘buildSingletonsBaseFile’:
          buildSingletonsBaseFile
            = testAutogenDir </> buildSingletonsBaseModule <.> "hs"
   |
58 |     let buildSingletonsBaseFile = testAutogenDir </> buildSingletonsBaseModule <.> "hs"
   |                                   ^^^^^^^^^^^^^^

/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:90:63: error: [GHC-83865]
    • Couldn't match type: Distribution.Utils.Path.SymbolicPathX
                             Distribution.Utils.Path.AllowAbsolute
                             Distribution.Utils.Path.Pkg
                             (Distribution.Utils.Path.Dir Distribution.Utils.Path.PkgDB)
                     with: [Char]
      Expected: [PackageDBX [Char]]
        Actual: [PackageDB]
    • In the second argument of ‘concatMap’, namely ‘dbs’
      In the expression: concatMap single dbs
      In a case alternative:
          (GlobalPackageDB : UserPackageDB : dbs)
            | all isSpecific dbs -> concatMap single dbs
   |
90 |         | all isSpecific dbs              -> concatMap single dbs
   |                                                               ^^^

/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:93:63: error: [GHC-83865]
    • Couldn't match type: Distribution.Utils.Path.SymbolicPathX
                             Distribution.Utils.Path.AllowAbsolute
                             Distribution.Utils.Path.Pkg
                             (Distribution.Utils.Path.Dir Distribution.Utils.Path.PkgDB)
                     with: [Char]
      Expected: [PackageDBX [Char]]
        Actual: [PackageDB]
    • In the second argument of ‘concatMap’, namely ‘dbs’
      In the second argument of ‘(:)’, namely ‘concatMap single dbs’
      In the expression: "-no-user-package-db" : concatMap single dbs
   |
93 |                                            : concatMap single dbs
   |                                                               ^^^

/__w/singletons/singletons/dist-newstyle/build/x86_64-linux/ghc-9.12.1/singletons-base-3.5/setup/setup.hs:95:63: error: [GHC-83865]
    • Couldn't match type: Distribution.Utils.Path.SymbolicPathX
                             Distribution.Utils.Path.AllowAbsolute
                             Distribution.Utils.Path.Pkg
                             (Distribution.Utils.Path.Dir Distribution.Utils.Path.PkgDB)
                     with: [Char]
      Expected: [PackageDBX [Char]]
        Actual: [PackageDB]
    • In the second argument of ‘concatMap’, namely ‘dbs’
      In the second argument of ‘(:)’, namely ‘concatMap single dbs’
      In the expression: "-clear-package-db" : concatMap single dbs
   |
95 |                                            : concatMap single dbs
   |                                                               ^^^

@RyanGlScott RyanGlScott marked this pull request as draft December 28, 2024 16:35
@ulysses4ever
Copy link

The failure you're getting with Cabal-3.14 is discussed in the release notes where it mentions haskell/cabal#9718

https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.0.0.md

@RyanGlScott
Copy link
Collaborator Author

Thanks for that link. Some searching also reveals this cabal-doctest PR, which had to adapt very similar code to build against Cabal-3.14. The changes required look pretty substantial...

@RyanGlScott
Copy link
Collaborator Author

Thankfully, I don't need to do this anymore now that I was able to upload singletons-base-3.5, which uses a code generator–based test suite instead. Closing.

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.

2 participants