gelisam / hawk

Haskell text processor for the command-line
Apache License 2.0
361 stars 20 forks source link

both cabal install and stack install seem to be broken on MacOS M1 with recommended setup from ghcup #275

Open Pieter-JanLavaerts opened 7 months ago

Pieter-JanLavaerts commented 7 months ago

versions

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.8

$ cabal --version
cabal-install version 3.10.2.1
compiled using version 3.10.2.1 of the Cabal library

$ stack --version
Version 2.13.1, Git revision 8102bb8afce90fc954f48efae38b87f37cabc988 (9949 commits) aarch64 hpack-0.36.0

stack install

$ stack install haskell-awk
haskell-awk> configure
haskell-awk> [1 of 2] Compiling Main             ( /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df
66e/haskell-awk-1.2.0.1/Setup.hs, /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1
.2.0.1/.stack-work/dist/aarch64-osx/ghc-9.2.7/setup/Main.o )
haskell-awk> [2 of 2] Compiling StackSetupShim   ( /Users/pieter-janlavaerts/.stack/setup-exe-src/setup-shim-6HauvNHV.hs, /priv
ate/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/.stack-work/dist/aarch64-osx/ghc
-9.2.7/setup/StackSetupShim.o )
haskell-awk> Linking /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/.stack
-work/dist/aarch64-osx/ghc-9.2.7/setup/setup ...
haskell-awk> Configuring haskell-awk-1.2.0.1...
haskell-awk> build
haskell-awk> Preprocessing library for haskell-awk-1.2.0.1..
haskell-awk> Building library for haskell-awk-1.2.0.1..
haskell-awk> [1 of 7] Compiling Paths_haskell_awk
haskell-awk> [2 of 7] Compiling System.Console.Hawk.Args.Spec
haskell-awk> [3 of 7] Compiling System.Console.Hawk.Path
haskell-awk> [4 of 7] Compiling System.Console.Hawk.Representable
haskell-awk> [5 of 7] Compiling System.Console.Hawk.Runtime.Base
haskell-awk> [6 of 7] Compiling System.Console.Hawk.Runtime
haskell-awk> [7 of 7] Compiling System.Console.Hawk.Version
haskell-awk> ld: warning: -single_module is obsolete
haskell-awk> Preprocessing executable 'hawk' for haskell-awk-1.2.0.1..
haskell-awk> Building executable 'hawk' for haskell-awk-1.2.0.1..
haskell-awk> [ 1 of 36] Compiling Control.Monad.Trans.State.Persistent
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/State/Persistent.hs:8:1: warning: [-Wunused-imports]
haskell-awk>     The import of ‘Control.Monad.Fail’ is redundant
haskell-awk>       except perhaps to import instances from ‘Control.Monad.Fail’
haskell-awk>     To import instances alone, use: import Control.Monad.Fail()
haskell-awk>   |
haskell-awk> 8 | import Control.Monad.Fail (MonadFail)
haskell-awk>   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-awk> [ 2 of 36] Compiling Control.Monad.Trans.Uncertain
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/Uncertain.hs:8:28: warning: [-Wunused-imports]
haskell-awk>     The import of ‘MonadFail’
haskell-awk>     from module ‘Control.Monad.Fail’ is redundant
haskell-awk>   |
haskell-awk> 8 | import Control.Monad.Fail (MonadFail, fail)
haskell-awk>   |                            ^^^^^^^^^
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/Uncertain.hs:37:3: warning: [-Wnoncanonical-monad-instances]
haskell-awk>     Noncanonical ‘return’ definition detected
haskell-awk>     in the instance declaration for ‘Monad (UncertainT m)’.
haskell-awk>     ‘return’ will eventually be removed in favour of ‘pure’
haskell-awk>     Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
haskell-awk>     See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
haskell-awk>    |
haskell-awk> 37 |   return = UncertainT . return
haskell-awk>    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-awk> [ 3 of 36] Compiling Control.Monad.Trans.OptionParser
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/OptionParser.hs:10:28: warning: [-Wunused-imports]
haskell-awk>     The import of ‘MonadFail’
haskell-awk>     from module ‘Control.Monad.Fail’ is redundant
haskell-awk>    |
haskell-awk> 10 | import Control.Monad.Fail (MonadFail, fail)
haskell-awk>    |                            ^^^^^^^^^
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/OptionParser.hs:79:3: warning: [-Wnoncanonical-monad-instances]
haskell-awk>     Noncanonical ‘return’ definition detected
haskell-awk>     in the instance declaration for ‘Monad (OptionParserT o m)’.
haskell-awk>     ‘return’ will eventually be removed in favour of ‘pure’
haskell-awk>     Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
haskell-awk>     See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
haskell-awk>    |
haskell-awk> 79 |   return = OptionParserT . return
haskell-awk>    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Control/Mo
nad/Trans/OptionParser.hs:484:11: warning: [-Wincomplete-uni-patterns]
haskell-awk>     Pattern match(es) are non-exhaustive
haskell-awk>     In a pattern binding:
haskell-awk>         Patterns of type ‘([String], [String])’ not matched:
haskell-awk>             ([], [])
haskell-awk>             ((_:_), [])
haskell-awk>             ([], ([]:_:_))
haskell-awk>             ([], ((_:_):_:_))
haskell-awk>             ...
haskell-awk>     |
haskell-awk> 484 |           (ss, [s]) = splitAt (n - 1) (map longName' os)
haskell-awk>     |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-awk> [ 4 of 36] Compiling Data.Cache
haskell-awk> [ 5 of 36] Compiling Data.HaskellExpr
haskell-awk> [ 6 of 36] Compiling Data.HaskellExpr.Base
haskell-awk> [ 7 of 36] Compiling Data.HaskellExpr.Eval
haskell-awk> [ 8 of 36] Compiling Data.HaskellSource
haskell-awk> [ 9 of 36] Compiling Data.HaskellModule.Base
haskell-awk> [10 of 36] Compiling Language.Haskell.Exts.Location
haskell-awk>
haskell-awk> /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/src/Language/H
askell/Exts/Location.hs:17:26: error:
haskell-awk>     Not in scope: type constructor or class ‘Option’
haskell-awk>    |
haskell-awk> 17 | type Located a = Writer (Option (Min SrcLoc)) a
haskell-awk>    |                          ^^^^^^

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package haskell-awk-1.2.0.1 (scroll up to its section to see the error) using:
       /private/var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/stack-27250cdc103df66e/haskell-awk-1.2.0.1/.stack-work/dist/aar
ch64-osx/ghc-9.2.7/setup/setup --verbose=1 --builddir=.stack-work/dist/aarch64-osx/ghc-9.2.7 build --ghc-options ""
       Process exited with code: ExitFailure 1

cabal install

$ cabal install haskell-awk
Resolving dependencies...
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
 - haskell-awk-1.2.0.1 (lib:haskell-awk, exe:hawk) (requires build)
Starting     haskell-awk-1.2.0.1 (all, legacy fallback)
Building     haskell-awk-1.2.0.1 (all, legacy fallback)

Failed to build haskell-awk-1.2.0.1.
Build log (
/Users/pieter-janlavaerts/.cabal/logs/ghc-9.4.8/hskll-wk-1.2.0.1-6c72c07c.log
):
[1 of 2] Compiling Main             ( /var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/cabal-install.-19942/dist-newstyle/tmp/s
rc-19942/haskell-awk-1.2.0.1/dist/setup/setup.hs, /var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/cabal-install.-19942/dist-ne
wstyle/tmp/src-19942/haskell-awk-1.2.0.1/dist/setup/Main.o )
[2 of 2] Linking /var/folders/dn/hjd7hfg9421ftmt61gy20fk00000gq/T/cabal-install.-19942/dist-newstyle/tmp/src-19942/haskell-awk-
1.2.0.1/dist/setup/setup
Configuring haskell-awk-1.2.0.1...
Preprocessing library for haskell-awk-1.2.0.1..
Building library for haskell-awk-1.2.0.1..
[1 of 7] Compiling Paths_haskell_awk ( dist/build/autogen/Paths_haskell_awk.hs, dist/build/Paths_haskell_awk.o, dist/build/Path
s_haskell_awk.dyn_o )
[2 of 7] Compiling System.Console.Hawk.Args.Spec ( runtime/System/Console/Hawk/Args/Spec.hs, dist/build/System/Console/Hawk/Arg
s/Spec.o, dist/build/System/Console/Hawk/Args/Spec.dyn_o )
[3 of 7] Compiling System.Console.Hawk.Path ( runtime/System/Console/Hawk/Path.hs, dist/build/System/Console/Hawk/Path.o, dist/
build/System/Console/Hawk/Path.dyn_o )
[4 of 7] Compiling System.Console.Hawk.Representable ( runtime/System/Console/Hawk/Representable.hs, dist/build/System/Console/
Hawk/Representable.o, dist/build/System/Console/Hawk/Representable.dyn_o )
[5 of 7] Compiling System.Console.Hawk.Runtime.Base ( runtime/System/Console/Hawk/Runtime/Base.hs, dist/build/System/Console/Ha
wk/Runtime/Base.o, dist/build/System/Console/Hawk/Runtime/Base.dyn_o )
[6 of 7] Compiling System.Console.Hawk.Runtime ( runtime/System/Console/Hawk/Runtime.hs, dist/build/System/Console/Hawk/Runtime
.o, dist/build/System/Console/Hawk/Runtime.dyn_o )
[7 of 7] Compiling System.Console.Hawk.Version ( runtime/System/Console/Hawk/Version.hs, dist/build/System/Console/Hawk/Version
.o, dist/build/System/Console/Hawk/Version.dyn_o )
ld: warning: -single_module is obsolete
Preprocessing executable 'hawk' for haskell-awk-1.2.0.1..
Building executable 'hawk' for haskell-awk-1.2.0.1..
[ 1 of 36] Compiling Control.Monad.Trans.State.Persistent ( src/Control/Monad/Trans/State/Persistent.hs, dist/build/hawk/hawk-t
mp/Control/Monad/Trans/State/Persistent.o )

src/Control/Monad/Trans/State/Persistent.hs:8:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad.Fail’ is redundant
      except perhaps to import instances from ‘Control.Monad.Fail’
    To import instances alone, use: import Control.Monad.Fail()
  |
8 | import Control.Monad.Fail (MonadFail)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 36] Compiling Control.Monad.Trans.Uncertain ( src/Control/Monad/Trans/Uncertain.hs, dist/build/hawk/hawk-tmp/Control/Mon
ad/Trans/Uncertain.o )

