kowainik / summoner

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

Failing to build summoner-2.0.1.1 using cabal #552

Closed khrynczenko closed 2 years ago

khrynczenko commented 2 years ago

Hello, I encounter the following problem when building summoner 2.0.1.1 from sources.

I simply did the following as in the instructions:

cabal get -s summoner
cd summoner
cabal update
cabal install summoner-cli:exe:summon

Below is the failure message.

Failed to build summoner-2.0.1.1.
Build log (
/home/wednesday/.cabal/logs/ghc-8.10.7/summoner-2.0.1.1-c3c1e3401d158075180b440c8e34badfd4b783045aca2430b10b5f677c72a348.log
):
Configuring library for summoner-2.0.1.1..
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
3.4' must specify the 'default-language' field for each component (e.g.
Haskell98 or Haskell2010). If a component uses different languages in
different modules then list the other ones in the 'other-languages' field.
Preprocessing library for summoner-2.0.1.1..
Building library for summoner-2.0.1.1..
[ 1 of 24] 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.1
      - tomland-1.3.3.1
      - time-1.9.3
      - shellmet-0.0.4.0
      - process-1.6.13.2
      - optparse-applicative-0.16.1.0
      - microaeson-0.1.0.0
      - gitrev-1.3.1
      - generic-data-0.8.3.0
      - filepath-1.4.2.1
      - directory-1.3.6.0
      - colourista-0.1.0.1
cabal: Failed to build summoner-2.0.1.1 (which is required by exe:summon from
summoner-2.0.1.1 and exe:gg from summoner-2.0.1.1). See the build log above
for details.

Unfortunately, I am not familiar with Haskell build process and I am not sure how this Paths_summoner.hs file is generated. I would appreciate any help. Something tells me I am doing some obvious mistake.

I used the following ghc and cabal versions.

ghc -V
The Glorious Glasgow Haskell Compilation System, version 8.10.7 (base-4.14.3.0)
cabal -V
cabal-install version 3.6.0.0
compiled using version 3.6.1.0 of the Cabal library

Btw. I can build the project using stack just fine.

chshersh commented 2 years ago

Hi @khrynczenko 👋🏻

This is an issue with cabal-install. See a similar issue in policeman for more context:

The problem is fixed in the latest cabal-install. So you should be able to build Summoner using cabal-install-3.6.2.0.

khrynczenko commented 2 years ago

Thanks for the response, good to know :)