kowainik / summoner

🔮 🔧 Tool for scaffolding batteries-included production-level Haskell projects
https://kowainik.github.io/projects/summoner
Mozilla Public License 2.0
694 stars 73 forks source link

Build failure with cabal-3.5.0.0 and ghc-8.10.3 #529

Closed andreasabel closed 2 years ago

andreasabel commented 3 years ago

Build failed for me when using the cabal development version (cabal-3.5.0.0) and ghc-8.10.3. It worked however with cabal-3.2.0.0 and ghc-8.10.3.

So if this is not a problem with summoner, it should maybe reported upstream to https://github.com/haskell/cabal/issues. (However, you can likely make more sense of this error message than me.)

Log:

Build profile: -w ghc-8.10.3 -O1
In order, the following will be built (use -v for more details):
 - summoner-2.0.1.1 (lib) (requires build)
 - summoner-2.0.1.1 (exe:summon) (requires build)
Configuring library for summoner-2.0.1.1..
Preprocessing library for summoner-2.0.1.1..
Building library for summoner-2.0.1.1..
[ 1 of 23] Compiling Paths_summoner

dist/build/autogen/Paths_summoner.hs:66:22: error:
    • 'last' works with 'NonEmpty', not ordinary lists.
      Possible fix:
          Replace: [Char]
          With:    NonEmpty Char

      However, you can use 'last' with the ordinary lists.
      Apply 'viaNonEmpty' function from relude:
          viaNonEmpty last (yourList)
      Note, that this will return 'Maybe Char'
      therefore it is a safe function unlike 'last' from the standard Prelude
    • In the first argument of ‘isPathSeparator’, namely ‘(last dir)’
      In the expression: isPathSeparator (last dir)
      In a stmt of a pattern guard for
                     an equation for ‘joinFileName’:
        isPathSeparator (last dir)
   |
66 |   | isPathSeparator (last dir) = dir ++ fname
   |                      ^^^^^^^^

<no location info>: warning: [-Wunused-packages]
    The following packages were specified via -package or -package-id flags,
    but were not needed for compilation:
      - validation-selective-0.1.0.0
      - tomland-1.3.1.0
      - time-1.9.3
      - shellmet-0.0.3.1
      - process-1.6.9.0
      - optparse-applicative-0.15.1.0
      - neat-interpolation-0.3.2.6
      - gitrev-1.3.1
      - generic-data-0.8.3.0
      - filepath-1.4.2.1
      - directory-1.3.6.0
      - containers-0.6.2.1
      - colourista-0.1.0.0
      - aeson-1.5.5.1
cabal: Failed to build summoner-2.0.1.1 (which is required by exe:summon from
summoner-2.0.1.1).
vrom911 commented 3 years ago

Interesting changes! Seems like Cabal started to apply alternative prelude (specified through the mixins technique) to its auto-generated modules as well, which we can not control.

I guess you are correct, and the best we can do is to open the bug (regression) report to Cabal as nothing we could do here. I haven't tried the latest Cabal version, so I would be able to do so after checking that as well.

vrom911 commented 2 years ago

This issue was resolved in cabal-install-3.6.2.0. So the solution here would be to upgrade the Cabal version.