src/Control/Monad/Trans/Uncertain.hs:8:28: warning: [-Wunused-imports]
    The import of ‘MonadFail’
    from module ‘Control.Monad.Fail’ is redundant
  |
8 | import Control.Monad.Fail (MonadFail, fail)
  |                            ^^^^^^^^^

src/Control/Monad/Trans/Uncertain.hs:37:3: warning: [-Wnoncanonical-monad-instances]
    Noncanonical ‘return’ definition detected
    in the instance declaration for ‘Monad (UncertainT m)’.
    ‘return’ will eventually be removed in favour of ‘pure’
    Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
   |
37 |   return = UncertainT . return
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 3 of 36] Compiling Control.Monad.Trans.OptionParser ( src/Control/Monad/Trans/OptionParser.hs, dist/build/hawk/hawk-tmp/Contr
ol/Monad/Trans/OptionParser.o )

src/Control/Monad/Trans/OptionParser.hs:10:28: warning: [-Wunused-imports]
    The import of ‘MonadFail’
    from module ‘Control.Monad.Fail’ is redundant
   |
10 | import Control.Monad.Fail (MonadFail, fail)
   |                            ^^^^^^^^^

src/Control/Monad/Trans/OptionParser.hs:79:3: warning: [-Wnoncanonical-monad-instances]
    Noncanonical ‘return’ definition detected
    in the instance declaration for ‘Monad (OptionParserT o m)’.
    ‘return’ will eventually be removed in favour of ‘pure’
    Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
   |
79 |   return = OptionParserT . return
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Control/Monad/Trans/OptionParser.hs:484:11: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘([String], [String])’ not matched:
            (_, [])
            (_, (_:_:_))
    |
484 |           (ss, [s]) = splitAt (n - 1) (map longName' os)
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 36] Compiling Data.Cache       ( src/Data/Cache.hs, dist/build/hawk/hawk-tmp/Data/Cache.o )
[ 5 of 36] Compiling Data.HaskellExpr ( src/Data/HaskellExpr.hs, dist/build/hawk/hawk-tmp/Data/HaskellExpr.o )
[ 6 of 36] Compiling Data.HaskellExpr.Base ( src/Data/HaskellExpr/Base.hs, dist/build/hawk/hawk-tmp/Data/HaskellExpr/Base.o )
[ 7 of 36] Compiling Data.HaskellExpr.Eval ( src/Data/HaskellExpr/Eval.hs, dist/build/hawk/hawk-tmp/Data/HaskellExpr/Eval.o )
[ 8 of 36] Compiling Data.HaskellSource ( src/Data/HaskellSource.hs, dist/build/hawk/hawk-tmp/Data/HaskellSource.o )
[ 9 of 36] Compiling Data.HaskellModule.Base ( src/Data/HaskellModule/Base.hs, dist/build/hawk/hawk-tmp/Data/HaskellModule/Base
.o )
[10 of 36] Compiling Language.Haskell.Exts.Location ( src/Language/Haskell/Exts/Location.hs, dist/build/hawk/hawk-tmp/Language/
Haskell/Exts/Location.o )

src/Language/Haskell/Exts/Location.hs:17:26: error:
    Not in scope: type constructor or class ‘Option’
   |
17 | type Located a = Writer (Option (Min SrcLoc)) a
   |                          ^^^^^^
[13 of 36] Compiling Paths_haskell_awk ( dist/build/hawk/autogen/Paths_haskell_awk.hs, dist/build/hawk/hawk-tmp/Paths_haskell_a
wk.o )
[14 of 36] Compiling System.Console.Hawk.Args.Option ( src/System/Console/Hawk/Args/Option.hs, dist/build/hawk/hawk-tmp/System/
Console/Hawk/Args/Option.o )
[15 of 36] Compiling System.Console.Hawk.Context.Paths ( src/System/Console/Hawk/Context/Paths.hs, dist/build/hawk/hawk-tmp/Sys
tem/Console/Hawk/Context/Paths.o )
[16 of 36] Compiling System.Console.Hawk.Help ( src/System/Console/Hawk/Help.hs, dist/build/hawk/hawk-tmp/System/Console/Hawk/H
elp.o )
[17 of 36] Compiling System.Console.Hawk.Lock ( src/System/Console/Hawk/Lock.hs, dist/build/hawk/hawk-tmp/System/Console/Hawk/L
ock.o )
[18 of 36] Compiling System.Console.Hawk.PackageDbs.TH ( src/System/Console/Hawk/PackageDbs/TH.hs, dist/build/hawk/hawk-tmp/Sys
tem/Console/Hawk/PackageDbs/TH.o, dist/build/hawk/hawk-tmp/System/Console/Hawk/PackageDbs/TH.dyn_o )
[19 of 36] Compiling System.Console.Hawk.Runtime.HaskellExpr ( src/System/Console/Hawk/Runtime/HaskellExpr.hs, dist/build/hawk/
hawk-tmp/System/Console/Hawk/Runtime/HaskellExpr.o )
[20 of 36] Compiling System.Console.Hawk.UserExpr.OriginalExpr ( src/System/Console/Hawk/UserExpr/OriginalExpr.hs, dist/build/h
awk/hawk-tmp/System/Console/Hawk/UserExpr/OriginalExpr.o )
[21 of 36] Compiling System.Console.Hawk.UserExpr.InputReadyExpr ( src/System/Console/Hawk/UserExpr/InputReadyExpr.hs, dist/bui
ld/hawk/hawk-tmp/System/Console/Hawk/UserExpr/InputReadyExpr.o )
[24 of 36] Compiling System.Directory.Extra ( src/System/Directory/Extra.hs, dist/build/hawk/hawk-tmp/System/Directory/Extra.o
)
[29 of 36] Compiling System.Directory.PathFinder ( src/System/Directory/PathFinder.hs, dist/build/hawk/hawk-tmp/System/Director
y/PathFinder.o, dist/build/hawk/hawk-tmp/System/Directory/PathFinder.dyn_o )
[30 of 36] Compiling System.Console.Hawk.PackageDbs ( src/System/Console/Hawk/PackageDbs.hs, dist/build/hawk/hawk-tmp/System/Co
nsole/Hawk/PackageDbs.o, dist/build/hawk/hawk-tmp/System/Console/Hawk/PackageDbs.dyn_o )
ld: warning: -single_module is obsolete
Error: cabal: Failed to build haskell-awk-1.2.0.1. See the build log above for
details.
Pieter-JanLavaerts commented 7 months ago

I just saw the PR to support a newer GHC version why hasn't in been merged yet?

gelisam commented 7 months ago

Not in scope: type constructor or class ‘Option’

Thank you for reporting this. I am clearly missing an upper bound on one of my dependencies, now I need to figure out which one.

gelisam commented 7 months ago

I just saw the PR to support a newer GHC version why hasn't in been merged yet?

The main reason is that I don't have a lot of time for open source projects anymore. Looking at that PR specifically, it looks like I was not able to get CI to pass for that MR. I am not able to get CI to pass for the main branch either anymore, perhaps because of the missing upper bound?

gelisam commented 7 months ago

Good news! #267 has already fixed the issue with Not in scope: type constructor or class ‘Option’, so I just need to release a new version to hackage!

gelisam commented 7 months ago

I am clearly missing an upper bound on one of my dependencies, now I need to figure out which one.

Data.Semigroup.Option is from base. It has been removed in ghc-9.2. https://hackage.haskell.org/package/base-4.15.1.0/docs/Data-Semigroup.html#t:Option

as one might expect from that, cabal install haskell-awk works when ghcup is set to ghc-9.0.2 (base-4.15.1.0), but fails with ghc-9.2.1 (base-4.16.0.0). Thus, the missing upper bound is base < 4.16.

gelisam commented 7 months ago

the revision has been published, cabal install haskell-awk now correctly fails with Could not resolve dependencies instead of Not in scope: type constructor or class ‘Option’. I have not yet published the version which includes #267, because I have run out of time for open source work for today, oh well.